diff --git a/sdk/batch/Azure.Temp.Batch/Azure.Temp.Batch.sln b/sdk/batch/Azure.Temp.Batch/Azure.Temp.Batch.sln new file mode 100644 index 000000000000..fa3ca3cc2134 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/Azure.Temp.Batch.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33829.357 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Temp.Batch", "src\Azure.Temp.Batch.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/batch/Azure.Temp.Batch/CHANGELOG.md b/sdk/batch/Azure.Temp.Batch/CHANGELOG.md new file mode 100644 index 000000000000..0e50c409dcfa --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/CHANGELOG.md @@ -0,0 +1,112 @@ +# Release History + +## 1.0.3-beta.20 (2022-04-26) + +### Other Changes +- Release DPG library +- Add Grow-up story + +## 1.0.3-beta.19 (2020-09-24) +- Test Submit-PR + +## 1.0.3-beta.18 (2020-09-24) +- Test Submit-PR + +## 1.0.3-beta.17 (2020-09-16) +- Package Artifacts directory restructure, attempt 7 + +## 1.0.3-beta.16 (2020-09-15) +- Package Artifacts directory restructure, attempt 6 + +## 1.0.3-beta.15 (2020-09-15) +- Package Artifacts directory restructure, attempt 5 + +## 1.0.3-beta.14 (2020-09-14) +- Package Artifacts directory restructure, attempt 4 + +## 1.0.3-beta.13 (2020-09-14) +- Package Artifacts directory restructure, attempt 3 + +## 1.0.3-beta.12 (2020-09-11) +- Package Artifacts directory restructure, attempt 2 + +## 1.0.3-beta.11 (2020-09-10) +- Package Artifacts directory restructure + +## 1.0.3-beta.10 (2020-09-09) +- Enable the master link replacement feature, attempt 3 + +## 1.0.3-beta.9 (2020-09-09) +- Enable the master link replacement feature, attempt 2 + +## 1.0.3-beta.8 (2020-09-09) +- Enable the master link replacement feature, attempt 1 + +## 1.0.3-beta.7 (2020-09-04) +- Test release tag replacement + +## 1.0.3-beta.6 (2020-09-03) +- Test new alpha beta versioning + +## 1.0.3-beta.5 (2020-09-03) +- Test new alpha beta versioning + +## 1.0.3-beta.4 (2020-09-01) +- Test new alpha beta versioning + +## 1.0.3-beta.3 (2020-08-31) +- Test new alpha beta versioning + +## 1.0.3-beta.2 (2020-08-30) +- Test new alpha beta versioning + +## 1.0.3-beta.1 (2020-08-27) +- Test new alpha beta versioning + +## 1.0.2-preview.17 (2020-07-24) +- Test release pipeline + +## 1.0.2-preview.15 (2020-06-29) +- Test release pipeline + +## 1.0.2-preview.14 (2020-06-02) +- Test release pipeline + +## 1.0.2-preview.13 (2020-03-23) +- Test release pipeline + +## 1.0.2-preview.12 (2020-03-23) +- Test release pipeline + +## 1.0.2-preview.11 (2020-03-23) +- Test release pipeline + +## 1.0.2-preview.10 (2020-03-23) +- Test release pipeline + +## 1.0.2-preview.9 (2020-03-17) +- Test release pipeline + +## 1.0.2-preview.8 (2020-03-10) +- Testing out release pipeline + +## 1.0.2-preview.7 (2020-03-06) +- Testing out release pipeline + +## 1.0.2-preview.6 (2020-02-24) +### Added +- Testing Changelog added section +- Testing Links [Project Site](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/README.md) +- Test `Highlighted Code` + +## 1.0.2-preview.5 (2020-02-24) +### Added +- Testing Changelog added section +- Testing Links [Project Site](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/README.md) +- Test `Highlighted Code` + +## 1.0.2-preview.4 (2019-12-17) +- Version Bump + +## 1.0.2-preview.3 (2019-12-17) +- Started changelog to capture release notes. \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/Directory.Build.props b/sdk/batch/Azure.Temp.Batch/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/batch/Azure.Temp.Batch/README.md b/sdk/batch/Azure.Temp.Batch/README.md new file mode 100644 index 000000000000..0122323fb117 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/README.md @@ -0,0 +1,102 @@ +# Azure Template client library for .NET + +Azure Template is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Template --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://learn.microsoft.com/dotnet/azure/sdk/unit-testing-mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/template/Azure.Template/samples). + +### Get secret + +The `GetSecret` method retrieves a secret from the service. + +```C# Snippet:Azure_Template_GetSecret +string endpoint = "https://myvault.vault.azure.net"; +var credential = new DefaultAzureCredential(); +var client = new TemplateClient(endpoint, credential); + +SecretBundle secret = client.GetSecretValue("TestSecret"); + +Console.WriteLine(secret.Value); +```Python +things = client.list_things() +``` + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/template/Azure.Template/README.png) diff --git a/sdk/batch/Azure.Temp.Batch/api/Azure.Temp.Batch.netstandard2.0.cs b/sdk/batch/Azure.Temp.Batch/api/Azure.Temp.Batch.netstandard2.0.cs new file mode 100644 index 000000000000..96032aac4c14 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/api/Azure.Temp.Batch.netstandard2.0.cs @@ -0,0 +1,2513 @@ +namespace Azure.Temp.Batch.Models +{ + public partial class AccountListPoolNodeCountsOptions + { + public AccountListPoolNodeCountsOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class AccountListSupportedImagesOptions + { + public AccountListSupportedImagesOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class AffinityInformation + { + public AffinityInformation(string affinityId) { } + public string AffinityId { get { throw null; } set { } } + } + public enum AllocationState + { + Steady = 0, + Resizing = 1, + Stopping = 2, + } + public partial class ApplicationGetOptions + { + public ApplicationGetOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class ApplicationListOptions + { + public ApplicationListOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class ApplicationPackageReference + { + public ApplicationPackageReference(string applicationId) { } + public string ApplicationId { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + } + public partial class ApplicationSummary + { + internal ApplicationSummary() { } + public string DisplayName { get { throw null; } } + public string Id { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Versions { get { throw null; } } + } + public partial class AuthenticationTokenSettings + { + public AuthenticationTokenSettings() { } + public System.Collections.Generic.IList Access { get { throw null; } } + } + public partial class AutoPoolSpecification + { + public AutoPoolSpecification(Azure.Temp.Batch.Models.PoolLifetimeOption poolLifetimeOption) { } + public string AutoPoolIdPrefix { get { throw null; } set { } } + public bool? KeepAlive { get { throw null; } set { } } + public Azure.Temp.Batch.Models.PoolSpecification Pool { get { throw null; } set { } } + public Azure.Temp.Batch.Models.PoolLifetimeOption PoolLifetimeOption { get { throw null; } set { } } + } + public partial class AutoScaleRun + { + internal AutoScaleRun() { } + public Azure.Temp.Batch.Models.AutoScaleRunError Error { get { throw null; } } + public string Results { get { throw null; } } + public System.DateTimeOffset Timestamp { get { throw null; } } + } + public partial class AutoScaleRunError + { + internal AutoScaleRunError() { } + public string Code { get { throw null; } } + public string Message { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Values { get { throw null; } } + } + public enum AutoUserScope + { + Task = 0, + Pool = 1, + } + public partial class AutoUserSpecification + { + public AutoUserSpecification() { } + public Azure.Temp.Batch.Models.ElevationLevel? ElevationLevel { get { throw null; } set { } } + public Azure.Temp.Batch.Models.AutoUserScope? Scope { get { throw null; } set { } } + } + public partial class AzureBlobFileSystemConfiguration + { + public AzureBlobFileSystemConfiguration(string accountName, string containerName, string relativeMountPath) { } + public string AccountKey { get { throw null; } set { } } + public string AccountName { get { throw null; } set { } } + public string BlobfuseOptions { get { throw null; } set { } } + public string ContainerName { get { throw null; } set { } } + public Azure.Temp.Batch.Models.ComputeNodeIdentityReference IdentityReference { get { throw null; } set { } } + public string RelativeMountPath { get { throw null; } set { } } + public string SasKey { get { throw null; } set { } } + } + public partial class AzureFileShareConfiguration + { + public AzureFileShareConfiguration(string accountName, string azureFileUrl, string accountKey, string relativeMountPath) { } + public string AccountKey { get { throw null; } set { } } + public string AccountName { get { throw null; } set { } } + public string AzureFileUrl { get { throw null; } set { } } + public string MountOptions { get { throw null; } set { } } + public string RelativeMountPath { get { throw null; } set { } } + } + public partial class BatchError + { + internal BatchError() { } + public string Code { get { throw null; } } + public Azure.Temp.Batch.Models.ErrorMessage Message { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Values { get { throw null; } } + } + public partial class BatchErrorDetail + { + internal BatchErrorDetail() { } + public string Key { get { throw null; } } + public string Value { get { throw null; } } + } + public partial class BatchPoolIdentity + { + internal BatchPoolIdentity() { } + public Azure.Temp.Batch.Models.PoolIdentityType Type { get { throw null; } } + public System.Collections.Generic.IReadOnlyList UserAssignedIdentities { get { throw null; } } + } + public enum CachingType + { + None = 0, + ReadOnly = 1, + ReadWrite = 2, + } + public partial class Certificate + { + internal Certificate() { } + public Azure.Temp.Batch.Models.DeleteCertificateError DeleteCertificateError { get { throw null; } } + public Azure.Temp.Batch.Models.CertificateState? PreviousState { get { throw null; } } + public System.DateTimeOffset? PreviousStateTransitionTime { get { throw null; } } + public string PublicData { get { throw null; } } + public Azure.Temp.Batch.Models.CertificateState? State { get { throw null; } } + public System.DateTimeOffset? StateTransitionTime { get { throw null; } } + public string Thumbprint { get { throw null; } } + public string ThumbprintAlgorithm { get { throw null; } } + public string Url { get { throw null; } } + } + public partial class CertificateAddOptions + { + public CertificateAddOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class CertificateAddParameter + { + public CertificateAddParameter(string thumbprint, string thumbprintAlgorithm, string data) { } + public Azure.Temp.Batch.Models.CertificateFormat? CertificateFormat { get { throw null; } set { } } + public string Data { get { throw null; } } + public string Password { get { throw null; } set { } } + public string Thumbprint { get { throw null; } } + public string ThumbprintAlgorithm { get { throw null; } } + } + public partial class CertificateCancelDeletionOptions + { + public CertificateCancelDeletionOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class CertificateDeleteOptions + { + public CertificateDeleteOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public enum CertificateFormat + { + Pfx = 0, + Cer = 1, + } + public partial class CertificateGetOptions + { + public CertificateGetOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class CertificateListOptions + { + public CertificateListOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class CertificateReference + { + public CertificateReference(string thumbprint, string thumbprintAlgorithm) { } + public Azure.Temp.Batch.Models.CertificateStoreLocation? StoreLocation { get { throw null; } set { } } + public string StoreName { get { throw null; } set { } } + public string Thumbprint { get { throw null; } set { } } + public string ThumbprintAlgorithm { get { throw null; } set { } } + public System.Collections.Generic.IList Visibility { get { throw null; } } + } + public enum CertificateState + { + Active = 0, + Deleting = 1, + DeleteFailed = 2, + } + public enum CertificateStoreLocation + { + CurrentUser = 0, + LocalMachine = 1, + } + public enum CertificateVisibility + { + StartTask = 0, + Task = 1, + RemoteUser = 2, + } + public partial class CifsMountConfiguration + { + public CifsMountConfiguration(string username, string source, string relativeMountPath, string password) { } + public string MountOptions { get { throw null; } set { } } + public string Password { get { throw null; } set { } } + public string RelativeMountPath { get { throw null; } set { } } + public string Source { get { throw null; } set { } } + public string Username { get { throw null; } set { } } + } + public partial class CloudJob + { + internal CloudJob() { } + public bool? AllowTaskPreemption { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CommonEnvironmentSettings { get { throw null; } } + public Azure.Temp.Batch.Models.JobConstraints Constraints { get { throw null; } } + public System.DateTimeOffset? CreationTime { get { throw null; } } + public string DisplayName { get { throw null; } } + public string ETag { get { throw null; } } + public Azure.Temp.Batch.Models.JobExecutionInformation ExecutionInfo { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Temp.Batch.Models.JobManagerTask JobManagerTask { get { throw null; } } + public Azure.Temp.Batch.Models.JobPreparationTask JobPreparationTask { get { throw null; } } + public Azure.Temp.Batch.Models.JobReleaseTask JobReleaseTask { get { throw null; } } + public System.DateTimeOffset? LastModified { get { throw null; } } + public int? MaxParallelTasks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Metadata { get { throw null; } } + public Azure.Temp.Batch.Models.JobNetworkConfiguration NetworkConfiguration { get { throw null; } } + public Azure.Temp.Batch.Models.OnAllTasksComplete? OnAllTasksComplete { get { throw null; } } + public Azure.Temp.Batch.Models.OnTaskFailure? OnTaskFailure { get { throw null; } } + public Azure.Temp.Batch.Models.PoolInformation PoolInfo { get { throw null; } } + public Azure.Temp.Batch.Models.JobState? PreviousState { get { throw null; } } + public System.DateTimeOffset? PreviousStateTransitionTime { get { throw null; } } + public int? Priority { get { throw null; } } + public Azure.Temp.Batch.Models.JobState? State { get { throw null; } } + public System.DateTimeOffset? StateTransitionTime { get { throw null; } } + public Azure.Temp.Batch.Models.JobStatistics Stats { get { throw null; } } + public string Url { get { throw null; } } + public bool? UsesTaskDependencies { get { throw null; } } + } + public partial class CloudJobSchedule + { + internal CloudJobSchedule() { } + public System.DateTimeOffset? CreationTime { get { throw null; } } + public string DisplayName { get { throw null; } } + public string ETag { get { throw null; } } + public Azure.Temp.Batch.Models.JobScheduleExecutionInformation ExecutionInfo { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Temp.Batch.Models.JobSpecification JobSpecification { get { throw null; } } + public System.DateTimeOffset? LastModified { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Metadata { get { throw null; } } + public Azure.Temp.Batch.Models.JobScheduleState? PreviousState { get { throw null; } } + public System.DateTimeOffset? PreviousStateTransitionTime { get { throw null; } } + public Azure.Temp.Batch.Models.Schedule Schedule { get { throw null; } } + public Azure.Temp.Batch.Models.JobScheduleState? State { get { throw null; } } + public System.DateTimeOffset? StateTransitionTime { get { throw null; } } + public Azure.Temp.Batch.Models.JobScheduleStatistics Stats { get { throw null; } } + public string Url { get { throw null; } } + } + public partial class CloudPool + { + internal CloudPool() { } + public Azure.Temp.Batch.Models.AllocationState? AllocationState { get { throw null; } } + public System.DateTimeOffset? AllocationStateTransitionTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ApplicationLicenses { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ApplicationPackageReferences { get { throw null; } } + public System.TimeSpan? AutoScaleEvaluationInterval { get { throw null; } } + public string AutoScaleFormula { get { throw null; } } + public Azure.Temp.Batch.Models.AutoScaleRun AutoScaleRun { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CertificateReferences { get { throw null; } } + public Azure.Temp.Batch.Models.CloudServiceConfiguration CloudServiceConfiguration { get { throw null; } } + public System.DateTimeOffset? CreationTime { get { throw null; } } + public int? CurrentDedicatedNodes { get { throw null; } } + public int? CurrentLowPriorityNodes { get { throw null; } } + public Azure.Temp.Batch.Models.NodeCommunicationMode? CurrentNodeCommunicationMode { get { throw null; } } + public string DisplayName { get { throw null; } } + public bool? EnableAutoScale { get { throw null; } } + public bool? EnableInterNodeCommunication { get { throw null; } } + public string ETag { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Temp.Batch.Models.BatchPoolIdentity Identity { get { throw null; } } + public System.DateTimeOffset? LastModified { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Metadata { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MountConfiguration { get { throw null; } } + public Azure.Temp.Batch.Models.NetworkConfiguration NetworkConfiguration { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ResizeErrors { get { throw null; } } + public System.TimeSpan? ResizeTimeout { get { throw null; } } + public Azure.Temp.Batch.Models.StartTask StartTask { get { throw null; } } + public Azure.Temp.Batch.Models.PoolState? State { get { throw null; } } + public System.DateTimeOffset? StateTransitionTime { get { throw null; } } + public Azure.Temp.Batch.Models.PoolStatistics Stats { get { throw null; } } + public int? TargetDedicatedNodes { get { throw null; } } + public int? TargetLowPriorityNodes { get { throw null; } } + public Azure.Temp.Batch.Models.NodeCommunicationMode? TargetNodeCommunicationMode { get { throw null; } } + public Azure.Temp.Batch.Models.TaskSchedulingPolicy TaskSchedulingPolicy { get { throw null; } } + public int? TaskSlotsPerNode { get { throw null; } } + public string Url { get { throw null; } } + public System.Collections.Generic.IReadOnlyList UserAccounts { get { throw null; } } + public Azure.Temp.Batch.Models.VirtualMachineConfiguration VirtualMachineConfiguration { get { throw null; } } + public string VmSize { get { throw null; } } + } + public partial class CloudServiceConfiguration + { + public CloudServiceConfiguration(string osFamily) { } + public string OsFamily { get { throw null; } set { } } + public string OsVersion { get { throw null; } set { } } + } + public partial class CloudTask + { + internal CloudTask() { } + public Azure.Temp.Batch.Models.AffinityInformation AffinityInfo { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ApplicationPackageReferences { get { throw null; } } + public Azure.Temp.Batch.Models.AuthenticationTokenSettings AuthenticationTokenSettings { get { throw null; } } + public string CommandLine { get { throw null; } } + public Azure.Temp.Batch.Models.TaskConstraints Constraints { get { throw null; } } + public Azure.Temp.Batch.Models.TaskContainerSettings ContainerSettings { get { throw null; } } + public System.DateTimeOffset? CreationTime { get { throw null; } } + public Azure.Temp.Batch.Models.TaskDependencies DependsOn { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList EnvironmentSettings { get { throw null; } } + public string ETag { get { throw null; } } + public Azure.Temp.Batch.Models.TaskExecutionInformation ExecutionInfo { get { throw null; } } + public Azure.Temp.Batch.Models.ExitConditions ExitConditions { get { throw null; } } + public string Id { get { throw null; } } + public System.DateTimeOffset? LastModified { get { throw null; } } + public Azure.Temp.Batch.Models.MultiInstanceSettings MultiInstanceSettings { get { throw null; } } + public Azure.Temp.Batch.Models.ComputeNodeInformation NodeInfo { get { throw null; } } + public System.Collections.Generic.IReadOnlyList OutputFiles { get { throw null; } } + public Azure.Temp.Batch.Models.TaskState? PreviousState { get { throw null; } } + public System.DateTimeOffset? PreviousStateTransitionTime { get { throw null; } } + public int? RequiredSlots { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ResourceFiles { get { throw null; } } + public Azure.Temp.Batch.Models.TaskState? State { get { throw null; } } + public System.DateTimeOffset? StateTransitionTime { get { throw null; } } + public Azure.Temp.Batch.Models.TaskStatistics Stats { get { throw null; } } + public string Url { get { throw null; } } + public Azure.Temp.Batch.Models.UserIdentity UserIdentity { get { throw null; } } + } + public partial class CloudTaskListSubtasksResult + { + internal CloudTaskListSubtasksResult() { } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + } + public partial class ComputeNode + { + internal ComputeNode() { } + public string AffinityId { get { throw null; } } + public System.DateTimeOffset? AllocationTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CertificateReferences { get { throw null; } } + public Azure.Temp.Batch.Models.ComputeNodeEndpointConfiguration EndpointConfiguration { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public string Id { get { throw null; } } + public string IpAddress { get { throw null; } } + public bool? IsDedicated { get { throw null; } } + public System.DateTimeOffset? LastBootTime { get { throw null; } } + public Azure.Temp.Batch.Models.NodeAgentInformation NodeAgentInfo { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RecentTasks { get { throw null; } } + public int? RunningTasksCount { get { throw null; } } + public int? RunningTaskSlotsCount { get { throw null; } } + public Azure.Temp.Batch.Models.SchedulingState? SchedulingState { get { throw null; } } + public Azure.Temp.Batch.Models.StartTask StartTask { get { throw null; } } + public Azure.Temp.Batch.Models.StartTaskInformation StartTaskInfo { get { throw null; } } + public Azure.Temp.Batch.Models.ComputeNodeState? State { get { throw null; } } + public System.DateTimeOffset? StateTransitionTime { get { throw null; } } + public int? TotalTasksRun { get { throw null; } } + public int? TotalTasksSucceeded { get { throw null; } } + public string Url { get { throw null; } } + public Azure.Temp.Batch.Models.VirtualMachineInfo VirtualMachineInfo { get { throw null; } } + public string VmSize { get { throw null; } } + } + public partial class ComputeNodeAddUserOptions + { + public ComputeNodeAddUserOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public enum ComputeNodeDeallocationOption + { + Requeue = 0, + Terminate = 1, + TaskCompletion = 2, + RetainedData = 3, + } + public partial class ComputeNodeDeleteUserOptions + { + public ComputeNodeDeleteUserOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class ComputeNodeDisableSchedulingOptions + { + public ComputeNodeDisableSchedulingOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class ComputeNodeEnableSchedulingOptions + { + public ComputeNodeEnableSchedulingOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class ComputeNodeEndpointConfiguration + { + internal ComputeNodeEndpointConfiguration() { } + public System.Collections.Generic.IReadOnlyList InboundEndpoints { get { throw null; } } + } + public partial class ComputeNodeError + { + internal ComputeNodeError() { } + public string Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ErrorDetails { get { throw null; } } + public string Message { get { throw null; } } + } + public partial class ComputeNodeExtensionGetOptions + { + public ComputeNodeExtensionGetOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class ComputeNodeExtensionListOptions + { + public ComputeNodeExtensionListOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public enum ComputeNodeFillType + { + Spread = 0, + Pack = 1, + } + public partial class ComputeNodeGetOptions + { + public ComputeNodeGetOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class ComputeNodeGetRemoteDesktopOptions + { + public ComputeNodeGetRemoteDesktopOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class ComputeNodeGetRemoteLoginSettingsOptions + { + public ComputeNodeGetRemoteLoginSettingsOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class ComputeNodeGetRemoteLoginSettingsResult + { + internal ComputeNodeGetRemoteLoginSettingsResult() { } + public string RemoteLoginIPAddress { get { throw null; } } + public int RemoteLoginPort { get { throw null; } } + } + public partial class ComputeNodeIdentityReference + { + public ComputeNodeIdentityReference() { } + public string ResourceId { get { throw null; } set { } } + } + public partial class ComputeNodeInformation + { + internal ComputeNodeInformation() { } + public string AffinityId { get { throw null; } } + public string NodeId { get { throw null; } } + public string NodeUrl { get { throw null; } } + public string PoolId { get { throw null; } } + public string TaskRootDirectory { get { throw null; } } + public string TaskRootDirectoryUrl { get { throw null; } } + } + public partial class ComputeNodeListOptions + { + public ComputeNodeListOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public enum ComputeNodeRebootOption + { + Requeue = 0, + Terminate = 1, + TaskCompletion = 2, + RetainedData = 3, + } + public partial class ComputeNodeRebootOptions + { + public ComputeNodeRebootOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public enum ComputeNodeReimageOption + { + Requeue = 0, + Terminate = 1, + TaskCompletion = 2, + RetainedData = 3, + } + public partial class ComputeNodeReimageOptions + { + public ComputeNodeReimageOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public enum ComputeNodeState + { + Idle = 0, + Rebooting = 1, + Reimaging = 2, + Running = 3, + Unusable = 4, + Creating = 5, + Starting = 6, + WaitingForStartTask = 7, + StartTaskFailed = 8, + Unknown = 9, + LeavingPool = 10, + Offline = 11, + Preempted = 12, + } + public partial class ComputeNodeUpdateUserOptions + { + public ComputeNodeUpdateUserOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class ComputeNodeUploadBatchServiceLogsOptions + { + public ComputeNodeUploadBatchServiceLogsOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class ComputeNodeUser + { + public ComputeNodeUser(string name) { } + public System.DateTimeOffset? ExpiryTime { get { throw null; } set { } } + public bool? IsAdmin { get { throw null; } set { } } + public string Name { get { throw null; } } + public string Password { get { throw null; } set { } } + public string SshPublicKey { get { throw null; } set { } } + } + public partial class ContainerConfiguration + { + public ContainerConfiguration(Azure.Temp.Batch.Models.ContainerType type) { } + public System.Collections.Generic.IList ContainerImageNames { get { throw null; } } + public System.Collections.Generic.IList ContainerRegistries { get { throw null; } } + public Azure.Temp.Batch.Models.ContainerType Type { get { throw null; } set { } } + } + public partial class ContainerRegistry + { + public ContainerRegistry() { } + public Azure.Temp.Batch.Models.ComputeNodeIdentityReference IdentityReference { get { throw null; } set { } } + public string Password { get { throw null; } set { } } + public string RegistryServer { get { throw null; } set { } } + public string UserName { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerType(string value) { throw null; } + public static Azure.Temp.Batch.Models.ContainerType CriCompatible { get { throw null; } } + public static Azure.Temp.Batch.Models.ContainerType DockerCompatible { get { throw null; } } + public bool Equals(Azure.Temp.Batch.Models.ContainerType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Temp.Batch.Models.ContainerType left, Azure.Temp.Batch.Models.ContainerType right) { throw null; } + public static implicit operator Azure.Temp.Batch.Models.ContainerType (string value) { throw null; } + public static bool operator !=(Azure.Temp.Batch.Models.ContainerType left, Azure.Temp.Batch.Models.ContainerType right) { throw null; } + public override string ToString() { throw null; } + } + public enum ContainerWorkingDirectory + { + TaskWorkingDirectory = 0, + ContainerImageDefault = 1, + } + public partial class DataDisk + { + public DataDisk(int lun, int diskSizeGB) { } + public Azure.Temp.Batch.Models.CachingType? Caching { get { throw null; } set { } } + public int DiskSizeGB { get { throw null; } set { } } + public int Lun { get { throw null; } set { } } + public Azure.Temp.Batch.Models.StorageAccountType? StorageAccountType { get { throw null; } set { } } + } + public partial class DeleteCertificateError + { + internal DeleteCertificateError() { } + public string Code { get { throw null; } } + public string Message { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Values { get { throw null; } } + } + public enum DependencyAction + { + Satisfy = 0, + Block = 1, + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DiffDiskPlacement : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DiffDiskPlacement(string value) { throw null; } + public static Azure.Temp.Batch.Models.DiffDiskPlacement CacheDisk { get { throw null; } } + public bool Equals(Azure.Temp.Batch.Models.DiffDiskPlacement other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Temp.Batch.Models.DiffDiskPlacement left, Azure.Temp.Batch.Models.DiffDiskPlacement right) { throw null; } + public static implicit operator Azure.Temp.Batch.Models.DiffDiskPlacement (string value) { throw null; } + public static bool operator !=(Azure.Temp.Batch.Models.DiffDiskPlacement left, Azure.Temp.Batch.Models.DiffDiskPlacement right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DiffDiskSettings + { + public DiffDiskSettings() { } + public Azure.Temp.Batch.Models.DiffDiskPlacement? Placement { get { throw null; } set { } } + } + public enum DisableComputeNodeSchedulingOption + { + Requeue = 0, + Terminate = 1, + TaskCompletion = 2, + } + public enum DisableJobOption + { + Requeue = 0, + Terminate = 1, + Wait = 2, + } + public partial class DiskEncryptionConfiguration + { + public DiskEncryptionConfiguration() { } + public System.Collections.Generic.IList Targets { get { throw null; } } + } + public enum DiskEncryptionTarget + { + OsDisk = 0, + TemporaryDisk = 1, + } + public enum DynamicVNetAssignmentScope + { + None = 0, + Job = 1, + } + public enum ElevationLevel + { + NonAdmin = 0, + Admin = 1, + } + public partial class EnvironmentSetting + { + public EnvironmentSetting(string name) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + } + public enum ErrorCategory + { + UserError = 0, + ServerError = 1, + } + public partial class ErrorMessage + { + internal ErrorMessage() { } + public string Lang { get { throw null; } } + public string Value { get { throw null; } } + } + public partial class ExitCodeMapping + { + public ExitCodeMapping(int code, Azure.Temp.Batch.Models.ExitOptions exitOptions) { } + public int Code { get { throw null; } set { } } + public Azure.Temp.Batch.Models.ExitOptions ExitOptions { get { throw null; } set { } } + } + public partial class ExitCodeRangeMapping + { + public ExitCodeRangeMapping(int start, int end, Azure.Temp.Batch.Models.ExitOptions exitOptions) { } + public int End { get { throw null; } set { } } + public Azure.Temp.Batch.Models.ExitOptions ExitOptions { get { throw null; } set { } } + public int Start { get { throw null; } set { } } + } + public partial class ExitConditions + { + public ExitConditions() { } + public Azure.Temp.Batch.Models.ExitOptions Default { get { throw null; } set { } } + public System.Collections.Generic.IList ExitCodeRanges { get { throw null; } } + public System.Collections.Generic.IList ExitCodes { get { throw null; } } + public Azure.Temp.Batch.Models.ExitOptions FileUploadError { get { throw null; } set { } } + public Azure.Temp.Batch.Models.ExitOptions PreProcessingError { get { throw null; } set { } } + } + public partial class ExitOptions + { + public ExitOptions() { } + public Azure.Temp.Batch.Models.DependencyAction? DependencyAction { get { throw null; } set { } } + public Azure.Temp.Batch.Models.JobAction? JobAction { get { throw null; } set { } } + } + public partial class FileDeleteFromComputeNodeOptions + { + public FileDeleteFromComputeNodeOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class FileDeleteFromTaskOptions + { + public FileDeleteFromTaskOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class FileGetFromComputeNodeOptions + { + public FileGetFromComputeNodeOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public string OcpRange { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class FileGetFromTaskOptions + { + public FileGetFromTaskOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public string OcpRange { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class FileGetPropertiesFromComputeNodeOptions + { + public FileGetPropertiesFromComputeNodeOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class FileGetPropertiesFromTaskOptions + { + public FileGetPropertiesFromTaskOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class FileListFromComputeNodeOptions + { + public FileListFromComputeNodeOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class FileListFromTaskOptions + { + public FileListFromTaskOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class FileProperties + { + internal FileProperties() { } + public long ContentLength { get { throw null; } } + public string ContentType { get { throw null; } } + public System.DateTimeOffset? CreationTime { get { throw null; } } + public string FileMode { get { throw null; } } + public System.DateTimeOffset LastModified { get { throw null; } } + } + public partial class HttpHeader + { + public HttpHeader(string name) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + } + public partial class ImageInformation + { + internal ImageInformation() { } + public System.DateTimeOffset? BatchSupportEndOfLife { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Capabilities { get { throw null; } } + public Azure.Temp.Batch.Models.ImageReference ImageReference { get { throw null; } } + public string NodeAgentSKUId { get { throw null; } } + public Azure.Temp.Batch.Models.OSType OsType { get { throw null; } } + public Azure.Temp.Batch.Models.VerificationType VerificationType { get { throw null; } } + } + public partial class ImageReference + { + public ImageReference() { } + public string ExactVersion { get { throw null; } } + public string Offer { get { throw null; } set { } } + public string Publisher { get { throw null; } set { } } + public string Sku { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + public string VirtualMachineImageId { get { throw null; } set { } } + } + public partial class InboundEndpoint + { + internal InboundEndpoint() { } + public int BackendPort { get { throw null; } } + public int FrontendPort { get { throw null; } } + public string Name { get { throw null; } } + public Azure.Temp.Batch.Models.InboundEndpointProtocol Protocol { get { throw null; } } + public string PublicFqdn { get { throw null; } } + public string PublicIPAddress { get { throw null; } } + } + public enum InboundEndpointProtocol + { + Tcp = 0, + Udp = 1, + } + public partial class InboundNATPool + { + public InboundNATPool(string name, Azure.Temp.Batch.Models.InboundEndpointProtocol protocol, int backendPort, int frontendPortRangeStart, int frontendPortRangeEnd) { } + public int BackendPort { get { throw null; } set { } } + public int FrontendPortRangeEnd { get { throw null; } set { } } + public int FrontendPortRangeStart { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.Collections.Generic.IList NetworkSecurityGroupRules { get { throw null; } } + public Azure.Temp.Batch.Models.InboundEndpointProtocol Protocol { get { throw null; } set { } } + } + public partial class InstanceViewStatus + { + internal InstanceViewStatus() { } + public string Code { get { throw null; } } + public string DisplayStatus { get { throw null; } } + public Azure.Temp.Batch.Models.StatusLevelTypes? Level { get { throw null; } } + public string Message { get { throw null; } } + public string Time { get { throw null; } } + } + public enum IPAddressProvisioningType + { + BatchManaged = 0, + UserManaged = 1, + NoPublicIPAddresses = 2, + } + public enum JobAction + { + None = 0, + Disable = 1, + Terminate = 2, + } + public partial class JobAddOptions + { + public JobAddOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobAddParameter + { + public JobAddParameter(string id, Azure.Temp.Batch.Models.PoolInformation poolInfo) { } + public bool? AllowTaskPreemption { get { throw null; } set { } } + public System.Collections.Generic.IList CommonEnvironmentSettings { get { throw null; } } + public Azure.Temp.Batch.Models.JobConstraints Constraints { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public string Id { get { throw null; } } + public Azure.Temp.Batch.Models.JobManagerTask JobManagerTask { get { throw null; } set { } } + public Azure.Temp.Batch.Models.JobPreparationTask JobPreparationTask { get { throw null; } set { } } + public Azure.Temp.Batch.Models.JobReleaseTask JobReleaseTask { get { throw null; } set { } } + public int? MaxParallelTasks { get { throw null; } set { } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.Temp.Batch.Models.JobNetworkConfiguration NetworkConfiguration { get { throw null; } set { } } + public Azure.Temp.Batch.Models.OnAllTasksComplete? OnAllTasksComplete { get { throw null; } set { } } + public Azure.Temp.Batch.Models.OnTaskFailure? OnTaskFailure { get { throw null; } set { } } + public Azure.Temp.Batch.Models.PoolInformation PoolInfo { get { throw null; } } + public int? Priority { get { throw null; } set { } } + public bool? UsesTaskDependencies { get { throw null; } set { } } + } + public partial class JobConstraints + { + public JobConstraints() { } + public int? MaxTaskRetryCount { get { throw null; } set { } } + public System.TimeSpan? MaxWallClockTime { get { throw null; } set { } } + } + public partial class JobDeleteOptions + { + public JobDeleteOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobDisableOptions + { + public JobDisableOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobDisableParameter + { + public JobDisableParameter(Azure.Temp.Batch.Models.DisableJobOption disableTasks) { } + public Azure.Temp.Batch.Models.DisableJobOption DisableTasks { get { throw null; } } + } + public partial class JobEnableOptions + { + public JobEnableOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobExecutionInformation + { + internal JobExecutionInformation() { } + public System.DateTimeOffset? EndTime { get { throw null; } } + public string PoolId { get { throw null; } } + public Azure.Temp.Batch.Models.JobSchedulingError SchedulingError { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public string TerminateReason { get { throw null; } } + } + public partial class JobGetOptions + { + public JobGetOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Expand { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobGetTaskCountsOptions + { + public JobGetTaskCountsOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobListFromJobScheduleOptions + { + public JobListFromJobScheduleOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Expand { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobListOptions + { + public JobListOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Expand { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobListPreparationAndReleaseTaskStatusOptions + { + public JobListPreparationAndReleaseTaskStatusOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobManagerTask + { + public JobManagerTask(string id, string commandLine) { } + public bool? AllowLowPriorityNode { get { throw null; } set { } } + public System.Collections.Generic.IList ApplicationPackageReferences { get { throw null; } } + public Azure.Temp.Batch.Models.AuthenticationTokenSettings AuthenticationTokenSettings { get { throw null; } set { } } + public string CommandLine { get { throw null; } set { } } + public Azure.Temp.Batch.Models.TaskConstraints Constraints { get { throw null; } set { } } + public Azure.Temp.Batch.Models.TaskContainerSettings ContainerSettings { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public System.Collections.Generic.IList EnvironmentSettings { get { throw null; } } + public string Id { get { throw null; } set { } } + public bool? KillJobOnCompletion { get { throw null; } set { } } + public System.Collections.Generic.IList OutputFiles { get { throw null; } } + public int? RequiredSlots { get { throw null; } set { } } + public System.Collections.Generic.IList ResourceFiles { get { throw null; } } + public bool? RunExclusive { get { throw null; } set { } } + public Azure.Temp.Batch.Models.UserIdentity UserIdentity { get { throw null; } set { } } + } + public partial class JobNetworkConfiguration + { + public JobNetworkConfiguration(string subnetId) { } + public string SubnetId { get { throw null; } set { } } + } + public partial class JobPatchOptions + { + public JobPatchOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobPatchParameter + { + public JobPatchParameter() { } + public bool? AllowTaskPreemption { get { throw null; } set { } } + public Azure.Temp.Batch.Models.JobConstraints Constraints { get { throw null; } set { } } + public int? MaxParallelTasks { get { throw null; } set { } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.Temp.Batch.Models.OnAllTasksComplete? OnAllTasksComplete { get { throw null; } set { } } + public Azure.Temp.Batch.Models.PoolInformation PoolInfo { get { throw null; } set { } } + public int? Priority { get { throw null; } set { } } + } + public partial class JobPreparationAndReleaseTaskExecutionInformation + { + internal JobPreparationAndReleaseTaskExecutionInformation() { } + public Azure.Temp.Batch.Models.JobPreparationTaskExecutionInformation JobPreparationTaskExecutionInfo { get { throw null; } } + public Azure.Temp.Batch.Models.JobReleaseTaskExecutionInformation JobReleaseTaskExecutionInfo { get { throw null; } } + public string NodeId { get { throw null; } } + public string NodeUrl { get { throw null; } } + public string PoolId { get { throw null; } } + } + public partial class JobPreparationTask + { + public JobPreparationTask(string commandLine) { } + public string CommandLine { get { throw null; } set { } } + public Azure.Temp.Batch.Models.TaskConstraints Constraints { get { throw null; } set { } } + public Azure.Temp.Batch.Models.TaskContainerSettings ContainerSettings { get { throw null; } set { } } + public System.Collections.Generic.IList EnvironmentSettings { get { throw null; } } + public string Id { get { throw null; } set { } } + public bool? RerunOnNodeRebootAfterSuccess { get { throw null; } set { } } + public System.Collections.Generic.IList ResourceFiles { get { throw null; } } + public Azure.Temp.Batch.Models.UserIdentity UserIdentity { get { throw null; } set { } } + public bool? WaitForSuccess { get { throw null; } set { } } + } + public partial class JobPreparationTaskExecutionInformation + { + internal JobPreparationTaskExecutionInformation() { } + public Azure.Temp.Batch.Models.TaskContainerExecutionInformation ContainerInfo { get { throw null; } } + public System.DateTimeOffset? EndTime { get { throw null; } } + public int? ExitCode { get { throw null; } } + public Azure.Temp.Batch.Models.TaskFailureInformation FailureInfo { get { throw null; } } + public System.DateTimeOffset? LastRetryTime { get { throw null; } } + public Azure.Temp.Batch.Models.TaskExecutionResult? Result { get { throw null; } } + public int RetryCount { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public Azure.Temp.Batch.Models.JobPreparationTaskState State { get { throw null; } } + public string TaskRootDirectory { get { throw null; } } + public string TaskRootDirectoryUrl { get { throw null; } } + } + public enum JobPreparationTaskState + { + Running = 0, + Completed = 1, + } + public partial class JobReleaseTask + { + public JobReleaseTask(string commandLine) { } + public string CommandLine { get { throw null; } set { } } + public Azure.Temp.Batch.Models.TaskContainerSettings ContainerSettings { get { throw null; } set { } } + public System.Collections.Generic.IList EnvironmentSettings { get { throw null; } } + public string Id { get { throw null; } set { } } + public System.TimeSpan? MaxWallClockTime { get { throw null; } set { } } + public System.Collections.Generic.IList ResourceFiles { get { throw null; } } + public System.TimeSpan? RetentionTime { get { throw null; } set { } } + public Azure.Temp.Batch.Models.UserIdentity UserIdentity { get { throw null; } set { } } + } + public partial class JobReleaseTaskExecutionInformation + { + internal JobReleaseTaskExecutionInformation() { } + public Azure.Temp.Batch.Models.TaskContainerExecutionInformation ContainerInfo { get { throw null; } } + public System.DateTimeOffset? EndTime { get { throw null; } } + public int? ExitCode { get { throw null; } } + public Azure.Temp.Batch.Models.TaskFailureInformation FailureInfo { get { throw null; } } + public Azure.Temp.Batch.Models.TaskExecutionResult? Result { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public Azure.Temp.Batch.Models.JobReleaseTaskState State { get { throw null; } } + public string TaskRootDirectory { get { throw null; } } + public string TaskRootDirectoryUrl { get { throw null; } } + } + public enum JobReleaseTaskState + { + Running = 0, + Completed = 1, + } + public partial class JobScheduleAddOptions + { + public JobScheduleAddOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobScheduleAddParameter + { + public JobScheduleAddParameter(string id, Azure.Temp.Batch.Models.Schedule schedule, Azure.Temp.Batch.Models.JobSpecification jobSpecification) { } + public string DisplayName { get { throw null; } set { } } + public string Id { get { throw null; } } + public Azure.Temp.Batch.Models.JobSpecification JobSpecification { get { throw null; } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.Temp.Batch.Models.Schedule Schedule { get { throw null; } } + } + public partial class JobScheduleDeleteOptions + { + public JobScheduleDeleteOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobScheduleDisableOptions + { + public JobScheduleDisableOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobScheduleEnableOptions + { + public JobScheduleEnableOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobScheduleExecutionInformation + { + internal JobScheduleExecutionInformation() { } + public System.DateTimeOffset? EndTime { get { throw null; } } + public System.DateTimeOffset? NextRunTime { get { throw null; } } + public Azure.Temp.Batch.Models.RecentJob RecentJob { get { throw null; } } + } + public partial class JobScheduleExistsOptions + { + public JobScheduleExistsOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobScheduleGetOptions + { + public JobScheduleGetOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Expand { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobScheduleListOptions + { + public JobScheduleListOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Expand { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobSchedulePatchOptions + { + public JobSchedulePatchOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobSchedulePatchParameter + { + public JobSchedulePatchParameter() { } + public Azure.Temp.Batch.Models.JobSpecification JobSpecification { get { throw null; } set { } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.Temp.Batch.Models.Schedule Schedule { get { throw null; } set { } } + } + public enum JobScheduleState + { + Active = 0, + Completed = 1, + Disabled = 2, + Terminating = 3, + Deleting = 4, + } + public partial class JobScheduleStatistics + { + internal JobScheduleStatistics() { } + public System.TimeSpan KernelCPUTime { get { throw null; } } + public System.DateTimeOffset LastUpdateTime { get { throw null; } } + public long NumFailedTasks { get { throw null; } } + public long NumSucceededTasks { get { throw null; } } + public long NumTaskRetries { get { throw null; } } + public double ReadIOGiB { get { throw null; } } + public long ReadIOps { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public string Url { get { throw null; } } + public System.TimeSpan UserCPUTime { get { throw null; } } + public System.TimeSpan WaitTime { get { throw null; } } + public System.TimeSpan WallClockTime { get { throw null; } } + public double WriteIOGiB { get { throw null; } } + public long WriteIOps { get { throw null; } } + } + public partial class JobScheduleTerminateOptions + { + public JobScheduleTerminateOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobScheduleUpdateOptions + { + public JobScheduleUpdateOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobScheduleUpdateParameter + { + public JobScheduleUpdateParameter(Azure.Temp.Batch.Models.Schedule schedule, Azure.Temp.Batch.Models.JobSpecification jobSpecification) { } + public Azure.Temp.Batch.Models.JobSpecification JobSpecification { get { throw null; } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.Temp.Batch.Models.Schedule Schedule { get { throw null; } } + } + public partial class JobSchedulingError + { + internal JobSchedulingError() { } + public Azure.Temp.Batch.Models.ErrorCategory Category { get { throw null; } } + public string Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + public string Message { get { throw null; } } + } + public partial class JobSpecification + { + public JobSpecification(Azure.Temp.Batch.Models.PoolInformation poolInfo) { } + public bool? AllowTaskPreemption { get { throw null; } set { } } + public System.Collections.Generic.IList CommonEnvironmentSettings { get { throw null; } } + public Azure.Temp.Batch.Models.JobConstraints Constraints { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public Azure.Temp.Batch.Models.JobManagerTask JobManagerTask { get { throw null; } set { } } + public Azure.Temp.Batch.Models.JobPreparationTask JobPreparationTask { get { throw null; } set { } } + public Azure.Temp.Batch.Models.JobReleaseTask JobReleaseTask { get { throw null; } set { } } + public int? MaxParallelTasks { get { throw null; } set { } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.Temp.Batch.Models.JobNetworkConfiguration NetworkConfiguration { get { throw null; } set { } } + public Azure.Temp.Batch.Models.OnAllTasksComplete? OnAllTasksComplete { get { throw null; } set { } } + public Azure.Temp.Batch.Models.OnTaskFailure? OnTaskFailure { get { throw null; } set { } } + public Azure.Temp.Batch.Models.PoolInformation PoolInfo { get { throw null; } set { } } + public int? Priority { get { throw null; } set { } } + public bool? UsesTaskDependencies { get { throw null; } set { } } + } + public enum JobState + { + Active = 0, + Disabling = 1, + Disabled = 2, + Enabling = 3, + Terminating = 4, + Completed = 5, + Deleting = 6, + } + public partial class JobStatistics + { + internal JobStatistics() { } + public System.TimeSpan KernelCPUTime { get { throw null; } } + public System.DateTimeOffset LastUpdateTime { get { throw null; } } + public long NumFailedTasks { get { throw null; } } + public long NumSucceededTasks { get { throw null; } } + public long NumTaskRetries { get { throw null; } } + public double ReadIOGiB { get { throw null; } } + public long ReadIOps { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public string Url { get { throw null; } } + public System.TimeSpan UserCPUTime { get { throw null; } } + public System.TimeSpan WaitTime { get { throw null; } } + public System.TimeSpan WallClockTime { get { throw null; } } + public double WriteIOGiB { get { throw null; } } + public long WriteIOps { get { throw null; } } + } + public partial class JobTerminateOptions + { + public JobTerminateOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobTerminateParameter + { + public JobTerminateParameter() { } + public string TerminateReason { get { throw null; } set { } } + } + public partial class JobUpdateOptions + { + public JobUpdateOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class JobUpdateParameter + { + public JobUpdateParameter(Azure.Temp.Batch.Models.PoolInformation poolInfo) { } + public bool? AllowTaskPreemption { get { throw null; } set { } } + public Azure.Temp.Batch.Models.JobConstraints Constraints { get { throw null; } set { } } + public int? MaxParallelTasks { get { throw null; } set { } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.Temp.Batch.Models.OnAllTasksComplete? OnAllTasksComplete { get { throw null; } set { } } + public Azure.Temp.Batch.Models.PoolInformation PoolInfo { get { throw null; } } + public int? Priority { get { throw null; } set { } } + } + public partial class LinuxUserConfiguration + { + public LinuxUserConfiguration() { } + public int? Gid { get { throw null; } set { } } + public string SshPrivateKey { get { throw null; } set { } } + public int? Uid { get { throw null; } set { } } + } + public enum LoginMode + { + Batch = 0, + Interactive = 1, + } + public partial class MetadataItem + { + public MetadataItem(string name, string value) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + } + public partial class MountConfiguration + { + public MountConfiguration() { } + public Azure.Temp.Batch.Models.AzureBlobFileSystemConfiguration AzureBlobFileSystemConfiguration { get { throw null; } set { } } + public Azure.Temp.Batch.Models.AzureFileShareConfiguration AzureFileShareConfiguration { get { throw null; } set { } } + public Azure.Temp.Batch.Models.CifsMountConfiguration CifsMountConfiguration { get { throw null; } set { } } + public Azure.Temp.Batch.Models.NFSMountConfiguration NfsMountConfiguration { get { throw null; } set { } } + } + public partial class MultiInstanceSettings + { + public MultiInstanceSettings(string coordinationCommandLine) { } + public System.Collections.Generic.IList CommonResourceFiles { get { throw null; } } + public string CoordinationCommandLine { get { throw null; } set { } } + public int? NumberOfInstances { get { throw null; } set { } } + } + public partial class NameValuePair + { + internal NameValuePair() { } + public string Name { get { throw null; } } + public string Value { get { throw null; } } + } + public partial class NetworkConfiguration + { + public NetworkConfiguration() { } + public Azure.Temp.Batch.Models.DynamicVNetAssignmentScope? DynamicVNetAssignmentScope { get { throw null; } set { } } + public bool? EnableAcceleratedNetworking { get { throw null; } set { } } + public Azure.Temp.Batch.Models.PoolEndpointConfiguration EndpointConfiguration { get { throw null; } set { } } + public Azure.Temp.Batch.Models.PublicIPAddressConfiguration PublicIPAddressConfiguration { get { throw null; } set { } } + public string SubnetId { get { throw null; } set { } } + } + public partial class NetworkSecurityGroupRule + { + public NetworkSecurityGroupRule(int priority, Azure.Temp.Batch.Models.NetworkSecurityGroupRuleAccess access, string sourceAddressPrefix) { } + public Azure.Temp.Batch.Models.NetworkSecurityGroupRuleAccess Access { get { throw null; } set { } } + public int Priority { get { throw null; } set { } } + public string SourceAddressPrefix { get { throw null; } set { } } + public System.Collections.Generic.IList SourcePortRanges { get { throw null; } } + } + public enum NetworkSecurityGroupRuleAccess + { + Allow = 0, + Deny = 1, + } + public partial class NFSMountConfiguration + { + public NFSMountConfiguration(string source, string relativeMountPath) { } + public string MountOptions { get { throw null; } set { } } + public string RelativeMountPath { get { throw null; } set { } } + public string Source { get { throw null; } set { } } + } + public partial class NodeAgentInformation + { + internal NodeAgentInformation() { } + public System.DateTimeOffset LastUpdateTime { get { throw null; } } + public string Version { get { throw null; } } + } + public enum NodeCommunicationMode + { + Default = 0, + Classic = 1, + Simplified = 2, + } + public partial class NodeCounts + { + internal NodeCounts() { } + public int Creating { get { throw null; } } + public int Idle { get { throw null; } } + public int LeavingPool { get { throw null; } } + public int Offline { get { throw null; } } + public int Preempted { get { throw null; } } + public int Rebooting { get { throw null; } } + public int Reimaging { get { throw null; } } + public int Running { get { throw null; } } + public int Starting { get { throw null; } } + public int StartTaskFailed { get { throw null; } } + public int Total { get { throw null; } } + public int Unknown { get { throw null; } } + public int Unusable { get { throw null; } } + public int WaitingForStartTask { get { throw null; } } + } + public partial class NodeDisableSchedulingParameter + { + public NodeDisableSchedulingParameter() { } + public Azure.Temp.Batch.Models.DisableComputeNodeSchedulingOption? NodeDisableSchedulingOption { get { throw null; } set { } } + } + public partial class NodeFile + { + internal NodeFile() { } + public bool? IsDirectory { get { throw null; } } + public string Name { get { throw null; } } + public Azure.Temp.Batch.Models.FileProperties Properties { get { throw null; } } + public string Url { get { throw null; } } + } + public partial class NodePlacementConfiguration + { + public NodePlacementConfiguration() { } + public Azure.Temp.Batch.Models.NodePlacementPolicyType? Policy { get { throw null; } set { } } + } + public enum NodePlacementPolicyType + { + Regional = 0, + Zonal = 1, + } + public partial class NodeRebootParameter + { + public NodeRebootParameter() { } + public Azure.Temp.Batch.Models.ComputeNodeRebootOption? NodeRebootOption { get { throw null; } set { } } + } + public partial class NodeReimageParameter + { + public NodeReimageParameter() { } + public Azure.Temp.Batch.Models.ComputeNodeReimageOption? NodeReimageOption { get { throw null; } set { } } + } + public partial class NodeRemoveParameter + { + public NodeRemoveParameter(System.Collections.Generic.IEnumerable nodeList) { } + public Azure.Temp.Batch.Models.ComputeNodeDeallocationOption? NodeDeallocationOption { get { throw null; } set { } } + public System.Collections.Generic.IList NodeList { get { throw null; } } + public System.TimeSpan? ResizeTimeout { get { throw null; } set { } } + } + public partial class NodeUpdateUserParameter + { + public NodeUpdateUserParameter() { } + public System.DateTimeOffset? ExpiryTime { get { throw null; } set { } } + public string Password { get { throw null; } set { } } + public string SshPublicKey { get { throw null; } set { } } + } + public partial class NodeVMExtension + { + internal NodeVMExtension() { } + public Azure.Temp.Batch.Models.VMExtensionInstanceView InstanceView { get { throw null; } } + public string ProvisioningState { get { throw null; } } + public Azure.Temp.Batch.Models.VMExtension VmExtension { get { throw null; } } + } + public enum OnAllTasksComplete + { + NoAction = 0, + TerminateJob = 1, + } + public enum OnTaskFailure + { + NoAction = 0, + PerformExitOptionsJobAction = 1, + } + public partial class OSDisk + { + public OSDisk() { } + public Azure.Temp.Batch.Models.DiffDiskSettings EphemeralOSDiskSettings { get { throw null; } set { } } + } + public enum OSType + { + Linux = 0, + Windows = 1, + } + public partial class OutputFile + { + public OutputFile(string filePattern, Azure.Temp.Batch.Models.OutputFileDestination destination, Azure.Temp.Batch.Models.OutputFileUploadOptions uploadOptions) { } + public Azure.Temp.Batch.Models.OutputFileDestination Destination { get { throw null; } set { } } + public string FilePattern { get { throw null; } set { } } + public Azure.Temp.Batch.Models.OutputFileUploadOptions UploadOptions { get { throw null; } set { } } + } + public partial class OutputFileBlobContainerDestination + { + public OutputFileBlobContainerDestination(string containerUrl) { } + public string ContainerUrl { get { throw null; } set { } } + public Azure.Temp.Batch.Models.ComputeNodeIdentityReference IdentityReference { get { throw null; } set { } } + public string Path { get { throw null; } set { } } + public System.Collections.Generic.IList UploadHeaders { get { throw null; } } + } + public partial class OutputFileDestination + { + public OutputFileDestination() { } + public Azure.Temp.Batch.Models.OutputFileBlobContainerDestination Container { get { throw null; } set { } } + } + public enum OutputFileUploadCondition + { + TaskSuccess = 0, + TaskFailure = 1, + TaskCompletion = 2, + } + public partial class OutputFileUploadOptions + { + public OutputFileUploadOptions(Azure.Temp.Batch.Models.OutputFileUploadCondition uploadCondition) { } + public Azure.Temp.Batch.Models.OutputFileUploadCondition UploadCondition { get { throw null; } set { } } + } + public partial class PoolAddOptions + { + public PoolAddOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolAddParameter + { + public PoolAddParameter(string id, string vmSize) { } + public System.Collections.Generic.IList ApplicationLicenses { get { throw null; } } + public System.Collections.Generic.IList ApplicationPackageReferences { get { throw null; } } + public System.TimeSpan? AutoScaleEvaluationInterval { get { throw null; } set { } } + public string AutoScaleFormula { get { throw null; } set { } } + public System.Collections.Generic.IList CertificateReferences { get { throw null; } } + public Azure.Temp.Batch.Models.CloudServiceConfiguration CloudServiceConfiguration { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public bool? EnableAutoScale { get { throw null; } set { } } + public bool? EnableInterNodeCommunication { get { throw null; } set { } } + public string Id { get { throw null; } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public System.Collections.Generic.IList MountConfiguration { get { throw null; } } + public Azure.Temp.Batch.Models.NetworkConfiguration NetworkConfiguration { get { throw null; } set { } } + public System.TimeSpan? ResizeTimeout { get { throw null; } set { } } + public Azure.Temp.Batch.Models.StartTask StartTask { get { throw null; } set { } } + public int? TargetDedicatedNodes { get { throw null; } set { } } + public int? TargetLowPriorityNodes { get { throw null; } set { } } + public Azure.Temp.Batch.Models.NodeCommunicationMode? TargetNodeCommunicationMode { get { throw null; } set { } } + public Azure.Temp.Batch.Models.TaskSchedulingPolicy TaskSchedulingPolicy { get { throw null; } set { } } + public int? TaskSlotsPerNode { get { throw null; } set { } } + public System.Collections.Generic.IList UserAccounts { get { throw null; } } + public Azure.Temp.Batch.Models.VirtualMachineConfiguration VirtualMachineConfiguration { get { throw null; } set { } } + public string VmSize { get { throw null; } } + } + public partial class PoolDeleteOptions + { + public PoolDeleteOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolDisableAutoScaleOptions + { + public PoolDisableAutoScaleOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolEnableAutoScaleOptions + { + public PoolEnableAutoScaleOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolEnableAutoScaleParameter + { + public PoolEnableAutoScaleParameter() { } + public System.TimeSpan? AutoScaleEvaluationInterval { get { throw null; } set { } } + public string AutoScaleFormula { get { throw null; } set { } } + } + public partial class PoolEndpointConfiguration + { + public PoolEndpointConfiguration(System.Collections.Generic.IEnumerable inboundNATPools) { } + public System.Collections.Generic.IList InboundNATPools { get { throw null; } } + } + public partial class PoolEvaluateAutoScaleOptions + { + public PoolEvaluateAutoScaleOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolEvaluateAutoScaleParameter + { + public PoolEvaluateAutoScaleParameter(string autoScaleFormula) { } + public string AutoScaleFormula { get { throw null; } } + } + public partial class PoolExistsOptions + { + public PoolExistsOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolGetOptions + { + public PoolGetOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Expand { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public enum PoolIdentityType + { + UserAssigned = 0, + None = 1, + } + public partial class PoolInformation + { + public PoolInformation() { } + public Azure.Temp.Batch.Models.AutoPoolSpecification AutoPoolSpecification { get { throw null; } set { } } + public string PoolId { get { throw null; } set { } } + } + public enum PoolLifetimeOption + { + JobSchedule = 0, + Job = 1, + } + public partial class PoolListOptions + { + public PoolListOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Expand { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolListUsageMetricsOptions + { + public PoolListUsageMetricsOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? EndTime { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? StartTime { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolNodeCounts + { + internal PoolNodeCounts() { } + public Azure.Temp.Batch.Models.NodeCounts Dedicated { get { throw null; } } + public Azure.Temp.Batch.Models.NodeCounts LowPriority { get { throw null; } } + public string PoolId { get { throw null; } } + } + public partial class PoolPatchOptions + { + public PoolPatchOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolPatchParameter + { + public PoolPatchParameter() { } + public System.Collections.Generic.IList ApplicationPackageReferences { get { throw null; } } + public System.Collections.Generic.IList CertificateReferences { get { throw null; } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.Temp.Batch.Models.StartTask StartTask { get { throw null; } set { } } + public Azure.Temp.Batch.Models.NodeCommunicationMode? TargetNodeCommunicationMode { get { throw null; } set { } } + } + public partial class PoolRemoveNodesOptions + { + public PoolRemoveNodesOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolResizeOptions + { + public PoolResizeOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolResizeParameter + { + public PoolResizeParameter() { } + public Azure.Temp.Batch.Models.ComputeNodeDeallocationOption? NodeDeallocationOption { get { throw null; } set { } } + public System.TimeSpan? ResizeTimeout { get { throw null; } set { } } + public int? TargetDedicatedNodes { get { throw null; } set { } } + public int? TargetLowPriorityNodes { get { throw null; } set { } } + } + public partial class PoolSpecification + { + public PoolSpecification(string vmSize) { } + public System.Collections.Generic.IList ApplicationLicenses { get { throw null; } } + public System.Collections.Generic.IList ApplicationPackageReferences { get { throw null; } } + public System.TimeSpan? AutoScaleEvaluationInterval { get { throw null; } set { } } + public string AutoScaleFormula { get { throw null; } set { } } + public System.Collections.Generic.IList CertificateReferences { get { throw null; } } + public Azure.Temp.Batch.Models.CloudServiceConfiguration CloudServiceConfiguration { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public bool? EnableAutoScale { get { throw null; } set { } } + public bool? EnableInterNodeCommunication { get { throw null; } set { } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public System.Collections.Generic.IList MountConfiguration { get { throw null; } } + public Azure.Temp.Batch.Models.NetworkConfiguration NetworkConfiguration { get { throw null; } set { } } + public System.TimeSpan? ResizeTimeout { get { throw null; } set { } } + public Azure.Temp.Batch.Models.StartTask StartTask { get { throw null; } set { } } + public int? TargetDedicatedNodes { get { throw null; } set { } } + public int? TargetLowPriorityNodes { get { throw null; } set { } } + public Azure.Temp.Batch.Models.NodeCommunicationMode? TargetNodeCommunicationMode { get { throw null; } set { } } + public Azure.Temp.Batch.Models.TaskSchedulingPolicy TaskSchedulingPolicy { get { throw null; } set { } } + public int? TaskSlotsPerNode { get { throw null; } set { } } + public System.Collections.Generic.IList UserAccounts { get { throw null; } } + public Azure.Temp.Batch.Models.VirtualMachineConfiguration VirtualMachineConfiguration { get { throw null; } set { } } + public string VmSize { get { throw null; } set { } } + } + public enum PoolState + { + Active = 0, + Deleting = 1, + } + public partial class PoolStatistics + { + internal PoolStatistics() { } + public System.DateTimeOffset LastUpdateTime { get { throw null; } } + public Azure.Temp.Batch.Models.ResourceStatistics ResourceStats { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public string Url { get { throw null; } } + public Azure.Temp.Batch.Models.UsageStatistics UsageStats { get { throw null; } } + } + public partial class PoolStopResizeOptions + { + public PoolStopResizeOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolUpdatePropertiesOptions + { + public PoolUpdatePropertiesOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class PoolUpdatePropertiesParameter + { + public PoolUpdatePropertiesParameter(System.Collections.Generic.IEnumerable certificateReferences, System.Collections.Generic.IEnumerable applicationPackageReferences, System.Collections.Generic.IEnumerable metadata) { } + public System.Collections.Generic.IList ApplicationPackageReferences { get { throw null; } } + public System.Collections.Generic.IList CertificateReferences { get { throw null; } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.Temp.Batch.Models.StartTask StartTask { get { throw null; } set { } } + public Azure.Temp.Batch.Models.NodeCommunicationMode? TargetNodeCommunicationMode { get { throw null; } set { } } + } + public partial class PoolUsageMetrics + { + internal PoolUsageMetrics() { } + public System.DateTimeOffset EndTime { get { throw null; } } + public string PoolId { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public double TotalCoreHours { get { throw null; } } + public string VmSize { get { throw null; } } + } + public partial class PublicIPAddressConfiguration + { + public PublicIPAddressConfiguration() { } + public System.Collections.Generic.IList IpAddressIds { get { throw null; } } + public Azure.Temp.Batch.Models.IPAddressProvisioningType? Provision { get { throw null; } set { } } + } + public partial class RecentJob + { + internal RecentJob() { } + public string Id { get { throw null; } } + public string Url { get { throw null; } } + } + public partial class ResizeError + { + internal ResizeError() { } + public string Code { get { throw null; } } + public string Message { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Values { get { throw null; } } + } + public partial class ResourceFile + { + public ResourceFile() { } + public string AutoStorageContainerName { get { throw null; } set { } } + public string BlobPrefix { get { throw null; } set { } } + public string FileMode { get { throw null; } set { } } + public string FilePath { get { throw null; } set { } } + public string HttpUrl { get { throw null; } set { } } + public Azure.Temp.Batch.Models.ComputeNodeIdentityReference IdentityReference { get { throw null; } set { } } + public string StorageContainerUrl { get { throw null; } set { } } + } + public partial class ResourceStatistics + { + internal ResourceStatistics() { } + public double AvgCPUPercentage { get { throw null; } } + public double AvgDiskGiB { get { throw null; } } + public double AvgMemoryGiB { get { throw null; } } + public double DiskReadGiB { get { throw null; } } + public long DiskReadIOps { get { throw null; } } + public double DiskWriteGiB { get { throw null; } } + public long DiskWriteIOps { get { throw null; } } + public System.DateTimeOffset LastUpdateTime { get { throw null; } } + public double NetworkReadGiB { get { throw null; } } + public double NetworkWriteGiB { get { throw null; } } + public double PeakDiskGiB { get { throw null; } } + public double PeakMemoryGiB { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + } + public partial class Schedule + { + public Schedule() { } + public System.DateTimeOffset? DoNotRunAfter { get { throw null; } set { } } + public System.DateTimeOffset? DoNotRunUntil { get { throw null; } set { } } + public System.TimeSpan? RecurrenceInterval { get { throw null; } set { } } + public System.TimeSpan? StartWindow { get { throw null; } set { } } + } + public enum SchedulingState + { + Enabled = 0, + Disabled = 1, + } + public partial class StartTask + { + public StartTask(string commandLine) { } + public string CommandLine { get { throw null; } set { } } + public Azure.Temp.Batch.Models.TaskContainerSettings ContainerSettings { get { throw null; } set { } } + public System.Collections.Generic.IList EnvironmentSettings { get { throw null; } } + public int? MaxTaskRetryCount { get { throw null; } set { } } + public System.Collections.Generic.IList ResourceFiles { get { throw null; } } + public Azure.Temp.Batch.Models.UserIdentity UserIdentity { get { throw null; } set { } } + public bool? WaitForSuccess { get { throw null; } set { } } + } + public partial class StartTaskInformation + { + internal StartTaskInformation() { } + public Azure.Temp.Batch.Models.TaskContainerExecutionInformation ContainerInfo { get { throw null; } } + public System.DateTimeOffset? EndTime { get { throw null; } } + public int? ExitCode { get { throw null; } } + public Azure.Temp.Batch.Models.TaskFailureInformation FailureInfo { get { throw null; } } + public System.DateTimeOffset? LastRetryTime { get { throw null; } } + public Azure.Temp.Batch.Models.TaskExecutionResult? Result { get { throw null; } } + public int RetryCount { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public Azure.Temp.Batch.Models.StartTaskState State { get { throw null; } } + } + public enum StartTaskState + { + Running = 0, + Completed = 1, + } + public enum StatusLevelTypes + { + Error = 0, + Info = 1, + Warning = 2, + } + public enum StorageAccountType + { + StandardLRS = 0, + PremiumLRS = 1, + } + public partial class SubtaskInformation + { + internal SubtaskInformation() { } + public Azure.Temp.Batch.Models.TaskContainerExecutionInformation ContainerInfo { get { throw null; } } + public System.DateTimeOffset? EndTime { get { throw null; } } + public int? ExitCode { get { throw null; } } + public Azure.Temp.Batch.Models.TaskFailureInformation FailureInfo { get { throw null; } } + public int? Id { get { throw null; } } + public Azure.Temp.Batch.Models.ComputeNodeInformation NodeInfo { get { throw null; } } + public Azure.Temp.Batch.Models.SubtaskState? PreviousState { get { throw null; } } + public System.DateTimeOffset? PreviousStateTransitionTime { get { throw null; } } + public Azure.Temp.Batch.Models.TaskExecutionResult? Result { get { throw null; } } + public System.DateTimeOffset? StartTime { get { throw null; } } + public Azure.Temp.Batch.Models.SubtaskState? State { get { throw null; } } + public System.DateTimeOffset? StateTransitionTime { get { throw null; } } + } + public enum SubtaskState + { + Preparing = 0, + Running = 1, + Completed = 2, + } + public partial class TaskAddCollectionOptions + { + public TaskAddCollectionOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class TaskAddCollectionParameter + { + public TaskAddCollectionParameter(System.Collections.Generic.IEnumerable value) { } + public System.Collections.Generic.IList Value { get { throw null; } } + } + public partial class TaskAddCollectionResult + { + internal TaskAddCollectionResult() { } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + } + public partial class TaskAddOptions + { + public TaskAddOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class TaskAddParameter + { + public TaskAddParameter(string id, string commandLine) { } + public Azure.Temp.Batch.Models.AffinityInformation AffinityInfo { get { throw null; } set { } } + public System.Collections.Generic.IList ApplicationPackageReferences { get { throw null; } } + public Azure.Temp.Batch.Models.AuthenticationTokenSettings AuthenticationTokenSettings { get { throw null; } set { } } + public string CommandLine { get { throw null; } } + public Azure.Temp.Batch.Models.TaskConstraints Constraints { get { throw null; } set { } } + public Azure.Temp.Batch.Models.TaskContainerSettings ContainerSettings { get { throw null; } set { } } + public Azure.Temp.Batch.Models.TaskDependencies DependsOn { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public System.Collections.Generic.IList EnvironmentSettings { get { throw null; } } + public Azure.Temp.Batch.Models.ExitConditions ExitConditions { get { throw null; } set { } } + public string Id { get { throw null; } } + public Azure.Temp.Batch.Models.MultiInstanceSettings MultiInstanceSettings { get { throw null; } set { } } + public System.Collections.Generic.IList OutputFiles { get { throw null; } } + public int? RequiredSlots { get { throw null; } set { } } + public System.Collections.Generic.IList ResourceFiles { get { throw null; } } + public Azure.Temp.Batch.Models.UserIdentity UserIdentity { get { throw null; } set { } } + } + public partial class TaskAddResult + { + internal TaskAddResult() { } + public Azure.Temp.Batch.Models.BatchError Error { get { throw null; } } + public string ETag { get { throw null; } } + public System.DateTimeOffset? LastModified { get { throw null; } } + public string Location { get { throw null; } } + public Azure.Temp.Batch.Models.TaskAddStatus Status { get { throw null; } } + public string TaskId { get { throw null; } } + } + public enum TaskAddStatus + { + Success = 0, + ClientError = 1, + ServerError = 2, + } + public partial class TaskConstraints + { + public TaskConstraints() { } + public int? MaxTaskRetryCount { get { throw null; } set { } } + public System.TimeSpan? MaxWallClockTime { get { throw null; } set { } } + public System.TimeSpan? RetentionTime { get { throw null; } set { } } + } + public partial class TaskContainerExecutionInformation + { + internal TaskContainerExecutionInformation() { } + public string ContainerId { get { throw null; } } + public string Error { get { throw null; } } + public string State { get { throw null; } } + } + public partial class TaskContainerSettings + { + public TaskContainerSettings(string imageName) { } + public string ContainerRunOptions { get { throw null; } set { } } + public string ImageName { get { throw null; } set { } } + public Azure.Temp.Batch.Models.ContainerRegistry Registry { get { throw null; } set { } } + public Azure.Temp.Batch.Models.ContainerWorkingDirectory? WorkingDirectory { get { throw null; } set { } } + } + public partial class TaskCounts + { + internal TaskCounts() { } + public int Active { get { throw null; } } + public int Completed { get { throw null; } } + public int Failed { get { throw null; } } + public int Running { get { throw null; } } + public int Succeeded { get { throw null; } } + } + public partial class TaskCountsResult + { + internal TaskCountsResult() { } + public Azure.Temp.Batch.Models.TaskCounts TaskCounts { get { throw null; } } + public Azure.Temp.Batch.Models.TaskSlotCounts TaskSlotCounts { get { throw null; } } + } + public partial class TaskDeleteOptions + { + public TaskDeleteOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class TaskDependencies + { + public TaskDependencies() { } + public System.Collections.Generic.IList TaskIdRanges { get { throw null; } } + public System.Collections.Generic.IList TaskIds { get { throw null; } } + } + public partial class TaskExecutionInformation + { + internal TaskExecutionInformation() { } + public Azure.Temp.Batch.Models.TaskContainerExecutionInformation ContainerInfo { get { throw null; } } + public System.DateTimeOffset? EndTime { get { throw null; } } + public int? ExitCode { get { throw null; } } + public Azure.Temp.Batch.Models.TaskFailureInformation FailureInfo { get { throw null; } } + public System.DateTimeOffset? LastRequeueTime { get { throw null; } } + public System.DateTimeOffset? LastRetryTime { get { throw null; } } + public int RequeueCount { get { throw null; } } + public Azure.Temp.Batch.Models.TaskExecutionResult? Result { get { throw null; } } + public int RetryCount { get { throw null; } } + public System.DateTimeOffset? StartTime { get { throw null; } } + } + public enum TaskExecutionResult + { + Success = 0, + Failure = 1, + } + public partial class TaskFailureInformation + { + internal TaskFailureInformation() { } + public Azure.Temp.Batch.Models.ErrorCategory Category { get { throw null; } } + public string Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + public string Message { get { throw null; } } + } + public partial class TaskGetOptions + { + public TaskGetOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Expand { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class TaskIdRange + { + public TaskIdRange(int start, int end) { } + public int End { get { throw null; } set { } } + public int Start { get { throw null; } set { } } + } + public partial class TaskInformation + { + internal TaskInformation() { } + public Azure.Temp.Batch.Models.TaskExecutionInformation ExecutionInfo { get { throw null; } } + public string JobId { get { throw null; } } + public int? SubtaskId { get { throw null; } } + public string TaskId { get { throw null; } } + public Azure.Temp.Batch.Models.TaskState TaskState { get { throw null; } } + public string TaskUrl { get { throw null; } } + } + public partial class TaskListOptions + { + public TaskListOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string Expand { get { throw null; } set { } } + public string Filter { get { throw null; } set { } } + public int? MaxResults { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class TaskListSubtasksOptions + { + public TaskListSubtasksOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public string Select { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class TaskReactivateOptions + { + public TaskReactivateOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class TaskSchedulingPolicy + { + public TaskSchedulingPolicy(Azure.Temp.Batch.Models.ComputeNodeFillType nodeFillType) { } + public Azure.Temp.Batch.Models.ComputeNodeFillType NodeFillType { get { throw null; } set { } } + } + public partial class TaskSlotCounts + { + internal TaskSlotCounts() { } + public int Active { get { throw null; } } + public int Completed { get { throw null; } } + public int Failed { get { throw null; } } + public int Running { get { throw null; } } + public int Succeeded { get { throw null; } } + } + public enum TaskState + { + Active = 0, + Preparing = 1, + Running = 2, + Completed = 3, + } + public partial class TaskStatistics + { + internal TaskStatistics() { } + public System.TimeSpan KernelCPUTime { get { throw null; } } + public System.DateTimeOffset LastUpdateTime { get { throw null; } } + public double ReadIOGiB { get { throw null; } } + public long ReadIOps { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public string Url { get { throw null; } } + public System.TimeSpan UserCPUTime { get { throw null; } } + public System.TimeSpan WaitTime { get { throw null; } } + public System.TimeSpan WallClockTime { get { throw null; } } + public double WriteIOGiB { get { throw null; } } + public long WriteIOps { get { throw null; } } + } + public partial class TaskTerminateOptions + { + public TaskTerminateOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class TaskUpdateOptions + { + public TaskUpdateOptions() { } + public System.Guid? ClientRequestId { get { throw null; } set { } } + public string IfMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfModifiedSince { get { throw null; } set { } } + public string IfNoneMatch { get { throw null; } set { } } + public System.DateTimeOffset? IfUnmodifiedSince { get { throw null; } set { } } + public System.DateTimeOffset? OcpDate { get { throw null; } set { } } + public bool? ReturnClientRequestId { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + } + public partial class TaskUpdateParameter + { + public TaskUpdateParameter() { } + public Azure.Temp.Batch.Models.TaskConstraints Constraints { get { throw null; } set { } } + } + public static partial class TempBatchModelFactory + { + public static Azure.Temp.Batch.Models.ApplicationSummary ApplicationSummary(string id = null, string displayName = null, System.Collections.Generic.IEnumerable versions = null) { throw null; } + public static Azure.Temp.Batch.Models.AutoScaleRun AutoScaleRun(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string results = null, Azure.Temp.Batch.Models.AutoScaleRunError error = null) { throw null; } + public static Azure.Temp.Batch.Models.AutoScaleRunError AutoScaleRunError(string code = null, string message = null, System.Collections.Generic.IEnumerable values = null) { throw null; } + public static Azure.Temp.Batch.Models.BatchError BatchError(string code = null, Azure.Temp.Batch.Models.ErrorMessage message = null, System.Collections.Generic.IEnumerable values = null) { throw null; } + public static Azure.Temp.Batch.Models.BatchErrorDetail BatchErrorDetail(string key = null, string value = null) { throw null; } + public static Azure.Temp.Batch.Models.BatchPoolIdentity BatchPoolIdentity(Azure.Temp.Batch.Models.PoolIdentityType type = Azure.Temp.Batch.Models.PoolIdentityType.UserAssigned, System.Collections.Generic.IEnumerable userAssignedIdentities = null) { throw null; } + public static Azure.Temp.Batch.Models.Certificate Certificate(string thumbprint = null, string thumbprintAlgorithm = null, string url = null, Azure.Temp.Batch.Models.CertificateState? state = default(Azure.Temp.Batch.Models.CertificateState?), System.DateTimeOffset? stateTransitionTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.CertificateState? previousState = default(Azure.Temp.Batch.Models.CertificateState?), System.DateTimeOffset? previousStateTransitionTime = default(System.DateTimeOffset?), string publicData = null, Azure.Temp.Batch.Models.DeleteCertificateError deleteCertificateError = null) { throw null; } + public static Azure.Temp.Batch.Models.CloudJob CloudJob(string id = null, string displayName = null, bool? usesTaskDependencies = default(bool?), string url = null, string eTag = null, System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), System.DateTimeOffset? creationTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.JobState? state = default(Azure.Temp.Batch.Models.JobState?), System.DateTimeOffset? stateTransitionTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.JobState? previousState = default(Azure.Temp.Batch.Models.JobState?), System.DateTimeOffset? previousStateTransitionTime = default(System.DateTimeOffset?), int? priority = default(int?), bool? allowTaskPreemption = default(bool?), int? maxParallelTasks = default(int?), Azure.Temp.Batch.Models.JobConstraints constraints = null, Azure.Temp.Batch.Models.JobManagerTask jobManagerTask = null, Azure.Temp.Batch.Models.JobPreparationTask jobPreparationTask = null, Azure.Temp.Batch.Models.JobReleaseTask jobReleaseTask = null, System.Collections.Generic.IEnumerable commonEnvironmentSettings = null, Azure.Temp.Batch.Models.PoolInformation poolInfo = null, Azure.Temp.Batch.Models.OnAllTasksComplete? onAllTasksComplete = default(Azure.Temp.Batch.Models.OnAllTasksComplete?), Azure.Temp.Batch.Models.OnTaskFailure? onTaskFailure = default(Azure.Temp.Batch.Models.OnTaskFailure?), Azure.Temp.Batch.Models.JobNetworkConfiguration networkConfiguration = null, System.Collections.Generic.IEnumerable metadata = null, Azure.Temp.Batch.Models.JobExecutionInformation executionInfo = null, Azure.Temp.Batch.Models.JobStatistics stats = null) { throw null; } + public static Azure.Temp.Batch.Models.CloudJobSchedule CloudJobSchedule(string id = null, string displayName = null, string url = null, string eTag = null, System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), System.DateTimeOffset? creationTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.JobScheduleState? state = default(Azure.Temp.Batch.Models.JobScheduleState?), System.DateTimeOffset? stateTransitionTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.JobScheduleState? previousState = default(Azure.Temp.Batch.Models.JobScheduleState?), System.DateTimeOffset? previousStateTransitionTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.Schedule schedule = null, Azure.Temp.Batch.Models.JobSpecification jobSpecification = null, Azure.Temp.Batch.Models.JobScheduleExecutionInformation executionInfo = null, System.Collections.Generic.IEnumerable metadata = null, Azure.Temp.Batch.Models.JobScheduleStatistics stats = null) { throw null; } + public static Azure.Temp.Batch.Models.CloudPool CloudPool(string id = null, string displayName = null, string url = null, string eTag = null, System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), System.DateTimeOffset? creationTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.PoolState? state = default(Azure.Temp.Batch.Models.PoolState?), System.DateTimeOffset? stateTransitionTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.AllocationState? allocationState = default(Azure.Temp.Batch.Models.AllocationState?), System.DateTimeOffset? allocationStateTransitionTime = default(System.DateTimeOffset?), string vmSize = null, Azure.Temp.Batch.Models.CloudServiceConfiguration cloudServiceConfiguration = null, Azure.Temp.Batch.Models.VirtualMachineConfiguration virtualMachineConfiguration = null, System.TimeSpan? resizeTimeout = default(System.TimeSpan?), System.Collections.Generic.IEnumerable resizeErrors = null, int? currentDedicatedNodes = default(int?), int? currentLowPriorityNodes = default(int?), int? targetDedicatedNodes = default(int?), int? targetLowPriorityNodes = default(int?), bool? enableAutoScale = default(bool?), string autoScaleFormula = null, System.TimeSpan? autoScaleEvaluationInterval = default(System.TimeSpan?), Azure.Temp.Batch.Models.AutoScaleRun autoScaleRun = null, bool? enableInterNodeCommunication = default(bool?), Azure.Temp.Batch.Models.NetworkConfiguration networkConfiguration = null, Azure.Temp.Batch.Models.StartTask startTask = null, System.Collections.Generic.IEnumerable certificateReferences = null, System.Collections.Generic.IEnumerable applicationPackageReferences = null, System.Collections.Generic.IEnumerable applicationLicenses = null, int? taskSlotsPerNode = default(int?), Azure.Temp.Batch.Models.TaskSchedulingPolicy taskSchedulingPolicy = null, System.Collections.Generic.IEnumerable userAccounts = null, System.Collections.Generic.IEnumerable metadata = null, Azure.Temp.Batch.Models.PoolStatistics stats = null, System.Collections.Generic.IEnumerable mountConfiguration = null, Azure.Temp.Batch.Models.BatchPoolIdentity identity = null, Azure.Temp.Batch.Models.NodeCommunicationMode? targetNodeCommunicationMode = default(Azure.Temp.Batch.Models.NodeCommunicationMode?), Azure.Temp.Batch.Models.NodeCommunicationMode? currentNodeCommunicationMode = default(Azure.Temp.Batch.Models.NodeCommunicationMode?)) { throw null; } + public static Azure.Temp.Batch.Models.CloudTask CloudTask(string id = null, string displayName = null, string url = null, string eTag = null, System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), System.DateTimeOffset? creationTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.ExitConditions exitConditions = null, Azure.Temp.Batch.Models.TaskState? state = default(Azure.Temp.Batch.Models.TaskState?), System.DateTimeOffset? stateTransitionTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.TaskState? previousState = default(Azure.Temp.Batch.Models.TaskState?), System.DateTimeOffset? previousStateTransitionTime = default(System.DateTimeOffset?), string commandLine = null, Azure.Temp.Batch.Models.TaskContainerSettings containerSettings = null, System.Collections.Generic.IEnumerable resourceFiles = null, System.Collections.Generic.IEnumerable outputFiles = null, System.Collections.Generic.IEnumerable environmentSettings = null, Azure.Temp.Batch.Models.AffinityInformation affinityInfo = null, Azure.Temp.Batch.Models.TaskConstraints constraints = null, int? requiredSlots = default(int?), Azure.Temp.Batch.Models.UserIdentity userIdentity = null, Azure.Temp.Batch.Models.TaskExecutionInformation executionInfo = null, Azure.Temp.Batch.Models.ComputeNodeInformation nodeInfo = null, Azure.Temp.Batch.Models.MultiInstanceSettings multiInstanceSettings = null, Azure.Temp.Batch.Models.TaskStatistics stats = null, Azure.Temp.Batch.Models.TaskDependencies dependsOn = null, System.Collections.Generic.IEnumerable applicationPackageReferences = null, Azure.Temp.Batch.Models.AuthenticationTokenSettings authenticationTokenSettings = null) { throw null; } + public static Azure.Temp.Batch.Models.CloudTaskListSubtasksResult CloudTaskListSubtasksResult(System.Collections.Generic.IEnumerable value = null) { throw null; } + public static Azure.Temp.Batch.Models.ComputeNode ComputeNode(string id = null, string url = null, Azure.Temp.Batch.Models.ComputeNodeState? state = default(Azure.Temp.Batch.Models.ComputeNodeState?), Azure.Temp.Batch.Models.SchedulingState? schedulingState = default(Azure.Temp.Batch.Models.SchedulingState?), System.DateTimeOffset? stateTransitionTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastBootTime = default(System.DateTimeOffset?), System.DateTimeOffset? allocationTime = default(System.DateTimeOffset?), string ipAddress = null, string affinityId = null, string vmSize = null, int? totalTasksRun = default(int?), int? runningTasksCount = default(int?), int? runningTaskSlotsCount = default(int?), int? totalTasksSucceeded = default(int?), System.Collections.Generic.IEnumerable recentTasks = null, Azure.Temp.Batch.Models.StartTask startTask = null, Azure.Temp.Batch.Models.StartTaskInformation startTaskInfo = null, System.Collections.Generic.IEnumerable certificateReferences = null, System.Collections.Generic.IEnumerable errors = null, bool? isDedicated = default(bool?), Azure.Temp.Batch.Models.ComputeNodeEndpointConfiguration endpointConfiguration = null, Azure.Temp.Batch.Models.NodeAgentInformation nodeAgentInfo = null, Azure.Temp.Batch.Models.VirtualMachineInfo virtualMachineInfo = null) { throw null; } + public static Azure.Temp.Batch.Models.ComputeNodeEndpointConfiguration ComputeNodeEndpointConfiguration(System.Collections.Generic.IEnumerable inboundEndpoints = null) { throw null; } + public static Azure.Temp.Batch.Models.ComputeNodeError ComputeNodeError(string code = null, string message = null, System.Collections.Generic.IEnumerable errorDetails = null) { throw null; } + public static Azure.Temp.Batch.Models.ComputeNodeGetRemoteLoginSettingsResult ComputeNodeGetRemoteLoginSettingsResult(string remoteLoginIPAddress = null, int remoteLoginPort = 0) { throw null; } + public static Azure.Temp.Batch.Models.ComputeNodeInformation ComputeNodeInformation(string affinityId = null, string nodeUrl = null, string poolId = null, string nodeId = null, string taskRootDirectory = null, string taskRootDirectoryUrl = null) { throw null; } + public static Azure.Temp.Batch.Models.DeleteCertificateError DeleteCertificateError(string code = null, string message = null, System.Collections.Generic.IEnumerable values = null) { throw null; } + public static Azure.Temp.Batch.Models.ErrorMessage ErrorMessage(string lang = null, string value = null) { throw null; } + public static Azure.Temp.Batch.Models.FileProperties FileProperties(System.DateTimeOffset? creationTime = default(System.DateTimeOffset?), System.DateTimeOffset lastModified = default(System.DateTimeOffset), long contentLength = (long)0, string contentType = null, string fileMode = null) { throw null; } + public static Azure.Temp.Batch.Models.ImageInformation ImageInformation(string nodeAgentSKUId = null, Azure.Temp.Batch.Models.ImageReference imageReference = null, Azure.Temp.Batch.Models.OSType osType = Azure.Temp.Batch.Models.OSType.Linux, System.Collections.Generic.IEnumerable capabilities = null, System.DateTimeOffset? batchSupportEndOfLife = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.VerificationType verificationType = Azure.Temp.Batch.Models.VerificationType.Verified) { throw null; } + public static Azure.Temp.Batch.Models.ImageReference ImageReference(string publisher = null, string offer = null, string sku = null, string version = null, string virtualMachineImageId = null, string exactVersion = null) { throw null; } + public static Azure.Temp.Batch.Models.InboundEndpoint InboundEndpoint(string name = null, Azure.Temp.Batch.Models.InboundEndpointProtocol protocol = Azure.Temp.Batch.Models.InboundEndpointProtocol.Tcp, string publicIPAddress = null, string publicFqdn = null, int frontendPort = 0, int backendPort = 0) { throw null; } + public static Azure.Temp.Batch.Models.InstanceViewStatus InstanceViewStatus(string code = null, string displayStatus = null, Azure.Temp.Batch.Models.StatusLevelTypes? level = default(Azure.Temp.Batch.Models.StatusLevelTypes?), string message = null, string time = null) { throw null; } + public static Azure.Temp.Batch.Models.JobExecutionInformation JobExecutionInformation(System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset? endTime = default(System.DateTimeOffset?), string poolId = null, Azure.Temp.Batch.Models.JobSchedulingError schedulingError = null, string terminateReason = null) { throw null; } + public static Azure.Temp.Batch.Models.JobPreparationAndReleaseTaskExecutionInformation JobPreparationAndReleaseTaskExecutionInformation(string poolId = null, string nodeId = null, string nodeUrl = null, Azure.Temp.Batch.Models.JobPreparationTaskExecutionInformation jobPreparationTaskExecutionInfo = null, Azure.Temp.Batch.Models.JobReleaseTaskExecutionInformation jobReleaseTaskExecutionInfo = null) { throw null; } + public static Azure.Temp.Batch.Models.JobPreparationTaskExecutionInformation JobPreparationTaskExecutionInformation(System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset? endTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.JobPreparationTaskState state = Azure.Temp.Batch.Models.JobPreparationTaskState.Running, string taskRootDirectory = null, string taskRootDirectoryUrl = null, int? exitCode = default(int?), Azure.Temp.Batch.Models.TaskContainerExecutionInformation containerInfo = null, Azure.Temp.Batch.Models.TaskFailureInformation failureInfo = null, int retryCount = 0, System.DateTimeOffset? lastRetryTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.TaskExecutionResult? result = default(Azure.Temp.Batch.Models.TaskExecutionResult?)) { throw null; } + public static Azure.Temp.Batch.Models.JobReleaseTaskExecutionInformation JobReleaseTaskExecutionInformation(System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset? endTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.JobReleaseTaskState state = Azure.Temp.Batch.Models.JobReleaseTaskState.Running, string taskRootDirectory = null, string taskRootDirectoryUrl = null, int? exitCode = default(int?), Azure.Temp.Batch.Models.TaskContainerExecutionInformation containerInfo = null, Azure.Temp.Batch.Models.TaskFailureInformation failureInfo = null, Azure.Temp.Batch.Models.TaskExecutionResult? result = default(Azure.Temp.Batch.Models.TaskExecutionResult?)) { throw null; } + public static Azure.Temp.Batch.Models.JobScheduleExecutionInformation JobScheduleExecutionInformation(System.DateTimeOffset? nextRunTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.RecentJob recentJob = null, System.DateTimeOffset? endTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Temp.Batch.Models.JobScheduleStatistics JobScheduleStatistics(string url = null, System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset), System.TimeSpan userCPUTime = default(System.TimeSpan), System.TimeSpan kernelCPUTime = default(System.TimeSpan), System.TimeSpan wallClockTime = default(System.TimeSpan), long readIOps = (long)0, long writeIOps = (long)0, double readIOGiB = 0, double writeIOGiB = 0, long numSucceededTasks = (long)0, long numFailedTasks = (long)0, long numTaskRetries = (long)0, System.TimeSpan waitTime = default(System.TimeSpan)) { throw null; } + public static Azure.Temp.Batch.Models.JobSchedulingError JobSchedulingError(Azure.Temp.Batch.Models.ErrorCategory category = Azure.Temp.Batch.Models.ErrorCategory.UserError, string code = null, string message = null, System.Collections.Generic.IEnumerable details = null) { throw null; } + public static Azure.Temp.Batch.Models.JobStatistics JobStatistics(string url = null, System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset), System.TimeSpan userCPUTime = default(System.TimeSpan), System.TimeSpan kernelCPUTime = default(System.TimeSpan), System.TimeSpan wallClockTime = default(System.TimeSpan), long readIOps = (long)0, long writeIOps = (long)0, double readIOGiB = 0, double writeIOGiB = 0, long numSucceededTasks = (long)0, long numFailedTasks = (long)0, long numTaskRetries = (long)0, System.TimeSpan waitTime = default(System.TimeSpan)) { throw null; } + public static Azure.Temp.Batch.Models.NameValuePair NameValuePair(string name = null, string value = null) { throw null; } + public static Azure.Temp.Batch.Models.NodeAgentInformation NodeAgentInformation(string version = null, System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Temp.Batch.Models.NodeCounts NodeCounts(int creating = 0, int idle = 0, int offline = 0, int preempted = 0, int rebooting = 0, int reimaging = 0, int running = 0, int starting = 0, int startTaskFailed = 0, int leavingPool = 0, int unknown = 0, int unusable = 0, int waitingForStartTask = 0, int total = 0) { throw null; } + public static Azure.Temp.Batch.Models.NodeFile NodeFile(string name = null, string url = null, bool? isDirectory = default(bool?), Azure.Temp.Batch.Models.FileProperties properties = null) { throw null; } + public static Azure.Temp.Batch.Models.NodeVMExtension NodeVMExtension(string provisioningState = null, Azure.Temp.Batch.Models.VMExtension vmExtension = null, Azure.Temp.Batch.Models.VMExtensionInstanceView instanceView = null) { throw null; } + public static Azure.Temp.Batch.Models.PoolNodeCounts PoolNodeCounts(string poolId = null, Azure.Temp.Batch.Models.NodeCounts dedicated = null, Azure.Temp.Batch.Models.NodeCounts lowPriority = null) { throw null; } + public static Azure.Temp.Batch.Models.PoolStatistics PoolStatistics(string url = null, System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset), Azure.Temp.Batch.Models.UsageStatistics usageStats = null, Azure.Temp.Batch.Models.ResourceStatistics resourceStats = null) { throw null; } + public static Azure.Temp.Batch.Models.PoolUsageMetrics PoolUsageMetrics(string poolId = null, System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), string vmSize = null, double totalCoreHours = 0) { throw null; } + public static Azure.Temp.Batch.Models.RecentJob RecentJob(string id = null, string url = null) { throw null; } + public static Azure.Temp.Batch.Models.ResizeError ResizeError(string code = null, string message = null, System.Collections.Generic.IEnumerable values = null) { throw null; } + public static Azure.Temp.Batch.Models.ResourceStatistics ResourceStatistics(System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset), double avgCPUPercentage = 0, double avgMemoryGiB = 0, double peakMemoryGiB = 0, double avgDiskGiB = 0, double peakDiskGiB = 0, long diskReadIOps = (long)0, long diskWriteIOps = (long)0, double diskReadGiB = 0, double diskWriteGiB = 0, double networkReadGiB = 0, double networkWriteGiB = 0) { throw null; } + public static Azure.Temp.Batch.Models.StartTaskInformation StartTaskInformation(Azure.Temp.Batch.Models.StartTaskState state = Azure.Temp.Batch.Models.StartTaskState.Running, System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset? endTime = default(System.DateTimeOffset?), int? exitCode = default(int?), Azure.Temp.Batch.Models.TaskContainerExecutionInformation containerInfo = null, Azure.Temp.Batch.Models.TaskFailureInformation failureInfo = null, int retryCount = 0, System.DateTimeOffset? lastRetryTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.TaskExecutionResult? result = default(Azure.Temp.Batch.Models.TaskExecutionResult?)) { throw null; } + public static Azure.Temp.Batch.Models.SubtaskInformation SubtaskInformation(int? id = default(int?), Azure.Temp.Batch.Models.ComputeNodeInformation nodeInfo = null, System.DateTimeOffset? startTime = default(System.DateTimeOffset?), System.DateTimeOffset? endTime = default(System.DateTimeOffset?), int? exitCode = default(int?), Azure.Temp.Batch.Models.TaskContainerExecutionInformation containerInfo = null, Azure.Temp.Batch.Models.TaskFailureInformation failureInfo = null, Azure.Temp.Batch.Models.SubtaskState? state = default(Azure.Temp.Batch.Models.SubtaskState?), System.DateTimeOffset? stateTransitionTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.SubtaskState? previousState = default(Azure.Temp.Batch.Models.SubtaskState?), System.DateTimeOffset? previousStateTransitionTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.TaskExecutionResult? result = default(Azure.Temp.Batch.Models.TaskExecutionResult?)) { throw null; } + public static Azure.Temp.Batch.Models.TaskAddCollectionResult TaskAddCollectionResult(System.Collections.Generic.IEnumerable value = null) { throw null; } + public static Azure.Temp.Batch.Models.TaskAddResult TaskAddResult(Azure.Temp.Batch.Models.TaskAddStatus status = Azure.Temp.Batch.Models.TaskAddStatus.Success, string taskId = null, string eTag = null, System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), string location = null, Azure.Temp.Batch.Models.BatchError error = null) { throw null; } + public static Azure.Temp.Batch.Models.TaskContainerExecutionInformation TaskContainerExecutionInformation(string containerId = null, string state = null, string error = null) { throw null; } + public static Azure.Temp.Batch.Models.TaskCounts TaskCounts(int active = 0, int running = 0, int completed = 0, int succeeded = 0, int failed = 0) { throw null; } + public static Azure.Temp.Batch.Models.TaskCountsResult TaskCountsResult(Azure.Temp.Batch.Models.TaskCounts taskCounts = null, Azure.Temp.Batch.Models.TaskSlotCounts taskSlotCounts = null) { throw null; } + public static Azure.Temp.Batch.Models.TaskExecutionInformation TaskExecutionInformation(System.DateTimeOffset? startTime = default(System.DateTimeOffset?), System.DateTimeOffset? endTime = default(System.DateTimeOffset?), int? exitCode = default(int?), Azure.Temp.Batch.Models.TaskContainerExecutionInformation containerInfo = null, Azure.Temp.Batch.Models.TaskFailureInformation failureInfo = null, int retryCount = 0, System.DateTimeOffset? lastRetryTime = default(System.DateTimeOffset?), int requeueCount = 0, System.DateTimeOffset? lastRequeueTime = default(System.DateTimeOffset?), Azure.Temp.Batch.Models.TaskExecutionResult? result = default(Azure.Temp.Batch.Models.TaskExecutionResult?)) { throw null; } + public static Azure.Temp.Batch.Models.TaskFailureInformation TaskFailureInformation(Azure.Temp.Batch.Models.ErrorCategory category = Azure.Temp.Batch.Models.ErrorCategory.UserError, string code = null, string message = null, System.Collections.Generic.IEnumerable details = null) { throw null; } + public static Azure.Temp.Batch.Models.TaskInformation TaskInformation(string taskUrl = null, string jobId = null, string taskId = null, int? subtaskId = default(int?), Azure.Temp.Batch.Models.TaskState taskState = Azure.Temp.Batch.Models.TaskState.Active, Azure.Temp.Batch.Models.TaskExecutionInformation executionInfo = null) { throw null; } + public static Azure.Temp.Batch.Models.TaskSlotCounts TaskSlotCounts(int active = 0, int running = 0, int completed = 0, int succeeded = 0, int failed = 0) { throw null; } + public static Azure.Temp.Batch.Models.TaskStatistics TaskStatistics(string url = null, System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset), System.TimeSpan userCPUTime = default(System.TimeSpan), System.TimeSpan kernelCPUTime = default(System.TimeSpan), System.TimeSpan wallClockTime = default(System.TimeSpan), long readIOps = (long)0, long writeIOps = (long)0, double readIOGiB = 0, double writeIOGiB = 0, System.TimeSpan waitTime = default(System.TimeSpan)) { throw null; } + public static Azure.Temp.Batch.Models.UploadBatchServiceLogsResult UploadBatchServiceLogsResult(string virtualDirectoryName = null, int numberOfFilesUploaded = 0) { throw null; } + public static Azure.Temp.Batch.Models.UsageStatistics UsageStatistics(System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset), System.TimeSpan dedicatedCoreTime = default(System.TimeSpan)) { throw null; } + public static Azure.Temp.Batch.Models.UserAssignedIdentity UserAssignedIdentity(string resourceId = null, string clientId = null, string principalId = null) { throw null; } + public static Azure.Temp.Batch.Models.VirtualMachineInfo VirtualMachineInfo(Azure.Temp.Batch.Models.ImageReference imageReference = null) { throw null; } + public static Azure.Temp.Batch.Models.VMExtensionInstanceView VMExtensionInstanceView(string name = null, System.Collections.Generic.IEnumerable statuses = null, System.Collections.Generic.IEnumerable subStatuses = null) { throw null; } + } + public partial class UploadBatchServiceLogsConfiguration + { + public UploadBatchServiceLogsConfiguration(string containerUrl, System.DateTimeOffset startTime) { } + public string ContainerUrl { get { throw null; } } + public System.DateTimeOffset? EndTime { get { throw null; } set { } } + public Azure.Temp.Batch.Models.ComputeNodeIdentityReference IdentityReference { get { throw null; } set { } } + public System.DateTimeOffset StartTime { get { throw null; } } + } + public partial class UploadBatchServiceLogsResult + { + internal UploadBatchServiceLogsResult() { } + public int NumberOfFilesUploaded { get { throw null; } } + public string VirtualDirectoryName { get { throw null; } } + } + public partial class UsageStatistics + { + internal UsageStatistics() { } + public System.TimeSpan DedicatedCoreTime { get { throw null; } } + public System.DateTimeOffset LastUpdateTime { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + } + public partial class UserAccount + { + public UserAccount(string name, string password) { } + public Azure.Temp.Batch.Models.ElevationLevel? ElevationLevel { get { throw null; } set { } } + public Azure.Temp.Batch.Models.LinuxUserConfiguration LinuxUserConfiguration { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string Password { get { throw null; } set { } } + public Azure.Temp.Batch.Models.WindowsUserConfiguration WindowsUserConfiguration { get { throw null; } set { } } + } + public partial class UserAssignedIdentity + { + internal UserAssignedIdentity() { } + public string ClientId { get { throw null; } } + public string PrincipalId { get { throw null; } } + public string ResourceId { get { throw null; } } + } + public partial class UserIdentity + { + public UserIdentity() { } + public Azure.Temp.Batch.Models.AutoUserSpecification AutoUser { get { throw null; } set { } } + public string UserName { get { throw null; } set { } } + } + public enum VerificationType + { + Verified = 0, + Unverified = 1, + } + public partial class VirtualMachineConfiguration + { + public VirtualMachineConfiguration(Azure.Temp.Batch.Models.ImageReference imageReference, string nodeAgentSKUId) { } + public Azure.Temp.Batch.Models.ContainerConfiguration ContainerConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IList DataDisks { get { throw null; } } + public Azure.Temp.Batch.Models.DiskEncryptionConfiguration DiskEncryptionConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IList Extensions { get { throw null; } } + public Azure.Temp.Batch.Models.ImageReference ImageReference { get { throw null; } set { } } + public string LicenseType { get { throw null; } set { } } + public string NodeAgentSKUId { get { throw null; } set { } } + public Azure.Temp.Batch.Models.NodePlacementConfiguration NodePlacementConfiguration { get { throw null; } set { } } + public Azure.Temp.Batch.Models.OSDisk OsDisk { get { throw null; } set { } } + public Azure.Temp.Batch.Models.WindowsConfiguration WindowsConfiguration { get { throw null; } set { } } + } + public partial class VirtualMachineInfo + { + internal VirtualMachineInfo() { } + public Azure.Temp.Batch.Models.ImageReference ImageReference { get { throw null; } } + } + public partial class VMExtension + { + public VMExtension(string name, string publisher, string type) { } + public bool? AutoUpgradeMinorVersion { get { throw null; } set { } } + public bool? EnableAutomaticUpgrade { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public object ProtectedSettings { get { throw null; } set { } } + public System.Collections.Generic.IList ProvisionAfterExtensions { get { throw null; } } + public string Publisher { get { throw null; } set { } } + public object Settings { get { throw null; } set { } } + public string Type { get { throw null; } set { } } + public string TypeHandlerVersion { get { throw null; } set { } } + } + public partial class VMExtensionInstanceView + { + internal VMExtensionInstanceView() { } + public string Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Statuses { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SubStatuses { get { throw null; } } + } + public partial class WindowsConfiguration + { + public WindowsConfiguration() { } + public bool? EnableAutomaticUpdates { get { throw null; } set { } } + } + public partial class WindowsUserConfiguration + { + public WindowsUserConfiguration() { } + public Azure.Temp.Batch.Models.LoginMode? LoginMode { get { throw null; } set { } } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/ci.yml b/sdk/batch/Azure.Temp.Batch/ci.yml new file mode 100644 index 000000000000..307738726cff --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/ci.yml @@ -0,0 +1,54 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/template/ +#if (false) + # The following paths should only be included in template/ci.yml, and removed from any other SDKs which copy this file. + # The surrounding conditions should accomplish that when installed with `dotnet new azsdk`. + # eng/common code changes trigger template pipeline for basic checking. + - eng/common/ +#endif + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/template/ +#if (false) + # The following paths should only be included in template/ci.yml, and removed from any other SDKs which copy this file. + # The surrounding conditions should accomplish that when installed with `dotnet new azsdk`. + # eng/common code changes trigger template pipeline for basic checking. + - eng/common/ +#endif + +parameters: +- name: AllowFailingLiveTests + displayName: Allow release with failing live tests + type: boolean + default: false + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: template + ArtifactName: packages + Artifacts: + - name: Azure.Template + safeName: AzureTemplate + ReleaseDependsOnLiveTests: ${{ not(parameters.AllowFailingLiveTests) }} + LiveTestStages: + - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml + parameters: + ServiceDirectory: template diff --git a/sdk/batch/Azure.Temp.Batch/perf/Azure.Template.Perf.csproj b/sdk/batch/Azure.Temp.Batch/perf/Azure.Template.Perf.csproj new file mode 100644 index 000000000000..125c8cb105d6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/perf/Azure.Template.Perf.csproj @@ -0,0 +1,16 @@ + + + + Exe + + + + + + + + + + + + diff --git a/sdk/batch/Azure.Temp.Batch/perf/Program.cs b/sdk/batch/Azure.Temp.Batch/perf/Program.cs new file mode 100644 index 000000000000..78a52ddce190 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/perf/Program.cs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Reflection; +using Azure.Test.Perf; + + await PerfProgram.Main(Assembly.GetEntryAssembly(), args); diff --git a/sdk/batch/Azure.Temp.Batch/perf/TemplateClientTest.cs b/sdk/batch/Azure.Temp.Batch/perf/TemplateClientTest.cs new file mode 100644 index 000000000000..6c6b0f58f2a8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/perf/TemplateClientTest.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Identity; +using Azure.Test.Perf; +using CommandLine; + +namespace Azure.Template.Perf +{ + public class TemplateClientTest : PerfTest + { + private readonly TemplateClient _templateClient; + + public TemplateClientTest(TemplateClientPerfOptions options) : base(options) + { + string keyVaultUri = GetEnvironmentVariable("KEYVAULT_URL"); + _templateClient = new TemplateClient(keyVaultUri, new DefaultAzureCredential()); + } + + public override void Run(CancellationToken cancellationToken) + { + // Throttle requests to avoid exceeding service limits + Thread.Sleep(TimeSpan.FromMilliseconds(Options.Delay)); + + _templateClient.GetSecretValue(Options.SecretName, cancellationToken); + } + + public override async Task RunAsync(CancellationToken cancellationToken) + { + // Throttle requests to avoid exceeding service limits + await Task.Delay(TimeSpan.FromMilliseconds(Options.Delay), cancellationToken); + + await _templateClient.GetSecretValueAsync(Options.SecretName, cancellationToken); + } + + public class TemplateClientPerfOptions : PerfOptions + { + [Option("secret-name", Default = "TestSecret", HelpText = "Name of secret to get")] + public string SecretName { get; set; } + + [Option("delay", Default = 100, HelpText = "Delay between gets (milliseconds)")] + public int Delay { get; set; } + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/samples/README.md b/sdk/batch/Azure.Temp.Batch/samples/README.md new file mode 100644 index 000000000000..0f7694be10f0 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/samples/README.md @@ -0,0 +1,17 @@ +--- +page_type: sample +languages: +- csharp +products: +# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product +- azure +name: Azure.Template samples for .NET +description: Samples for the Azure.Template client library. +--- + +# Azure.Template Samples + +These code samples show common scenarios with the Azure Template client library. + +|[Sample1_HelloWorld](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/tests/Samples/Sample1_HelloWorld.cs) |Get secrets synchronously.| +|[Sample1_HelloWorld_Async](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/tests/Samples/Sample1_HelloWorldAsync.cs)] |Get secrets asynchronously.| diff --git a/sdk/batch/Azure.Temp.Batch/samples/Sample1.HelloWorldAsync.md b/sdk/batch/Azure.Temp.Batch/samples/Sample1.HelloWorldAsync.md new file mode 100644 index 000000000000..d2763389cf8e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/samples/Sample1.HelloWorldAsync.md @@ -0,0 +1,24 @@ +# Get secret asynchronously + +To use these samples, you'll first need to set up resources. See [getting started](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/README.md#getting-started) for details. + +## Import the namespaces + +```C# Snippet:Azure_Template +using Azure.Identity; +using Azure.Template.Models; +``` + +## Get secrets asynchronously + +You can also get secrets asynchronously: + +```C# Snippet:Azure_Template_GetSecretAsync +string endpoint = "https://myvault.vault.azure.net"; +var credential = new DefaultAzureCredential(); +var client = new TemplateClient(endpoint, credential); + +SecretBundle secret = await client.GetSecretValueAsync("TestSecret"); + +Console.WriteLine(secret.Value); +``` diff --git a/sdk/batch/Azure.Temp.Batch/samples/Sample1_HelloWorld.md b/sdk/batch/Azure.Temp.Batch/samples/Sample1_HelloWorld.md new file mode 100644 index 000000000000..52aa48bda9b0 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/samples/Sample1_HelloWorld.md @@ -0,0 +1,24 @@ +# Get secret + +To use these samples, you'll first need to set up resources. See [getting started](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/README.md#getting-started) for details. + +## Import the namespaces + +```C# Snippet:Azure_Template +using Azure.Identity; +using Azure.Template.Models; +``` + +## Get secrets synchronously + +You can create a client and get secrets synchronously: + +```C# Snippet:Azure_Template_GetSecret +string endpoint = "https://myvault.vault.azure.net"; +var credential = new DefaultAzureCredential(); +var client = new TemplateClient(endpoint, credential); + +SecretBundle secret = client.GetSecretValue("TestSecret"); + +Console.WriteLine(secret.Value); +``` diff --git a/sdk/batch/Azure.Temp.Batch/src/Azure.Temp.Batch.csproj b/sdk/batch/Azure.Temp.Batch/src/Azure.Temp.Batch.csproj new file mode 100644 index 000000000000..6fad75958403 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Azure.Temp.Batch.csproj @@ -0,0 +1,22 @@ + + + This is the Template client library for developing .NET applications with rich experience. + Azure SDK Code Generation Template for Azure Data Plane + 1.0.3-beta.20 + Azure Template + $(RequiredTargetFrameworks) + true + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/AccountClient.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/AccountClient.cs new file mode 100644 index 000000000000..2ec99a4aef54 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/AccountClient.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Temp.Batch +{ + // Data plane generated client. + /// The Account service client. + public partial class AccountClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://batch.core.windows.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly string _batchUrl; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of AccountClient for mocking. + protected AccountClient() + { + } + + /// Initializes a new instance of AccountClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public AccountClient(string batchUrl, TokenCredential credential) : this(batchUrl, credential, new BatchServiceClientOptions()) + { + } + + /// Initializes a new instance of AccountClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public AccountClient(string batchUrl, TokenCredential credential, BatchServiceClientOptions options) + { + Argument.AssertNotNull(batchUrl, nameof(batchUrl)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new BatchServiceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _batchUrl = batchUrl; + _apiVersion = options.Version; + } + + /// + /// [Protocol Method] Lists all Virtual Machine Images supported by the Azure Batch service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. + /// The maximum number of items to return in the response. A maximum of 1000 results will be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetSupportedImagesAsync(string filter, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedImagesRequest(filter, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedImagesNextPageRequest(nextLink, filter, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AccountClient.GetSupportedImages", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists all Virtual Machine Images supported by the Azure Batch service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. + /// The maximum number of items to return in the response. A maximum of 1000 results will be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetSupportedImages(string filter, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedImagesRequest(filter, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedImagesNextPageRequest(nextLink, filter, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AccountClient.GetSupportedImages", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] 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. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch. + /// The maximum number of items to return in the response. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetPoolNodeCountsAsync(string filter, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetPoolNodeCountsRequest(filter, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetPoolNodeCountsNextPageRequest(nextLink, filter, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AccountClient.GetPoolNodeCounts", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] 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. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch. + /// The maximum number of items to return in the response. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetPoolNodeCounts(string filter, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetPoolNodeCountsRequest(filter, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetPoolNodeCountsNextPageRequest(nextLink, filter, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AccountClient.GetPoolNodeCounts", "value", "odata.nextLink", context); + } + + internal HttpMessage CreateGetSupportedImagesRequest(string filter, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/supportedimages", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetPoolNodeCountsRequest(string filter, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/nodecounts", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetSupportedImagesNextPageRequest(string nextLink, string filter, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetPoolNodeCountsNextPageRequest(string nextLink, string filter, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/ApplicationClient.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/ApplicationClient.cs new file mode 100644 index 000000000000..f61defd33e88 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/ApplicationClient.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Temp.Batch +{ + // Data plane generated client. + /// The Application service client. + public partial class ApplicationClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://batch.core.windows.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly string _batchUrl; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of ApplicationClient for mocking. + protected ApplicationClient() + { + } + + /// Initializes a new instance of ApplicationClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public ApplicationClient(string batchUrl, TokenCredential credential) : this(batchUrl, credential, new BatchServiceClientOptions()) + { + } + + /// Initializes a new instance of ApplicationClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public ApplicationClient(string batchUrl, TokenCredential credential, BatchServiceClientOptions options) + { + Argument.AssertNotNull(batchUrl, nameof(batchUrl)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new BatchServiceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _batchUrl = batchUrl; + _apiVersion = options.Version; + } + + /// + /// [Protocol Method] Gets information about the specified Application. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Application. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetApplicationAsync(string applicationId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); + + using var scope = ClientDiagnostics.CreateScope("ApplicationClient.GetApplication"); + scope.Start(); + try + { + using HttpMessage message = CreateGetApplicationRequest(applicationId, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Application. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Application. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetApplication(string applicationId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); + + using var scope = ClientDiagnostics.CreateScope("ApplicationClient.GetApplication"); + scope.Start(); + try + { + using HttpMessage message = CreateGetApplicationRequest(applicationId, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists all of the applications available in the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The maximum number of items to return in the response. A maximum of 1000 applications can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetApplicationsAsync(int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetApplicationsRequest(maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetApplicationsNextPageRequest(nextLink, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ApplicationClient.GetApplications", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists all of the applications available in the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The maximum number of items to return in the response. A maximum of 1000 applications can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetApplications(int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetApplicationsRequest(maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetApplicationsNextPageRequest(nextLink, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ApplicationClient.GetApplications", "value", "odata.nextLink", context); + } + + internal HttpMessage CreateGetApplicationsRequest(int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/applications", false); + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetApplicationRequest(string applicationId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/applications/", false); + uri.AppendPath(applicationId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetApplicationsNextPageRequest(string nextLink, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/BatchServiceClientOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/BatchServiceClientOptions.cs new file mode 100644 index 000000000000..917a1b34a681 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/BatchServiceClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch +{ + /// Client options for BatchServiceClient library clients. + public partial class BatchServiceClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2023_05_01_17_0; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2023-05-01.17.0". + V2023_05_01_17_0 = 1, + } + + internal string Version { get; } + + /// Initializes new instance of BatchServiceClientOptions. + public BatchServiceClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2023_05_01_17_0 => "2023-05-01.17.0", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/CertificateClient.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/CertificateClient.cs new file mode 100644 index 000000000000..17f4106537dc --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/CertificateClient.cs @@ -0,0 +1,602 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Temp.Batch +{ + // Data plane generated client. + /// The Certificate service client. + public partial class CertificateClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://batch.core.windows.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly string _batchUrl; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of CertificateClient for mocking. + protected CertificateClient() + { + } + + /// Initializes a new instance of CertificateClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public CertificateClient(string batchUrl, TokenCredential credential) : this(batchUrl, credential, new BatchServiceClientOptions()) + { + } + + /// Initializes a new instance of CertificateClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public CertificateClient(string batchUrl, TokenCredential credential, BatchServiceClientOptions options) + { + Argument.AssertNotNull(batchUrl, nameof(batchUrl)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new BatchServiceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _batchUrl = batchUrl; + _apiVersion = options.Version; + } + + /// + /// [Protocol Method] Adds a Certificate to the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AddAsync(RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("CertificateClient.Add"); + scope.Start(); + try + { + using HttpMessage message = CreateAddRequest(content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds a Certificate to the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Add(RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("CertificateClient.Add"); + scope.Start(); + try + { + using HttpMessage message = CreateAddRequest(content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Cancels a failed deletion of a Certificate from the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The algorithm used to derive the thumbprint parameter. This must be sha1. + /// The thumbprint of the Certificate being deleted. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CancelDeletionAsync(string thumbprintAlgorithm, string thumbprint, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm)); + Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint)); + + using var scope = ClientDiagnostics.CreateScope("CertificateClient.CancelDeletion"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelDeletionRequest(thumbprintAlgorithm, thumbprint, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Cancels a failed deletion of a Certificate from the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The algorithm used to derive the thumbprint parameter. This must be sha1. + /// The thumbprint of the Certificate being deleted. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CancelDeletion(string thumbprintAlgorithm, string thumbprint, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm)); + Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint)); + + using var scope = ClientDiagnostics.CreateScope("CertificateClient.CancelDeletion"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelDeletionRequest(thumbprintAlgorithm, thumbprint, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a Certificate from the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The algorithm used to derive the thumbprint parameter. This must be sha1. + /// The thumbprint of the Certificate to be deleted. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string thumbprintAlgorithm, string thumbprint, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm)); + Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint)); + + using var scope = ClientDiagnostics.CreateScope("CertificateClient.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(thumbprintAlgorithm, thumbprint, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a Certificate from the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The algorithm used to derive the thumbprint parameter. This must be sha1. + /// The thumbprint of the Certificate to be deleted. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string thumbprintAlgorithm, string thumbprint, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm)); + Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint)); + + using var scope = ClientDiagnostics.CreateScope("CertificateClient.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(thumbprintAlgorithm, thumbprint, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Certificate. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The algorithm used to derive the thumbprint parameter. This must be sha1. + /// The thumbprint of the Certificate to get. + /// An OData $select clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetCertificateAsync(string thumbprintAlgorithm, string thumbprint, string select, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm)); + Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint)); + + using var scope = ClientDiagnostics.CreateScope("CertificateClient.GetCertificate"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCertificateRequest(thumbprintAlgorithm, thumbprint, select, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Certificate. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The algorithm used to derive the thumbprint parameter. This must be sha1. + /// The thumbprint of the Certificate to get. + /// An OData $select clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetCertificate(string thumbprintAlgorithm, string thumbprint, string select, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm)); + Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint)); + + using var scope = ClientDiagnostics.CreateScope("CertificateClient.GetCertificate"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCertificateRequest(thumbprintAlgorithm, thumbprint, select, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists all of the Certificates that have been added to the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-certificates. + /// An OData $select clause. + /// The maximum number of items to return in the response. A maximum of 1000 Certificates can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetCertificatesAsync(string filter, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetCertificatesRequest(filter, select, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetCertificatesNextPageRequest(nextLink, filter, select, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "CertificateClient.GetCertificates", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists all of the Certificates that have been added to the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-certificates. + /// An OData $select clause. + /// The maximum number of items to return in the response. A maximum of 1000 Certificates can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetCertificates(string filter, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetCertificatesRequest(filter, select, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetCertificatesNextPageRequest(nextLink, filter, select, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "CertificateClient.GetCertificates", "value", "odata.nextLink", context); + } + + internal HttpMessage CreateAddRequest(RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/certificates", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetCertificatesRequest(string filter, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/certificates", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateCancelDeletionRequest(string thumbprintAlgorithm, string thumbprint, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/certificates(thumbprintAlgorithm=", false); + uri.AppendPath(thumbprintAlgorithm, true); + uri.AppendPath(",thumbprint=", false); + uri.AppendPath(thumbprint, true); + uri.AppendPath(")/canceldelete", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateDeleteRequest(string thumbprintAlgorithm, string thumbprint, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/certificates(thumbprintAlgorithm=", false); + uri.AppendPath(thumbprintAlgorithm, true); + uri.AppendPath(",thumbprint=", false); + uri.AppendPath(thumbprint, true); + uri.AppendPath(")", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetCertificateRequest(string thumbprintAlgorithm, string thumbprint, string select, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/certificates(thumbprintAlgorithm=", false); + uri.AppendPath(thumbprintAlgorithm, true); + uri.AppendPath(",thumbprint=", false); + uri.AppendPath(thumbprint, true); + uri.AppendPath(")", false); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetCertificatesNextPageRequest(string nextLink, string filter, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/ComputeNodeClient.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/ComputeNodeClient.cs new file mode 100644 index 000000000000..ecbeba5cd06c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/ComputeNodeClient.cs @@ -0,0 +1,1401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Temp.Batch +{ + // Data plane generated client. + /// The ComputeNode service client. + public partial class ComputeNodeClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://batch.core.windows.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly string _batchUrl; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of ComputeNodeClient for mocking. + protected ComputeNodeClient() + { + } + + /// Initializes a new instance of ComputeNodeClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public ComputeNodeClient(string batchUrl, TokenCredential credential) : this(batchUrl, credential, new BatchServiceClientOptions()) + { + } + + /// Initializes a new instance of ComputeNodeClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public ComputeNodeClient(string batchUrl, TokenCredential credential, BatchServiceClientOptions options) + { + Argument.AssertNotNull(batchUrl, nameof(batchUrl)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new BatchServiceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _batchUrl = batchUrl; + _apiVersion = options.Version; + } + + /// + /// [Protocol Method] Adds a user Account to the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the machine on which you want to create a user Account. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AddUserAsync(string poolId, string nodeId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.AddUser"); + scope.Start(); + try + { + using HttpMessage message = CreateAddUserRequest(poolId, nodeId, content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds a user Account to the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the machine on which you want to create a user Account. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response AddUser(string poolId, string nodeId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.AddUser"); + scope.Start(); + try + { + using HttpMessage message = CreateAddUserRequest(poolId, nodeId, content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a user Account from the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the machine on which you want to delete a user Account. + /// The name of the user Account to delete. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteUserAsync(string poolId, string nodeId, string userName, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.DeleteUser"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteUserRequest(poolId, nodeId, userName, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a user Account from the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the machine on which you want to delete a user Account. + /// The name of the user Account to delete. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteUser(string poolId, string nodeId, string userName, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.DeleteUser"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteUserRequest(poolId, nodeId, userName, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the password and expiration time of a user Account on the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the machine on which you want to update a user Account. + /// The name of the user Account to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task UpdateUserAsync(string poolId, string nodeId, string userName, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.UpdateUser"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateUserRequest(poolId, nodeId, userName, content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the password and expiration time of a user Account on the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the machine on which you want to update a user Account. + /// The name of the user Account to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response UpdateUser(string poolId, string nodeId, string userName, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.UpdateUser"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateUserRequest(poolId, nodeId, userName, content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to get information about. + /// An OData $select clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetComputeNodeAsync(string poolId, string nodeId, string select, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.GetComputeNode"); + scope.Start(); + try + { + using HttpMessage message = CreateGetComputeNodeRequest(poolId, nodeId, select, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to get information about. + /// An OData $select clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetComputeNode(string poolId, string nodeId, string select, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.GetComputeNode"); + scope.Start(); + try + { + using HttpMessage message = CreateGetComputeNodeRequest(poolId, nodeId, select, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Restarts the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task RebootAsync(string poolId, string nodeId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.Reboot"); + scope.Start(); + try + { + using HttpMessage message = CreateRebootRequest(poolId, nodeId, content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Restarts the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Reboot(string poolId, string nodeId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.Reboot"); + scope.Start(); + try + { + using HttpMessage message = CreateRebootRequest(poolId, nodeId, content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Reinstalls the operating system on the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ReimageAsync(string poolId, string nodeId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.Reimage"); + scope.Start(); + try + { + using HttpMessage message = CreateReimageRequest(poolId, nodeId, content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Reinstalls the operating system on the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Reimage(string poolId, string nodeId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.Reimage"); + scope.Start(); + try + { + using HttpMessage message = CreateReimageRequest(poolId, nodeId, content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Disables Task scheduling on the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node on which you want to disable Task scheduling. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DisableSchedulingAsync(string poolId, string nodeId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.DisableScheduling"); + scope.Start(); + try + { + using HttpMessage message = CreateDisableSchedulingRequest(poolId, nodeId, content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Disables Task scheduling on the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node on which you want to disable Task scheduling. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DisableScheduling(string poolId, string nodeId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.DisableScheduling"); + scope.Start(); + try + { + using HttpMessage message = CreateDisableSchedulingRequest(poolId, nodeId, content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Enables Task scheduling on the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node on which you want to enable Task scheduling. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task EnableSchedulingAsync(string poolId, string nodeId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.EnableScheduling"); + scope.Start(); + try + { + using HttpMessage message = CreateEnableSchedulingRequest(poolId, nodeId, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Enables Task scheduling on the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node on which you want to enable Task scheduling. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response EnableScheduling(string poolId, string nodeId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.EnableScheduling"); + scope.Start(); + try + { + using HttpMessage message = CreateEnableSchedulingRequest(poolId, nodeId, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the settings required for remote login to a Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node for which to obtain the remote login settings. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetRemoteLoginSettingsAsync(string poolId, string nodeId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.GetRemoteLoginSettings"); + scope.Start(); + try + { + using HttpMessage message = CreateGetRemoteLoginSettingsRequest(poolId, nodeId, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the settings required for remote login to a Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node for which to obtain the remote login settings. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetRemoteLoginSettings(string poolId, string nodeId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.GetRemoteLoginSettings"); + scope.Start(); + try + { + using HttpMessage message = CreateGetRemoteLoginSettingsRequest(poolId, nodeId, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the Remote Desktop Protocol file for the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node for which you want to get the Remote Desktop Protocol file. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetRemoteDesktopAsync(string poolId, string nodeId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.GetRemoteDesktop"); + scope.Start(); + try + { + using HttpMessage message = CreateGetRemoteDesktopRequest(poolId, nodeId, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the Remote Desktop Protocol file for the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node for which you want to get the Remote Desktop Protocol file. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetRemoteDesktop(string poolId, string nodeId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.GetRemoteDesktop"); + scope.Start(); + try + { + using HttpMessage message = CreateGetRemoteDesktopRequest(poolId, nodeId, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Upload Azure Batch service log files from the specified Compute Node to Azure Blob Storage. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node from which you want to upload the Azure Batch service log files. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task UploadBatchServiceLogsAsync(string poolId, string nodeId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.UploadBatchServiceLogs"); + scope.Start(); + try + { + using HttpMessage message = CreateUploadBatchServiceLogsRequest(poolId, nodeId, content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Upload Azure Batch service log files from the specified Compute Node to Azure Blob Storage. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node from which you want to upload the Azure Batch service log files. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response UploadBatchServiceLogs(string poolId, string nodeId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeClient.UploadBatchServiceLogs"); + scope.Start(); + try + { + using HttpMessage message = CreateUploadBatchServiceLogsRequest(poolId, nodeId, content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists the Compute Nodes in the specified Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool from which you want to list Compute Nodes. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. + /// 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 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetComputeNodesAsync(string poolId, string filter, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetComputeNodesRequest(poolId, filter, select, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetComputeNodesNextPageRequest(nextLink, poolId, filter, select, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ComputeNodeClient.GetComputeNodes", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists the Compute Nodes in the specified Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool from which you want to list Compute Nodes. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. + /// 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 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetComputeNodes(string poolId, string filter, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetComputeNodesRequest(poolId, filter, select, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetComputeNodesNextPageRequest(nextLink, poolId, filter, select, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ComputeNodeClient.GetComputeNodes", "value", "odata.nextLink", context); + } + + internal HttpMessage CreateAddUserRequest(string poolId, string nodeId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/users", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteUserRequest(string poolId, string nodeId, string userName, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/users/", false); + uri.AppendPath(userName, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateUpdateUserRequest(string poolId, string nodeId, string userName, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/users/", false); + uri.AppendPath(userName, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetComputeNodeRequest(string poolId, string nodeId, string select, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateRebootRequest(string poolId, string nodeId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/reboot", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateReimageRequest(string poolId, string nodeId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/reimage", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDisableSchedulingRequest(string poolId, string nodeId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/disablescheduling", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateEnableSchedulingRequest(string poolId, string nodeId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/enablescheduling", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetRemoteLoginSettingsRequest(string poolId, string nodeId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/remoteloginsettings", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetRemoteDesktopRequest(string poolId, string nodeId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/rdp", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json, application/octet-stream"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateUploadBatchServiceLogsRequest(string poolId, string nodeId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/uploadbatchservicelogs", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetComputeNodesRequest(string poolId, string filter, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetComputeNodesNextPageRequest(string nextLink, string poolId, string filter, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/ComputeNodeExtensionClient.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/ComputeNodeExtensionClient.cs new file mode 100644 index 000000000000..7fad6f9af660 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/ComputeNodeExtensionClient.cs @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Temp.Batch +{ + // Data plane generated client. + /// The ComputeNodeExtension service client. + public partial class ComputeNodeExtensionClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://batch.core.windows.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly string _batchUrl; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of ComputeNodeExtensionClient for mocking. + protected ComputeNodeExtensionClient() + { + } + + /// Initializes a new instance of ComputeNodeExtensionClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public ComputeNodeExtensionClient(string batchUrl, TokenCredential credential) : this(batchUrl, credential, new BatchServiceClientOptions()) + { + } + + /// Initializes a new instance of ComputeNodeExtensionClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public ComputeNodeExtensionClient(string batchUrl, TokenCredential credential, BatchServiceClientOptions options) + { + Argument.AssertNotNull(batchUrl, nameof(batchUrl)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new BatchServiceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _batchUrl = batchUrl; + _apiVersion = options.Version; + } + + /// + /// [Protocol Method] Gets information about the specified Compute Node Extension. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// An OData $select clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetComputeNodeExtensionAsync(string poolId, string nodeId, string extensionName, string select, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNullOrEmpty(extensionName, nameof(extensionName)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeExtensionClient.GetComputeNodeExtension"); + scope.Start(); + try + { + using HttpMessage message = CreateGetComputeNodeExtensionRequest(poolId, nodeId, extensionName, select, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Compute Node Extension. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// An OData $select clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetComputeNodeExtension(string poolId, string nodeId, string extensionName, string select, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNullOrEmpty(extensionName, nameof(extensionName)); + + using var scope = ClientDiagnostics.CreateScope("ComputeNodeExtensionClient.GetComputeNodeExtension"); + scope.Start(); + try + { + using HttpMessage message = CreateGetComputeNodeExtensionRequest(poolId, nodeId, extensionName, select, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists the Compute Nodes Extensions in the specified Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains Compute Node. + /// The ID of the Compute Node that you want to list extensions. + /// 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 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetComputeNodeExtensionsAsync(string poolId, string nodeId, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetComputeNodeExtensionsRequest(poolId, nodeId, select, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetComputeNodeExtensionsNextPageRequest(nextLink, poolId, nodeId, select, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ComputeNodeExtensionClient.GetComputeNodeExtensions", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists the Compute Nodes Extensions in the specified Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains Compute Node. + /// The ID of the Compute Node that you want to list extensions. + /// 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 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetComputeNodeExtensions(string poolId, string nodeId, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetComputeNodeExtensionsRequest(poolId, nodeId, select, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetComputeNodeExtensionsNextPageRequest(nextLink, poolId, nodeId, select, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ComputeNodeExtensionClient.GetComputeNodeExtensions", "value", "odata.nextLink", context); + } + + internal HttpMessage CreateGetComputeNodeExtensionRequest(string poolId, string nodeId, string extensionName, string select, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/extensions/", false); + uri.AppendPath(extensionName, true); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetComputeNodeExtensionsRequest(string poolId, string nodeId, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/extensions", false); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetComputeNodeExtensionsNextPageRequest(string nextLink, string poolId, string nodeId, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/AccountClient.xml b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/AccountClient.xml new file mode 100644 index 000000000000..b65fb01c5008 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/AccountClient.xml @@ -0,0 +1,141 @@ + + + + + +This sample shows how to call GetSupportedImagesAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetSupportedImagesAsync("", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("osType").ToString()); + Console.WriteLine(result.GetProperty("capabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("batchSupportEndOfLife").ToString()); + Console.WriteLine(result.GetProperty("verificationType").ToString()); +} +]]> + + + + +This sample shows how to call GetSupportedImages with required parameters and parse the result. +", credential); + +foreach (var item in client.GetSupportedImages("", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("osType").ToString()); + Console.WriteLine(result.GetProperty("capabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("batchSupportEndOfLife").ToString()); + Console.WriteLine(result.GetProperty("verificationType").ToString()); +} +]]> + + + + +This sample shows how to call GetPoolNodeCountsAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetPoolNodeCountsAsync("", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("creating").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("idle").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("offline").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("preempted").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("rebooting").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("reimaging").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("starting").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("startTaskFailed").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("leavingPool").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("unknown").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("unusable").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("waitingForStartTask").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("total").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("creating").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("idle").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("offline").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("preempted").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("rebooting").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("reimaging").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("starting").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("startTaskFailed").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("leavingPool").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("unknown").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("unusable").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("waitingForStartTask").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("total").ToString()); +} +]]> + + + + +This sample shows how to call GetPoolNodeCounts with required parameters and parse the result. +", credential); + +foreach (var item in client.GetPoolNodeCounts("", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("creating").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("idle").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("offline").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("preempted").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("rebooting").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("reimaging").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("starting").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("startTaskFailed").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("leavingPool").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("unknown").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("unusable").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("waitingForStartTask").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("total").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("creating").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("idle").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("offline").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("preempted").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("rebooting").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("reimaging").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("starting").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("startTaskFailed").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("leavingPool").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("unknown").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("unusable").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("waitingForStartTask").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("total").ToString()); +} +]]> + + + + \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/ApplicationClient.xml b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/ApplicationClient.xml new file mode 100644 index 000000000000..f3555f7db706 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/ApplicationClient.xml @@ -0,0 +1,71 @@ + + + + + +This sample shows how to call GetApplicationAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetApplicationAsync("", 1234, DateTimeOffset.UtcNow, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("versions")[0].ToString()); +]]> + + + + +This sample shows how to call GetApplication with required parameters and parse the result. +", credential); + +Response response = client.GetApplication("", 1234, DateTimeOffset.UtcNow, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("versions")[0].ToString()); +]]> + + + + +This sample shows how to call GetApplicationsAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetApplicationsAsync(1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("versions")[0].ToString()); +} +]]> + + + + +This sample shows how to call GetApplications with required parameters and parse the result. +", credential); + +foreach (var item in client.GetApplications(1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("versions")[0].ToString()); +} +]]> + + + + \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/CertificateClient.xml b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/CertificateClient.xml new file mode 100644 index 000000000000..958f2e90e62e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/CertificateClient.xml @@ -0,0 +1,255 @@ + + + + + +This sample shows how to call AddAsync with required parameters and request content. +", credential); + +var data = new { + thumbprint = "", + thumbprintAlgorithm = "", + data = "", +}; + +Response response = await client.AddAsync(RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call AddAsync with all parameters and request content. +", credential); + +var data = new { + thumbprint = "", + thumbprintAlgorithm = "", + data = "", + certificateFormat = "pfx", + password = "", +}; + +Response response = await client.AddAsync(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Add with required parameters and request content. +", credential); + +var data = new { + thumbprint = "", + thumbprintAlgorithm = "", + data = "", +}; + +Response response = client.Add(RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Add with all parameters and request content. +", credential); + +var data = new { + thumbprint = "", + thumbprintAlgorithm = "", + data = "", + certificateFormat = "pfx", + password = "", +}; + +Response response = client.Add(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call CancelDeletionAsync with required parameters. +", credential); + +Response response = await client.CancelDeletionAsync("", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call CancelDeletionAsync with all parameters. +", credential); + +Response response = await client.CancelDeletionAsync("", "", 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call CancelDeletion with required parameters. +", credential); + +Response response = client.CancelDeletion("", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call CancelDeletion with all parameters. +", credential); + +Response response = client.CancelDeletion("", "", 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DeleteAsync with required parameters. +", credential); + +Response response = await client.DeleteAsync("", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteAsync with all parameters. +", credential); + +Response response = await client.DeleteAsync("", "", 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Delete with required parameters. +", credential); + +Response response = client.Delete("", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Delete with all parameters. +", credential); + +Response response = client.Delete("", "", 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetCertificateAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetCertificateAsync("", "", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("thumbprint").ToString()); +Console.WriteLine(result.GetProperty("thumbprintAlgorithm").ToString()); +Console.WriteLine(result.GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("previousState").ToString()); +Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("publicData").ToString()); +Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("values")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("values")[0].GetProperty("value").ToString()); +]]> + + + + +This sample shows how to call GetCertificatesAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetCertificatesAsync("", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("publicData").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("values")[0].GetProperty("value").ToString()); +} +]]> + + + + \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/ComputeNodeClient.xml b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/ComputeNodeClient.xml new file mode 100644 index 000000000000..f64a3ba1e499 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/ComputeNodeClient.xml @@ -0,0 +1,945 @@ + + + + + +This sample shows how to call AddUserAsync with required parameters and request content. +", credential); + +var data = new { + name = "", +}; + +Response response = await client.AddUserAsync("", "", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call AddUserAsync with all parameters and request content. +", credential); + +var data = new { + name = "", + isAdmin = true, + expiryTime = "2022-05-10T18:57:31.2311892Z", + password = "", + sshPublicKey = "", +}; + +Response response = await client.AddUserAsync("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call AddUser with required parameters and request content. +", credential); + +var data = new { + name = "", +}; + +Response response = client.AddUser("", "", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call AddUser with all parameters and request content. +", credential); + +var data = new { + name = "", + isAdmin = true, + expiryTime = "2022-05-10T18:57:31.2311892Z", + password = "", + sshPublicKey = "", +}; + +Response response = client.AddUser("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DeleteUserAsync with required parameters. +", credential); + +Response response = await client.DeleteUserAsync("", "", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteUserAsync with all parameters. +", credential); + +Response response = await client.DeleteUserAsync("", "", "", 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DeleteUser with required parameters. +", credential); + +Response response = client.DeleteUser("", "", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteUser with all parameters. +", credential); + +Response response = client.DeleteUser("", "", "", 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call UpdateUserAsync with required parameters. +", credential); + +var data = new {}; + +Response response = await client.UpdateUserAsync("", "", "", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call UpdateUserAsync with all parameters and request content. +", credential); + +var data = new { + password = "", + expiryTime = "2022-05-10T18:57:31.2311892Z", + sshPublicKey = "", +}; + +Response response = await client.UpdateUserAsync("", "", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call UpdateUser with required parameters. +", credential); + +var data = new {}; + +Response response = client.UpdateUser("", "", "", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call UpdateUser with all parameters and request content. +", credential); + +var data = new { + password = "", + expiryTime = "2022-05-10T18:57:31.2311892Z", + sshPublicKey = "", +}; + +Response response = client.UpdateUser("", "", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetComputeNodeAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetComputeNodeAsync("", "", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("schedulingState").ToString()); +Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("lastBootTime").ToString()); +Console.WriteLine(result.GetProperty("allocationTime").ToString()); +Console.WriteLine(result.GetProperty("ipAddress").ToString()); +Console.WriteLine(result.GetProperty("affinityId").ToString()); +Console.WriteLine(result.GetProperty("vmSize").ToString()); +Console.WriteLine(result.GetProperty("totalTasksRun").ToString()); +Console.WriteLine(result.GetProperty("runningTasksCount").ToString()); +Console.WriteLine(result.GetProperty("runningTaskSlotsCount").ToString()); +Console.WriteLine(result.GetProperty("totalTasksSucceeded").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskUrl").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskId").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("subtaskId").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskState").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("startTime").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("endTime").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("exitCode").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("retryCount").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("lastRetryTime").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("requeueCount").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("lastRequeueTime").ToString()); +Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("result").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("commandLine").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("waitForSuccess").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("startTime").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("endTime").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("exitCode").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("error").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("retryCount").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("lastRetryTime").ToString()); +Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("result").ToString()); +Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); +Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); +Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); +Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); +Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("errorDetails")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("errorDetails")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("isDedicated").ToString()); +Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("protocol").ToString()); +Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("publicIPAddress").ToString()); +Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("publicFQDN").ToString()); +Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("frontendPort").ToString()); +Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("backendPort").ToString()); +Console.WriteLine(result.GetProperty("nodeAgentInfo").GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("nodeAgentInfo").GetProperty("lastUpdateTime").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("publisher").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("offer").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("sku").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("exactVersion").ToString()); +]]> + + + + +This sample shows how to call RebootAsync with required parameters. +", credential); + +var data = new {}; + +Response response = await client.RebootAsync("", "", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call RebootAsync with all parameters and request content. +", credential); + +var data = new { + nodeRebootOption = "requeue", +}; + +Response response = await client.RebootAsync("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Reboot with required parameters. +", credential); + +var data = new {}; + +Response response = client.Reboot("", "", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Reboot with all parameters and request content. +", credential); + +var data = new { + nodeRebootOption = "requeue", +}; + +Response response = client.Reboot("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call ReimageAsync with required parameters. +", credential); + +var data = new {}; + +Response response = await client.ReimageAsync("", "", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call ReimageAsync with all parameters and request content. +", credential); + +var data = new { + nodeReimageOption = "requeue", +}; + +Response response = await client.ReimageAsync("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Reimage with required parameters. +", credential); + +var data = new {}; + +Response response = client.Reimage("", "", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Reimage with all parameters and request content. +", credential); + +var data = new { + nodeReimageOption = "requeue", +}; + +Response response = client.Reimage("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DisableSchedulingAsync with required parameters. +", credential); + +var data = new {}; + +Response response = await client.DisableSchedulingAsync("", "", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DisableSchedulingAsync with all parameters and request content. +", credential); + +var data = new { + nodeDisableSchedulingOption = "requeue", +}; + +Response response = await client.DisableSchedulingAsync("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DisableScheduling with required parameters. +", credential); + +var data = new {}; + +Response response = client.DisableScheduling("", "", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DisableScheduling with all parameters and request content. +", credential); + +var data = new { + nodeDisableSchedulingOption = "requeue", +}; + +Response response = client.DisableScheduling("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call EnableSchedulingAsync with required parameters. +", credential); + +Response response = await client.EnableSchedulingAsync("", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call EnableSchedulingAsync with all parameters. +", credential); + +Response response = await client.EnableSchedulingAsync("", "", 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call EnableScheduling with required parameters. +", credential); + +Response response = client.EnableScheduling("", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call EnableScheduling with all parameters. +", credential); + +Response response = client.EnableScheduling("", "", 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetRemoteLoginSettingsAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetRemoteLoginSettingsAsync("", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("remoteLoginIPAddress").ToString()); +Console.WriteLine(result.GetProperty("remoteLoginPort").ToString()); +]]> + + + + +This sample shows how to call GetRemoteLoginSettings with required parameters and parse the result. +", credential); + +Response response = client.GetRemoteLoginSettings("", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("remoteLoginIPAddress").ToString()); +Console.WriteLine(result.GetProperty("remoteLoginPort").ToString()); +]]> + + + + +This sample shows how to call GetRemoteDesktopAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetRemoteDesktopAsync("", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); +if (response.ContentStream != null) +{ + using(Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } +} +]]> + + + + +This sample shows how to call GetRemoteDesktop with required parameters and parse the result. +", credential); + +Response response = client.GetRemoteDesktop("", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); +if (response.ContentStream != null) +{ + using(Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } +} +]]> + + + + +This sample shows how to call UploadBatchServiceLogsAsync with required parameters and request content, and how to parse the result. +", credential); + +var data = new { + containerUrl = "", + startTime = "2022-05-10T18:57:31.2311892Z", +}; + +Response response = await client.UploadBatchServiceLogsAsync("", "", RequestContent.Create(data)); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("virtualDirectoryName").ToString()); +Console.WriteLine(result.GetProperty("numberOfFilesUploaded").ToString()); +]]> +This sample shows how to call UploadBatchServiceLogsAsync with all parameters and request content, and how to parse the result. +", credential); + +var data = new { + containerUrl = "", + startTime = "2022-05-10T18:57:31.2311892Z", + endTime = "2022-05-10T18:57:31.2311892Z", + identityReference = new { + resourceId = "", + }, +}; + +Response response = await client.UploadBatchServiceLogsAsync("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("virtualDirectoryName").ToString()); +Console.WriteLine(result.GetProperty("numberOfFilesUploaded").ToString()); +]]> + + + + +This sample shows how to call UploadBatchServiceLogs with required parameters and request content, and how to parse the result. +", credential); + +var data = new { + containerUrl = "", + startTime = "2022-05-10T18:57:31.2311892Z", +}; + +Response response = client.UploadBatchServiceLogs("", "", RequestContent.Create(data)); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("virtualDirectoryName").ToString()); +Console.WriteLine(result.GetProperty("numberOfFilesUploaded").ToString()); +]]> +This sample shows how to call UploadBatchServiceLogs with all parameters and request content, and how to parse the result. +", credential); + +var data = new { + containerUrl = "", + startTime = "2022-05-10T18:57:31.2311892Z", + endTime = "2022-05-10T18:57:31.2311892Z", + identityReference = new { + resourceId = "", + }, +}; + +Response response = client.UploadBatchServiceLogs("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("virtualDirectoryName").ToString()); +Console.WriteLine(result.GetProperty("numberOfFilesUploaded").ToString()); +]]> + + + + +This sample shows how to call GetComputeNodesAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetComputeNodesAsync("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("schedulingState").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("lastBootTime").ToString()); + Console.WriteLine(result.GetProperty("allocationTime").ToString()); + Console.WriteLine(result.GetProperty("ipAddress").ToString()); + Console.WriteLine(result.GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("totalTasksRun").ToString()); + Console.WriteLine(result.GetProperty("runningTasksCount").ToString()); + Console.WriteLine(result.GetProperty("runningTaskSlotsCount").ToString()); + Console.WriteLine(result.GetProperty("totalTasksSucceeded").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskUrl").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("subtaskId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskState").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("requeueCount").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("lastRequeueTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("errorDetails")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("errorDetails")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("isDedicated").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("publicIPAddress").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("publicFQDN").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("frontendPort").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("nodeAgentInfo").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("nodeAgentInfo").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("exactVersion").ToString()); +} +]]> + + + + \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/ComputeNodeExtensionClient.xml b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/ComputeNodeExtensionClient.xml new file mode 100644 index 000000000000..7e36c5882cf6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/ComputeNodeExtensionClient.xml @@ -0,0 +1,143 @@ + + + + + +This sample shows how to call GetComputeNodeExtensionAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetComputeNodeExtensionAsync("", "", "", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("provisioningState").ToString()); +Console.WriteLine(result.GetProperty("vmExtension").GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("vmExtension").GetProperty("publisher").ToString()); +Console.WriteLine(result.GetProperty("vmExtension").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("vmExtension").GetProperty("typeHandlerVersion").ToString()); +Console.WriteLine(result.GetProperty("vmExtension").GetProperty("autoUpgradeMinorVersion").ToString()); +Console.WriteLine(result.GetProperty("vmExtension").GetProperty("enableAutomaticUpgrade").ToString()); +Console.WriteLine(result.GetProperty("vmExtension").GetProperty("settings").ToString()); +Console.WriteLine(result.GetProperty("vmExtension").GetProperty("protectedSettings").ToString()); +Console.WriteLine(result.GetProperty("vmExtension").GetProperty("provisionAfterExtensions")[0].ToString()); +Console.WriteLine(result.GetProperty("instanceView").GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("displayStatus").ToString()); +Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("level").ToString()); +Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("time").ToString()); +Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("displayStatus").ToString()); +Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("level").ToString()); +Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("time").ToString()); +]]> + + + + +This sample shows how to call GetComputeNodeExtensionsAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetComputeNodeExtensionsAsync("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("provisioningState").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("displayStatus").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("level").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("time").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("displayStatus").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("level").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("time").ToString()); +} +]]> + + + + \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/FileClient.xml b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/FileClient.xml new file mode 100644 index 000000000000..c470be58772a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/FileClient.xml @@ -0,0 +1,325 @@ + + + + + +This sample shows how to call DeleteFromTaskAsync with required parameters. +", credential); + +Response response = await client.DeleteFromTaskAsync("", "", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteFromTaskAsync with all parameters. +", credential); + +Response response = await client.DeleteFromTaskAsync("", "", "", true, 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DeleteFromTask with required parameters. +", credential); + +Response response = client.DeleteFromTask("", "", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteFromTask with all parameters. +", credential); + +Response response = client.DeleteFromTask("", "", "", true, 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetFromTaskAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetFromTaskAsync("", "", "", 1234, DateTimeOffset.UtcNow, "", null, new RequestContext()); +if (response.ContentStream != null) +{ + using(Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } +} +]]> + + + + +This sample shows how to call GetFromTask with required parameters and parse the result. +", credential); + +Response response = client.GetFromTask("", "", "", 1234, DateTimeOffset.UtcNow, "", null, new RequestContext()); +if (response.ContentStream != null) +{ + using(Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } +} +]]> + + + + +This sample shows how to call GetPropertiesFromTaskAsync with required parameters. +", credential); + +Response response = await client.GetPropertiesFromTaskAsync("", "", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call GetPropertiesFromTaskAsync with all parameters. +", credential); + +Response response = await client.GetPropertiesFromTaskAsync("", "", "", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetPropertiesFromTask with required parameters. +", credential); + +Response response = client.GetPropertiesFromTask("", "", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call GetPropertiesFromTask with all parameters. +", credential); + +Response response = client.GetPropertiesFromTask("", "", "", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DeleteFromComputeNodeAsync with required parameters. +", credential); + +Response response = await client.DeleteFromComputeNodeAsync("", "", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteFromComputeNodeAsync with all parameters. +", credential); + +Response response = await client.DeleteFromComputeNodeAsync("", "", "", true, 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DeleteFromComputeNode with required parameters. +", credential); + +Response response = client.DeleteFromComputeNode("", "", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteFromComputeNode with all parameters. +", credential); + +Response response = client.DeleteFromComputeNode("", "", "", true, 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetFromComputeNodeAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetFromComputeNodeAsync("", "", "", 1234, DateTimeOffset.UtcNow, "", null, new RequestContext()); +if (response.ContentStream != null) +{ + using(Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } +} +]]> + + + + +This sample shows how to call GetFromComputeNode with required parameters and parse the result. +", credential); + +Response response = client.GetFromComputeNode("", "", "", 1234, DateTimeOffset.UtcNow, "", null, new RequestContext()); +if (response.ContentStream != null) +{ + using(Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } +} +]]> + + + + +This sample shows how to call GetPropertiesFromComputeNodeAsync with required parameters. +", credential); + +Response response = await client.GetPropertiesFromComputeNodeAsync("", "", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call GetPropertiesFromComputeNodeAsync with all parameters. +", credential); + +Response response = await client.GetPropertiesFromComputeNodeAsync("", "", "", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetPropertiesFromComputeNode with required parameters. +", credential); + +Response response = client.GetPropertiesFromComputeNode("", "", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call GetPropertiesFromComputeNode with all parameters. +", credential); + +Response response = client.GetPropertiesFromComputeNode("", "", "", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetFromTasksAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetFromTasksAsync("", "", "", true, 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("isDirectory").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentLength").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentType").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("fileMode").ToString()); +} +]]> + + + + +This sample shows how to call GetFromTasks with required parameters and parse the result. +", credential); + +foreach (var item in client.GetFromTasks("", "", "", true, 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("isDirectory").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentLength").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentType").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("fileMode").ToString()); +} +]]> + + + + +This sample shows how to call GetFromComputeNodesAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetFromComputeNodesAsync("", "", "", true, 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("isDirectory").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentLength").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentType").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("fileMode").ToString()); +} +]]> + + + + +This sample shows how to call GetFromComputeNodes with required parameters and parse the result. +", credential); + +foreach (var item in client.GetFromComputeNodes("", "", "", true, 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("isDirectory").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentLength").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentType").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("fileMode").ToString()); +} +]]> + + + + \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/JobClient.xml b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/JobClient.xml new file mode 100644 index 000000000000..79c29db31901 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/JobClient.xml @@ -0,0 +1,4059 @@ + + + + + +This sample shows how to call DeleteAsync with required parameters. +", credential); + +Response response = await client.DeleteAsync(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteAsync with all parameters. +", credential); + +Response response = await client.DeleteAsync("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Delete with required parameters. +", credential); + +Response response = client.Delete(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Delete with all parameters. +", credential); + +Response response = client.Delete("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetJobAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetJobAsync("", "", "", 1234, DateTimeOffset.UtcNow, null, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("usesTaskDependencies").ToString()); +Console.WriteLine(result.GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("eTag").ToString()); +Console.WriteLine(result.GetProperty("lastModified").ToString()); +Console.WriteLine(result.GetProperty("creationTime").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("previousState").ToString()); +Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("priority").ToString()); +Console.WriteLine(result.GetProperty("allowTaskPreemption").ToString()); +Console.WriteLine(result.GetProperty("maxParallelTasks").ToString()); +Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); +Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); +Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); +Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("poolId").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); +Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); +Console.WriteLine(result.GetProperty("onAllTasksComplete").ToString()); +Console.WriteLine(result.GetProperty("onTaskFailure").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); +Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("poolId").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("terminateReason").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); +]]> + + + + +This sample shows how to call PatchAsync with required parameters. +", credential); + +var data = new {}; + +Response response = await client.PatchAsync("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call PatchAsync with all parameters and request content. +", credential); + +var data = new { + priority = 1234, + maxParallelTasks = 1234, + allowTaskPreemption = true, + onAllTasksComplete = "noaction", + constraints = new { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + poolInfo = new { + poolId = "", + autoPoolSpecification = new { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, +}; + +Response response = await client.PatchAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Patch with required parameters. +", credential); + +var data = new {}; + +Response response = client.Patch("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Patch with all parameters and request content. +", credential); + +var data = new { + priority = 1234, + maxParallelTasks = 1234, + allowTaskPreemption = true, + onAllTasksComplete = "noaction", + constraints = new { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + poolInfo = new { + poolId = "", + autoPoolSpecification = new { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, +}; + +Response response = client.Patch("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call UpdateAsync with required parameters and request content. +", credential); + +var data = new { + poolInfo = new {}, +}; + +Response response = await client.UpdateAsync("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call UpdateAsync with all parameters and request content. +", credential); + +var data = new { + priority = 1234, + maxParallelTasks = 1234, + allowTaskPreemption = true, + constraints = new { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + poolInfo = new { + poolId = "", + autoPoolSpecification = new { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + onAllTasksComplete = "noaction", +}; + +Response response = await client.UpdateAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Update with required parameters and request content. +", credential); + +var data = new { + poolInfo = new {}, +}; + +Response response = client.Update("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Update with all parameters and request content. +", credential); + +var data = new { + priority = 1234, + maxParallelTasks = 1234, + allowTaskPreemption = true, + constraints = new { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + poolInfo = new { + poolId = "", + autoPoolSpecification = new { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + onAllTasksComplete = "noaction", +}; + +Response response = client.Update("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DisableAsync with required parameters and request content. +", credential); + +var data = new { + disableTasks = "requeue", +}; + +Response response = await client.DisableAsync("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DisableAsync with all parameters and request content. +", credential); + +var data = new { + disableTasks = "requeue", +}; + +Response response = await client.DisableAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Disable with required parameters and request content. +", credential); + +var data = new { + disableTasks = "requeue", +}; + +Response response = client.Disable("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Disable with all parameters and request content. +", credential); + +var data = new { + disableTasks = "requeue", +}; + +Response response = client.Disable("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call EnableAsync with required parameters. +", credential); + +Response response = await client.EnableAsync(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call EnableAsync with all parameters. +", credential); + +Response response = await client.EnableAsync("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Enable with required parameters. +", credential); + +Response response = client.Enable(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Enable with all parameters. +", credential); + +Response response = client.Enable("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call TerminateAsync with required parameters. +", credential); + +var data = new {}; + +Response response = await client.TerminateAsync("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call TerminateAsync with all parameters and request content. +", credential); + +var data = new { + terminateReason = "", +}; + +Response response = await client.TerminateAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Terminate with required parameters. +", credential); + +var data = new {}; + +Response response = client.Terminate("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Terminate with all parameters and request content. +", credential); + +var data = new { + terminateReason = "", +}; + +Response response = client.Terminate("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call AddAsync with required parameters and request content. +", credential); + +var data = new { + id = "", + poolInfo = new {}, +}; + +Response response = await client.AddAsync(RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call AddAsync with all parameters and request content. +", credential); + +var data = new { + id = "", + displayName = "", + priority = 1234, + maxParallelTasks = 1234, + allowTaskPreemption = true, + constraints = new { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new { + poolId = "", + autoPoolSpecification = new { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + metadata = new[] { + new { + name = "", + value = "", + } + }, + usesTaskDependencies = true, + networkConfiguration = new { + subnetId = "", + }, +}; + +Response response = await client.AddAsync(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Add with required parameters and request content. +", credential); + +var data = new { + id = "", + poolInfo = new {}, +}; + +Response response = client.Add(RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Add with all parameters and request content. +", credential); + +var data = new { + id = "", + displayName = "", + priority = 1234, + maxParallelTasks = 1234, + allowTaskPreemption = true, + constraints = new { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new { + poolId = "", + autoPoolSpecification = new { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + metadata = new[] { + new { + name = "", + value = "", + } + }, + usesTaskDependencies = true, + networkConfiguration = new { + subnetId = "", + }, +}; + +Response response = client.Add(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetTaskCountsAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetTaskCountsAsync("", 1234, DateTimeOffset.UtcNow, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("taskCounts").GetProperty("active").ToString()); +Console.WriteLine(result.GetProperty("taskCounts").GetProperty("running").ToString()); +Console.WriteLine(result.GetProperty("taskCounts").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("taskCounts").GetProperty("succeeded").ToString()); +Console.WriteLine(result.GetProperty("taskCounts").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("active").ToString()); +Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("running").ToString()); +Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("succeeded").ToString()); +Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("failed").ToString()); +]]> + + + + +This sample shows how to call GetTaskCounts with required parameters and parse the result. +", credential); + +Response response = client.GetTaskCounts("", 1234, DateTimeOffset.UtcNow, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("taskCounts").GetProperty("active").ToString()); +Console.WriteLine(result.GetProperty("taskCounts").GetProperty("running").ToString()); +Console.WriteLine(result.GetProperty("taskCounts").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("taskCounts").GetProperty("succeeded").ToString()); +Console.WriteLine(result.GetProperty("taskCounts").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("active").ToString()); +Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("running").ToString()); +Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("succeeded").ToString()); +Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("failed").ToString()); +]]> + + + + +This sample shows how to call GetJobsAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetJobsAsync("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("terminateReason").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); +} +]]> + + + + +This sample shows how to call GetFromJobSchedulesAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetFromJobSchedulesAsync("", "", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("terminateReason").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); +} +]]> + + + + +This sample shows how to call GetPreparationAndReleaseTaskStatusesAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetPreparationAndReleaseTaskStatusesAsync("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("nodeId").ToString()); + Console.WriteLine(result.GetProperty("nodeUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("result").ToString()); +} +]]> + + + + \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/JobScheduleClient.xml b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/JobScheduleClient.xml new file mode 100644 index 000000000000..cd0313f13e82 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/JobScheduleClient.xml @@ -0,0 +1,4269 @@ + + + + + +This sample shows how to call ExistsAsync with required parameters. +", credential); + +Response response = await client.ExistsAsync(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call ExistsAsync with all parameters. +", credential); + +Response response = await client.ExistsAsync("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Exists with required parameters. +", credential); + +Response response = client.Exists(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Exists with all parameters. +", credential); + +Response response = client.Exists("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DeleteAsync with required parameters. +", credential); + +Response response = await client.DeleteAsync(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteAsync with all parameters. +", credential); + +Response response = await client.DeleteAsync("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Delete with required parameters. +", credential); + +Response response = client.Delete(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Delete with all parameters. +", credential); + +Response response = client.Delete("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetJobScheduleAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetJobScheduleAsync("", "", "", 1234, DateTimeOffset.UtcNow, null, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("eTag").ToString()); +Console.WriteLine(result.GetProperty("lastModified").ToString()); +Console.WriteLine(result.GetProperty("creationTime").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("previousState").ToString()); +Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("schedule").GetProperty("doNotRunUntil").ToString()); +Console.WriteLine(result.GetProperty("schedule").GetProperty("doNotRunAfter").ToString()); +Console.WriteLine(result.GetProperty("schedule").GetProperty("startWindow").ToString()); +Console.WriteLine(result.GetProperty("schedule").GetProperty("recurrenceInterval").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("priority").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("allowTaskPreemption").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("maxParallelTasks").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("usesTaskDependencies").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("onAllTasksComplete").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("onTaskFailure").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("poolId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("metadata")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("metadata")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("nextRunTime").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("recentJob").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("recentJob").GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); +Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); +]]> + + + + +This sample shows how to call PatchAsync with required parameters. +", credential); + +var data = new {}; + +Response response = await client.PatchAsync("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call PatchAsync with all parameters and request content. +", credential); + +var data = new { + schedule = new { + doNotRunUntil = "2022-05-10T18:57:31.2311892Z", + doNotRunAfter = "2022-05-10T18:57:31.2311892Z", + startWindow = "PT1H23M45S", + recurrenceInterval = "PT1H23M45S", + }, + jobSpecification = new { + priority = 1234, + allowTaskPreemption = true, + maxParallelTasks = 1234, + displayName = "", + usesTaskDependencies = true, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + networkConfiguration = new { + subnetId = "", + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new { + poolId = "", + autoPoolSpecification = new { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, +}; + +Response response = await client.PatchAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Patch with required parameters. +", credential); + +var data = new {}; + +Response response = client.Patch("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Patch with all parameters and request content. +", credential); + +var data = new { + schedule = new { + doNotRunUntil = "2022-05-10T18:57:31.2311892Z", + doNotRunAfter = "2022-05-10T18:57:31.2311892Z", + startWindow = "PT1H23M45S", + recurrenceInterval = "PT1H23M45S", + }, + jobSpecification = new { + priority = 1234, + allowTaskPreemption = true, + maxParallelTasks = 1234, + displayName = "", + usesTaskDependencies = true, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + networkConfiguration = new { + subnetId = "", + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new { + poolId = "", + autoPoolSpecification = new { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, +}; + +Response response = client.Patch("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call UpdateAsync with required parameters and request content. +", credential); + +var data = new { + schedule = new {}, + jobSpecification = new { + poolInfo = new {}, + }, +}; + +Response response = await client.UpdateAsync("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call UpdateAsync with all parameters and request content. +", credential); + +var data = new { + schedule = new { + doNotRunUntil = "2022-05-10T18:57:31.2311892Z", + doNotRunAfter = "2022-05-10T18:57:31.2311892Z", + startWindow = "PT1H23M45S", + recurrenceInterval = "PT1H23M45S", + }, + jobSpecification = new { + priority = 1234, + allowTaskPreemption = true, + maxParallelTasks = 1234, + displayName = "", + usesTaskDependencies = true, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + networkConfiguration = new { + subnetId = "", + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new { + poolId = "", + autoPoolSpecification = new { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, +}; + +Response response = await client.UpdateAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Update with required parameters and request content. +", credential); + +var data = new { + schedule = new {}, + jobSpecification = new { + poolInfo = new {}, + }, +}; + +Response response = client.Update("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Update with all parameters and request content. +", credential); + +var data = new { + schedule = new { + doNotRunUntil = "2022-05-10T18:57:31.2311892Z", + doNotRunAfter = "2022-05-10T18:57:31.2311892Z", + startWindow = "PT1H23M45S", + recurrenceInterval = "PT1H23M45S", + }, + jobSpecification = new { + priority = 1234, + allowTaskPreemption = true, + maxParallelTasks = 1234, + displayName = "", + usesTaskDependencies = true, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + networkConfiguration = new { + subnetId = "", + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new { + poolId = "", + autoPoolSpecification = new { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, +}; + +Response response = client.Update("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DisableAsync with required parameters. +", credential); + +Response response = await client.DisableAsync(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DisableAsync with all parameters. +", credential); + +Response response = await client.DisableAsync("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Disable with required parameters. +", credential); + +Response response = client.Disable(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Disable with all parameters. +", credential); + +Response response = client.Disable("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call EnableAsync with required parameters. +", credential); + +Response response = await client.EnableAsync(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call EnableAsync with all parameters. +", credential); + +Response response = await client.EnableAsync("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Enable with required parameters. +", credential); + +Response response = client.Enable(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Enable with all parameters. +", credential); + +Response response = client.Enable("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call TerminateAsync with required parameters. +", credential); + +Response response = await client.TerminateAsync(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call TerminateAsync with all parameters. +", credential); + +Response response = await client.TerminateAsync("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Terminate with required parameters. +", credential); + +Response response = client.Terminate(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Terminate with all parameters. +", credential); + +Response response = client.Terminate("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call AddAsync with required parameters and request content. +", credential); + +var data = new { + id = "", + schedule = new {}, + jobSpecification = new { + poolInfo = new {}, + }, +}; + +Response response = await client.AddAsync(RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call AddAsync with all parameters and request content. +", credential); + +var data = new { + id = "", + displayName = "", + schedule = new { + doNotRunUntil = "2022-05-10T18:57:31.2311892Z", + doNotRunAfter = "2022-05-10T18:57:31.2311892Z", + startWindow = "PT1H23M45S", + recurrenceInterval = "PT1H23M45S", + }, + jobSpecification = new { + priority = 1234, + allowTaskPreemption = true, + maxParallelTasks = 1234, + displayName = "", + usesTaskDependencies = true, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + networkConfiguration = new { + subnetId = "", + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new { + poolId = "", + autoPoolSpecification = new { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, +}; + +Response response = await client.AddAsync(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Add with required parameters and request content. +", credential); + +var data = new { + id = "", + schedule = new {}, + jobSpecification = new { + poolInfo = new {}, + }, +}; + +Response response = client.Add(RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Add with all parameters and request content. +", credential); + +var data = new { + id = "", + displayName = "", + schedule = new { + doNotRunUntil = "2022-05-10T18:57:31.2311892Z", + doNotRunAfter = "2022-05-10T18:57:31.2311892Z", + startWindow = "PT1H23M45S", + recurrenceInterval = "PT1H23M45S", + }, + jobSpecification = new { + priority = 1234, + allowTaskPreemption = true, + maxParallelTasks = 1234, + displayName = "", + usesTaskDependencies = true, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + networkConfiguration = new { + subnetId = "", + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new { + id = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new { + poolId = "", + autoPoolSpecification = new { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, +}; + +Response response = client.Add(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetJobSchedulesAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetJobSchedulesAsync("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("doNotRunUntil").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("doNotRunAfter").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("startWindow").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("recurrenceInterval").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("nextRunTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("recentJob").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("recentJob").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); +} +]]> + + + + \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/PoolClient.xml b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/PoolClient.xml new file mode 100644 index 000000000000..4c56386d64a4 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/PoolClient.xml @@ -0,0 +1,2099 @@ + + + + + +This sample shows how to call AddAsync with required parameters and request content. +", credential); + +var data = new { + id = "", + vmSize = "", +}; + +Response response = await client.AddAsync(RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call AddAsync with all parameters and request content. +", credential); + +var data = new { + id = "", + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", +}; + +Response response = await client.AddAsync(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Add with required parameters and request content. +", credential); + +var data = new { + id = "", + vmSize = "", +}; + +Response response = client.Add(RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Add with all parameters and request content. +", credential); + +var data = new { + id = "", + displayName = "", + vmSize = "", + cloudServiceConfiguration = new { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new { + imageReference = new { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new { + ephemeralOSDiskSettings = new { + placement = "CacheDisk", + }, + }, + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new { + nodeFillType = "spread", + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", +}; + +Response response = client.Add(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DeleteAsync with required parameters. +", credential); + +Response response = await client.DeleteAsync(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteAsync with all parameters. +", credential); + +Response response = await client.DeleteAsync("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Delete with required parameters. +", credential); + +Response response = client.Delete(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Delete with all parameters. +", credential); + +Response response = client.Delete("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call ExistsAsync with required parameters. +", credential); + +Response response = await client.ExistsAsync(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call ExistsAsync with all parameters. +", credential); + +Response response = await client.ExistsAsync("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Exists with required parameters. +", credential); + +Response response = client.Exists(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Exists with all parameters. +", credential); + +Response response = client.Exists("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetPoolAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetPoolAsync("", "", "", 1234, DateTimeOffset.UtcNow, null, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("eTag").ToString()); +Console.WriteLine(result.GetProperty("lastModified").ToString()); +Console.WriteLine(result.GetProperty("creationTime").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("allocationState").ToString()); +Console.WriteLine(result.GetProperty("allocationStateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("vmSize").ToString()); +Console.WriteLine(result.GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); +Console.WriteLine(result.GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); +Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); +Console.WriteLine(result.GetProperty("resizeTimeout").ToString()); +Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("values")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("values")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("currentDedicatedNodes").ToString()); +Console.WriteLine(result.GetProperty("currentLowPriorityNodes").ToString()); +Console.WriteLine(result.GetProperty("targetDedicatedNodes").ToString()); +Console.WriteLine(result.GetProperty("targetLowPriorityNodes").ToString()); +Console.WriteLine(result.GetProperty("enableAutoScale").ToString()); +Console.WriteLine(result.GetProperty("autoScaleFormula").ToString()); +Console.WriteLine(result.GetProperty("autoScaleEvaluationInterval").ToString()); +Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("timestamp").ToString()); +Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("results").ToString()); +Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("values")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("enableInterNodeCommunication").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); +Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("commandLine").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); +Console.WriteLine(result.GetProperty("startTask").GetProperty("waitForSuccess").ToString()); +Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); +Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); +Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); +Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); +Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); +Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); +Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("applicationLicenses")[0].ToString()); +Console.WriteLine(result.GetProperty("taskSlotsPerNode").ToString()); +Console.WriteLine(result.GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); +Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); +Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); +Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); +Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); +Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("startTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("lastUpdateTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("dedicatedCoreTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("startTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("lastUpdateTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgCPUPercentage").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgMemoryGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("peakMemoryGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgDiskGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("peakDiskGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskReadIOps").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskWriteIOps").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskReadGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskWriteGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("networkReadGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("networkWriteGiB").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); +Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); +Console.WriteLine(result.GetProperty("identity").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("clientId").ToString()); +Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("principalId").ToString()); +Console.WriteLine(result.GetProperty("targetNodeCommunicationMode").ToString()); +Console.WriteLine(result.GetProperty("currentNodeCommunicationMode").ToString()); +]]> + + + + +This sample shows how to call PatchAsync with required parameters. +", credential); + +var data = new {}; + +Response response = await client.PatchAsync("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call PatchAsync with all parameters and request content. +", credential); + +var data = new { + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + targetNodeCommunicationMode = "default", +}; + +Response response = await client.PatchAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Patch with required parameters. +", credential); + +var data = new {}; + +Response response = client.Patch("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Patch with all parameters and request content. +", credential); + +var data = new { + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + targetNodeCommunicationMode = "default", +}; + +Response response = client.Patch("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DisableAutoScaleAsync with required parameters. +", credential); + +Response response = await client.DisableAutoScaleAsync(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DisableAutoScaleAsync with all parameters. +", credential); + +Response response = await client.DisableAutoScaleAsync("", 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call DisableAutoScale with required parameters. +", credential); + +Response response = client.DisableAutoScale(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DisableAutoScale with all parameters. +", credential); + +Response response = client.DisableAutoScale("", 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call EnableAutoScaleAsync with required parameters. +", credential); + +var data = new {}; + +Response response = await client.EnableAutoScaleAsync("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call EnableAutoScaleAsync with all parameters and request content. +", credential); + +var data = new { + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", +}; + +Response response = await client.EnableAutoScaleAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call EnableAutoScale with required parameters. +", credential); + +var data = new {}; + +Response response = client.EnableAutoScale("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call EnableAutoScale with all parameters and request content. +", credential); + +var data = new { + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", +}; + +Response response = client.EnableAutoScale("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call EvaluateAutoScaleAsync with required parameters and request content, and how to parse the result. +", credential); + +var data = new { + autoScaleFormula = "", +}; + +Response response = await client.EvaluateAutoScaleAsync("", RequestContent.Create(data)); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("timestamp").ToString()); +]]> +This sample shows how to call EvaluateAutoScaleAsync with all parameters and request content, and how to parse the result. +", credential); + +var data = new { + autoScaleFormula = "", +}; + +Response response = await client.EvaluateAutoScaleAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("timestamp").ToString()); +Console.WriteLine(result.GetProperty("results").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("values")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); +]]> + + + + +This sample shows how to call EvaluateAutoScale with required parameters and request content, and how to parse the result. +", credential); + +var data = new { + autoScaleFormula = "", +}; + +Response response = client.EvaluateAutoScale("", RequestContent.Create(data)); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("timestamp").ToString()); +]]> +This sample shows how to call EvaluateAutoScale with all parameters and request content, and how to parse the result. +", credential); + +var data = new { + autoScaleFormula = "", +}; + +Response response = client.EvaluateAutoScale("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("timestamp").ToString()); +Console.WriteLine(result.GetProperty("results").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("values")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); +]]> + + + + +This sample shows how to call ResizeAsync with required parameters. +", credential); + +var data = new {}; + +Response response = await client.ResizeAsync("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call ResizeAsync with all parameters and request content. +", credential); + +var data = new { + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + resizeTimeout = "PT1H23M45S", + nodeDeallocationOption = "requeue", +}; + +Response response = await client.ResizeAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Resize with required parameters. +", credential); + +var data = new {}; + +Response response = client.Resize("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Resize with all parameters and request content. +", credential); + +var data = new { + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + resizeTimeout = "PT1H23M45S", + nodeDeallocationOption = "requeue", +}; + +Response response = client.Resize("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call StopResizeAsync with required parameters. +", credential); + +Response response = await client.StopResizeAsync(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call StopResizeAsync with all parameters. +", credential); + +Response response = await client.StopResizeAsync("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call StopResize with required parameters. +", credential); + +Response response = client.StopResize(""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call StopResize with all parameters. +", credential); + +Response response = client.StopResize("", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call UpdatePropertiesAsync with required parameters and request content. +", credential); + +var data = new { + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, +}; + +Response response = await client.UpdatePropertiesAsync("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call UpdatePropertiesAsync with all parameters and request content. +", credential); + +var data = new { + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + targetNodeCommunicationMode = "default", +}; + +Response response = await client.UpdatePropertiesAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call UpdateProperties with required parameters and request content. +", credential); + +var data = new { + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, +}; + +Response response = client.UpdateProperties("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call UpdateProperties with all parameters and request content. +", credential); + +var data = new { + startTask = new { + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + targetNodeCommunicationMode = "default", +}; + +Response response = client.UpdateProperties("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call RemoveNodesAsync with required parameters and request content. +", credential); + +var data = new { + nodeList = new[] { + "" + }, +}; + +Response response = await client.RemoveNodesAsync("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call RemoveNodesAsync with all parameters and request content. +", credential); + +var data = new { + nodeList = new[] { + "" + }, + resizeTimeout = "PT1H23M45S", + nodeDeallocationOption = "requeue", +}; + +Response response = await client.RemoveNodesAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call RemoveNodes with required parameters and request content. +", credential); + +var data = new { + nodeList = new[] { + "" + }, +}; + +Response response = client.RemoveNodes("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call RemoveNodes with all parameters and request content. +", credential); + +var data = new { + nodeList = new[] { + "" + }, + resizeTimeout = "PT1H23M45S", + nodeDeallocationOption = "requeue", +}; + +Response response = client.RemoveNodes("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetUsageMetricsAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetUsageMetricsAsync(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow, "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("totalCoreHours").ToString()); +} +]]> + + + + +This sample shows how to call GetUsageMetrics with required parameters and parse the result. +", credential); + +foreach (var item in client.GetUsageMetrics(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow, "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("totalCoreHours").ToString()); +} +]]> + + + + +This sample shows how to call GetPoolsAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetPoolsAsync("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("allocationState").ToString()); + Console.WriteLine(result.GetProperty("allocationStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("values")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("currentDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("currentLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("timestamp").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("results").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("dedicatedCoreTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgCPUPercentage").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgMemoryGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("peakMemoryGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgDiskGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("peakDiskGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskReadIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskWriteIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskReadGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskWriteGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("networkReadGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("networkWriteGiB").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("clientId").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("principalId").ToString()); + Console.WriteLine(result.GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("currentNodeCommunicationMode").ToString()); +} +]]> + + + + \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/TaskClient.xml b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/TaskClient.xml new file mode 100644 index 000000000000..35170f1885aa --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Docs/TaskClient.xml @@ -0,0 +1,1461 @@ + + + + + +This sample shows how to call AddAsync with required parameters and request content. +", credential); + +var data = new { + id = "", + commandLine = "", +}; + +Response response = await client.AddAsync("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call AddAsync with all parameters and request content. +", credential); + +var data = new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + exitConditions = new { + exitCodes = new[] { + new { + code = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + exitCodeRanges = new[] { + new { + start = 1234, + end = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + preProcessingError = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + fileUploadError = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + @default = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + affinityInfo = new { + affinityId = "", + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + multiInstanceSettings = new { + numberOfInstances = 1234, + coordinationCommandLine = "", + commonResourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + dependsOn = new { + taskIds = new[] { + "" + }, + taskIdRanges = new[] { + new { + start = 1234, + end = 1234, + } + }, + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, +}; + +Response response = await client.AddAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Add with required parameters and request content. +", credential); + +var data = new { + id = "", + commandLine = "", +}; + +Response response = client.Add("", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Add with all parameters and request content. +", credential); + +var data = new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + exitConditions = new { + exitCodes = new[] { + new { + code = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + exitCodeRanges = new[] { + new { + start = 1234, + end = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + preProcessingError = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + fileUploadError = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + @default = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + affinityInfo = new { + affinityId = "", + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + multiInstanceSettings = new { + numberOfInstances = 1234, + coordinationCommandLine = "", + commonResourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + dependsOn = new { + taskIds = new[] { + "" + }, + taskIdRanges = new[] { + new { + start = 1234, + end = 1234, + } + }, + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, +}; + +Response response = client.Add("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call AddCollectionAsync with required parameters and request content, and how to parse the result. +", credential); + +var data = new { + value = new[] { + new { + id = "", + commandLine = "", + } + }, +}; + +Response response = await client.AddCollectionAsync("", RequestContent.Create(data)); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call AddCollectionAsync with all parameters and request content, and how to parse the result. +", credential); + +var data = new { + value = new[] { + new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + exitConditions = new { + exitCodes = new[] { + new { + code = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + exitCodeRanges = new[] { + new { + start = 1234, + end = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + preProcessingError = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + fileUploadError = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + @default = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + affinityInfo = new { + affinityId = "", + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + multiInstanceSettings = new { + numberOfInstances = 1234, + coordinationCommandLine = "", + commonResourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + dependsOn = new { + taskIds = new[] { + "" + }, + taskIdRanges = new[] { + new { + start = 1234, + end = 1234, + } + }, + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, + } + }, +}; + +Response response = await client.AddCollectionAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("taskId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("eTag").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("lastModified").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("location").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("message").GetProperty("lang").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("message").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("values")[0].GetProperty("key").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); +]]> + + + + +This sample shows how to call AddCollection with required parameters and request content, and how to parse the result. +", credential); + +var data = new { + value = new[] { + new { + id = "", + commandLine = "", + } + }, +}; + +Response response = client.AddCollection("", RequestContent.Create(data)); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call AddCollection with all parameters and request content, and how to parse the result. +", credential); + +var data = new { + value = new[] { + new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + exitConditions = new { + exitCodes = new[] { + new { + code = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + exitCodeRanges = new[] { + new { + start = 1234, + end = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + preProcessingError = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + fileUploadError = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + @default = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + affinityInfo = new { + affinityId = "", + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + multiInstanceSettings = new { + numberOfInstances = 1234, + coordinationCommandLine = "", + commonResourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + dependsOn = new { + taskIds = new[] { + "" + }, + taskIdRanges = new[] { + new { + start = 1234, + end = 1234, + } + }, + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, + } + }, +}; + +Response response = client.AddCollection("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("taskId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("eTag").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("lastModified").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("location").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("message").GetProperty("lang").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("message").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("values")[0].GetProperty("key").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); +]]> + + + + +This sample shows how to call DeleteAsync with required parameters. +", credential); + +Response response = await client.DeleteAsync("", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteAsync with all parameters. +", credential); + +Response response = await client.DeleteAsync("", "", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Delete with required parameters. +", credential); + +Response response = client.Delete("", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Delete with all parameters. +", credential); + +Response response = client.Delete("", "", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetTaskAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetTaskAsync("", "", "", "", 1234, DateTimeOffset.UtcNow, null, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("eTag").ToString()); +Console.WriteLine(result.GetProperty("lastModified").ToString()); +Console.WriteLine(result.GetProperty("creationTime").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("exitOptions").GetProperty("jobAction").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("exitOptions").GetProperty("dependencyAction").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("exitOptions").GetProperty("jobAction").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("exitOptions").GetProperty("dependencyAction").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("preProcessingError").GetProperty("jobAction").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("preProcessingError").GetProperty("dependencyAction").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("fileUploadError").GetProperty("jobAction").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("fileUploadError").GetProperty("dependencyAction").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("default").GetProperty("jobAction").ToString()); +Console.WriteLine(result.GetProperty("exitConditions").GetProperty("default").GetProperty("dependencyAction").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("previousState").ToString()); +Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("commandLine").ToString()); +Console.WriteLine(result.GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); +Console.WriteLine(result.GetProperty("containerSettings").GetProperty("imageName").ToString()); +Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); +Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); +Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); +Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); +Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); +Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); +Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); +Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); +Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); +Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); +Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); +Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); +Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); +Console.WriteLine(result.GetProperty("environmentSettings")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("environmentSettings")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("affinityInfo").GetProperty("affinityId").ToString()); +Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); +Console.WriteLine(result.GetProperty("constraints").GetProperty("retentionTime").ToString()); +Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); +Console.WriteLine(result.GetProperty("requiredSlots").ToString()); +Console.WriteLine(result.GetProperty("userIdentity").GetProperty("username").ToString()); +Console.WriteLine(result.GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); +Console.WriteLine(result.GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("exitCode").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("retryCount").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("lastRetryTime").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("requeueCount").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("lastRequeueTime").ToString()); +Console.WriteLine(result.GetProperty("executionInfo").GetProperty("result").ToString()); +Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("affinityId").ToString()); +Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("nodeUrl").ToString()); +Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("poolId").ToString()); +Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("nodeId").ToString()); +Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("taskRootDirectory").ToString()); +Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("taskRootDirectoryUrl").ToString()); +Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("numberOfInstances").ToString()); +Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("coordinationCommandLine").ToString()); +Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); +Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("storageContainerUrl").ToString()); +Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("httpUrl").ToString()); +Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("blobPrefix").ToString()); +Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("filePath").ToString()); +Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("fileMode").ToString()); +Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); +Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); +Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIds")[0].ToString()); +Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIdRanges")[0].GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIdRanges")[0].GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); +Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); +]]> + + + + +This sample shows how to call UpdateAsync with required parameters. +", credential); + +var data = new {}; + +Response response = await client.UpdateAsync("", "", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call UpdateAsync with all parameters and request content. +", credential); + +var data = new { + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, +}; + +Response response = await client.UpdateAsync("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Update with required parameters. +", credential); + +var data = new {}; + +Response response = client.Update("", "", RequestContent.Create(data)); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Update with all parameters and request content. +", credential); + +var data = new { + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, +}; + +Response response = client.Update("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetSubtasksAsync with required parameters and parse the result. +", credential); + +Response response = await client.GetSubtasksAsync("", "", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("affinityId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("nodeUrl").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("poolId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("nodeId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("taskRootDirectory").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("taskRootDirectoryUrl").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("startTime").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("endTime").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("exitCode").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("containerInfo").GetProperty("containerId").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("containerInfo").GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("containerInfo").GetProperty("error").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("stateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("previousState").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("previousStateTransitionTime").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("result").ToString()); +]]> + + + + +This sample shows how to call TerminateAsync with required parameters. +", credential); + +Response response = await client.TerminateAsync("", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call TerminateAsync with all parameters. +", credential); + +Response response = await client.TerminateAsync("", "", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Terminate with required parameters. +", credential); + +Response response = client.Terminate("", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Terminate with all parameters. +", credential); + +Response response = client.Terminate("", "", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call ReactivateAsync with required parameters. +", credential); + +Response response = await client.ReactivateAsync("", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call ReactivateAsync with all parameters. +", credential); + +Response response = await client.ReactivateAsync("", "", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call Reactivate with required parameters. +", credential); + +Response response = client.Reactivate("", ""); +Console.WriteLine(response.Status); +]]> +This sample shows how to call Reactivate with all parameters. +", credential); + +Response response = client.Reactivate("", "", 1234, DateTimeOffset.UtcNow, null); +Console.WriteLine(response.Status); +]]> + + + + +This sample shows how to call GetTasksAsync with required parameters and parse the result. +", credential); + +await foreach (var item in client.GetTasksAsync("", "", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("exitOptions").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("exitOptions").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("exitOptions").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("exitOptions").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("preProcessingError").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("preProcessingError").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("fileUploadError").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("fileUploadError").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("default").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("default").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("affinityInfo").GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("requeueCount").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("lastRequeueTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("nodeUrl").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("nodeId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("numberOfInstances").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("coordinationCommandLine").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIds")[0].ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIdRanges")[0].GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIdRanges")[0].GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); +} +]]> + + + + \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/FileClient.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/FileClient.cs new file mode 100644 index 000000000000..199b79dd16e0 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/FileClient.cs @@ -0,0 +1,1055 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Temp.Batch +{ + // Data plane generated client. + /// The File service client. + public partial class FileClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://batch.core.windows.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly string _batchUrl; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of FileClient for mocking. + protected FileClient() + { + } + + /// Initializes a new instance of FileClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public FileClient(string batchUrl, TokenCredential credential) : this(batchUrl, credential, new BatchServiceClientOptions()) + { + } + + /// Initializes a new instance of FileClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public FileClient(string batchUrl, TokenCredential credential, BatchServiceClientOptions options) + { + Argument.AssertNotNull(batchUrl, nameof(batchUrl)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new BatchServiceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _batchUrl = batchUrl; + _apiVersion = options.Version; + } + + /// + /// [Protocol Method] Deletes the specified Task file from the Compute Node where the Task ran. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job that contains the Task. + /// The ID of the Task whose file you want to delete. + /// The path to the Task file or directory that you want to delete. + /// Whether to delete children of a directory. If the filePath parameter represents a directory instead of a file, you can set recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false then the directory must be empty or deletion will fail. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteFromTaskAsync(string jobId, string taskId, string filePath, bool? recursive = null, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + Argument.AssertNotNullOrEmpty(filePath, nameof(filePath)); + + using var scope = ClientDiagnostics.CreateScope("FileClient.DeleteFromTask"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteFromTaskRequest(jobId, taskId, filePath, recursive, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes the specified Task file from the Compute Node where the Task ran. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job that contains the Task. + /// The ID of the Task whose file you want to delete. + /// The path to the Task file or directory that you want to delete. + /// Whether to delete children of a directory. If the filePath parameter represents a directory instead of a file, you can set recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false then the directory must be empty or deletion will fail. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteFromTask(string jobId, string taskId, string filePath, bool? recursive = null, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + Argument.AssertNotNullOrEmpty(filePath, nameof(filePath)); + + using var scope = ClientDiagnostics.CreateScope("FileClient.DeleteFromTask"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteFromTaskRequest(jobId, taskId, filePath, recursive, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Returns the content of the specified Task file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job that contains the Task. + /// The ID of the Task whose file you want to retrieve. + /// The path to the Task file that you want to get the content of. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The byte range to be retrieved. The default is to retrieve the entire file. The format is bytes=startRange-endRange. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetFromTaskAsync(string jobId, string taskId, string filePath, int? timeout, DateTimeOffset? ocpDate, string ocpRange, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + Argument.AssertNotNullOrEmpty(filePath, nameof(filePath)); + + Argument.AssertNull(requestConditions.IfMatch, nameof(requestConditions), "Service does not support the If-Match header for this operation."); + Argument.AssertNull(requestConditions.IfNoneMatch, nameof(requestConditions), "Service does not support the If-None-Match header for this operation."); + + using var scope = ClientDiagnostics.CreateScope("FileClient.GetFromTask"); + scope.Start(); + try + { + using HttpMessage message = CreateGetFromTaskRequest(jobId, taskId, filePath, timeout, ocpDate, ocpRange, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Returns the content of the specified Task file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job that contains the Task. + /// The ID of the Task whose file you want to retrieve. + /// The path to the Task file that you want to get the content of. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The byte range to be retrieved. The default is to retrieve the entire file. The format is bytes=startRange-endRange. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetFromTask(string jobId, string taskId, string filePath, int? timeout, DateTimeOffset? ocpDate, string ocpRange, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + Argument.AssertNotNullOrEmpty(filePath, nameof(filePath)); + + Argument.AssertNull(requestConditions.IfMatch, nameof(requestConditions), "Service does not support the If-Match header for this operation."); + Argument.AssertNull(requestConditions.IfNoneMatch, nameof(requestConditions), "Service does not support the If-None-Match header for this operation."); + + using var scope = ClientDiagnostics.CreateScope("FileClient.GetFromTask"); + scope.Start(); + try + { + using HttpMessage message = CreateGetFromTaskRequest(jobId, taskId, filePath, timeout, ocpDate, ocpRange, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the properties of the specified Task file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job that contains the Task. + /// The ID of the Task whose file you want to get the properties of. + /// The path to the Task file that you want to get the properties of. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetPropertiesFromTaskAsync(string jobId, string taskId, string filePath, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + Argument.AssertNotNullOrEmpty(filePath, nameof(filePath)); + + Argument.AssertNull(requestConditions.IfMatch, nameof(requestConditions), "Service does not support the If-Match header for this operation."); + Argument.AssertNull(requestConditions.IfNoneMatch, nameof(requestConditions), "Service does not support the If-None-Match header for this operation."); + + using var scope = ClientDiagnostics.CreateScope("FileClient.GetPropertiesFromTask"); + scope.Start(); + try + { + using HttpMessage message = CreateGetPropertiesFromTaskRequest(jobId, taskId, filePath, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the properties of the specified Task file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job that contains the Task. + /// The ID of the Task whose file you want to get the properties of. + /// The path to the Task file that you want to get the properties of. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetPropertiesFromTask(string jobId, string taskId, string filePath, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + Argument.AssertNotNullOrEmpty(filePath, nameof(filePath)); + + Argument.AssertNull(requestConditions.IfMatch, nameof(requestConditions), "Service does not support the If-Match header for this operation."); + Argument.AssertNull(requestConditions.IfNoneMatch, nameof(requestConditions), "Service does not support the If-None-Match header for this operation."); + + using var scope = ClientDiagnostics.CreateScope("FileClient.GetPropertiesFromTask"); + scope.Start(); + try + { + using HttpMessage message = CreateGetPropertiesFromTaskRequest(jobId, taskId, filePath, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes the specified file from the Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node from which you want to delete the file. + /// The path to the file or directory that you want to delete. + /// Whether to delete children of a directory. If the filePath parameter represents a directory instead of a file, you can set recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false then the directory must be empty or deletion will fail. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteFromComputeNodeAsync(string poolId, string nodeId, string filePath, bool? recursive = null, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNullOrEmpty(filePath, nameof(filePath)); + + using var scope = ClientDiagnostics.CreateScope("FileClient.DeleteFromComputeNode"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteFromComputeNodeRequest(poolId, nodeId, filePath, recursive, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes the specified file from the Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node from which you want to delete the file. + /// The path to the file or directory that you want to delete. + /// Whether to delete children of a directory. If the filePath parameter represents a directory instead of a file, you can set recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false then the directory must be empty or deletion will fail. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteFromComputeNode(string poolId, string nodeId, string filePath, bool? recursive = null, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNullOrEmpty(filePath, nameof(filePath)); + + using var scope = ClientDiagnostics.CreateScope("FileClient.DeleteFromComputeNode"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteFromComputeNodeRequest(poolId, nodeId, filePath, recursive, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Returns the content of the specified Compute Node file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that contains the file. + /// The path to the Compute Node file that you want to get the content of. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The byte range to be retrieved. The default is to retrieve the entire file. The format is bytes=startRange-endRange. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetFromComputeNodeAsync(string poolId, string nodeId, string filePath, int? timeout, DateTimeOffset? ocpDate, string ocpRange, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNullOrEmpty(filePath, nameof(filePath)); + + Argument.AssertNull(requestConditions.IfMatch, nameof(requestConditions), "Service does not support the If-Match header for this operation."); + Argument.AssertNull(requestConditions.IfNoneMatch, nameof(requestConditions), "Service does not support the If-None-Match header for this operation."); + + using var scope = ClientDiagnostics.CreateScope("FileClient.GetFromComputeNode"); + scope.Start(); + try + { + using HttpMessage message = CreateGetFromComputeNodeRequest(poolId, nodeId, filePath, timeout, ocpDate, ocpRange, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Returns the content of the specified Compute Node file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that contains the file. + /// The path to the Compute Node file that you want to get the content of. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The byte range to be retrieved. The default is to retrieve the entire file. The format is bytes=startRange-endRange. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetFromComputeNode(string poolId, string nodeId, string filePath, int? timeout, DateTimeOffset? ocpDate, string ocpRange, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNullOrEmpty(filePath, nameof(filePath)); + + Argument.AssertNull(requestConditions.IfMatch, nameof(requestConditions), "Service does not support the If-Match header for this operation."); + Argument.AssertNull(requestConditions.IfNoneMatch, nameof(requestConditions), "Service does not support the If-None-Match header for this operation."); + + using var scope = ClientDiagnostics.CreateScope("FileClient.GetFromComputeNode"); + scope.Start(); + try + { + using HttpMessage message = CreateGetFromComputeNodeRequest(poolId, nodeId, filePath, timeout, ocpDate, ocpRange, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the properties of the specified Compute Node file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that contains the file. + /// The path to the Compute Node file that you want to get the properties of. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetPropertiesFromComputeNodeAsync(string poolId, string nodeId, string filePath, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNullOrEmpty(filePath, nameof(filePath)); + + Argument.AssertNull(requestConditions.IfMatch, nameof(requestConditions), "Service does not support the If-Match header for this operation."); + Argument.AssertNull(requestConditions.IfNoneMatch, nameof(requestConditions), "Service does not support the If-None-Match header for this operation."); + + using var scope = ClientDiagnostics.CreateScope("FileClient.GetPropertiesFromComputeNode"); + scope.Start(); + try + { + using HttpMessage message = CreateGetPropertiesFromComputeNodeRequest(poolId, nodeId, filePath, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the properties of the specified Compute Node file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that contains the file. + /// The path to the Compute Node file that you want to get the properties of. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetPropertiesFromComputeNode(string poolId, string nodeId, string filePath, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + Argument.AssertNotNullOrEmpty(filePath, nameof(filePath)); + + Argument.AssertNull(requestConditions.IfMatch, nameof(requestConditions), "Service does not support the If-Match header for this operation."); + Argument.AssertNull(requestConditions.IfNoneMatch, nameof(requestConditions), "Service does not support the If-None-Match header for this operation."); + + using var scope = ClientDiagnostics.CreateScope("FileClient.GetPropertiesFromComputeNode"); + scope.Start(); + try + { + using HttpMessage message = CreateGetPropertiesFromComputeNodeRequest(poolId, nodeId, filePath, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists the files in a Task's directory on its Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job that contains the Task. + /// The ID of the Task whose files you want to list. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-task-files. + /// Whether to list children of the Task directory. This parameter can be used in combination with the filter parameter to list specific type of files. + /// The maximum number of items to return in the response. A maximum of 1000 files can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetFromTasksAsync(string jobId, string taskId, string filter, bool? recursive, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetFromTasksRequest(jobId, taskId, filter, recursive, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetFromTasksNextPageRequest(nextLink, jobId, taskId, filter, recursive, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "FileClient.GetFromTasks", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists the files in a Task's directory on its Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job that contains the Task. + /// The ID of the Task whose files you want to list. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-task-files. + /// Whether to list children of the Task directory. This parameter can be used in combination with the filter parameter to list specific type of files. + /// The maximum number of items to return in the response. A maximum of 1000 files can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetFromTasks(string jobId, string taskId, string filter, bool? recursive, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetFromTasksRequest(jobId, taskId, filter, recursive, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetFromTasksNextPageRequest(nextLink, jobId, taskId, filter, recursive, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "FileClient.GetFromTasks", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists all of the files in Task directories on the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node whose files you want to list. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. + /// Whether to list children of a directory. + /// The maximum number of items to return in the response. A maximum of 1000 files can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetFromComputeNodesAsync(string poolId, string nodeId, string filter, bool? recursive, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetFromComputeNodesRequest(poolId, nodeId, filter, recursive, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetFromComputeNodesNextPageRequest(nextLink, poolId, nodeId, filter, recursive, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "FileClient.GetFromComputeNodes", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists all of the files in Task directories on the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node whose files you want to list. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. + /// Whether to list children of a directory. + /// The maximum number of items to return in the response. A maximum of 1000 files can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetFromComputeNodes(string poolId, string nodeId, string filter, bool? recursive, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetFromComputeNodesRequest(poolId, nodeId, filter, recursive, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetFromComputeNodesNextPageRequest(nextLink, poolId, nodeId, filter, recursive, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "FileClient.GetFromComputeNodes", "value", "odata.nextLink", context); + } + + internal HttpMessage CreateDeleteFromTaskRequest(string jobId, string taskId, string filePath, bool? recursive, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + uri.AppendPath("/files/", false); + uri.AppendPath(filePath, true); + if (recursive != null) + { + uri.AppendQuery("recursive", recursive.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetFromTaskRequest(string jobId, string taskId, string filePath, int? timeout, DateTimeOffset? ocpDate, string ocpRange, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + uri.AppendPath("/files/", false); + uri.AppendPath(filePath, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json, application/octet-stream"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (ocpRange != null) + { + request.Headers.Add("ocp-range", ocpRange); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateGetPropertiesFromTaskRequest(string jobId, string taskId, string filePath, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Head; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + uri.AppendPath("/files/", false); + uri.AppendPath(filePath, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateDeleteFromComputeNodeRequest(string poolId, string nodeId, string filePath, bool? recursive, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/files/", false); + uri.AppendPath(filePath, true); + if (recursive != null) + { + uri.AppendQuery("recursive", recursive.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetFromComputeNodeRequest(string poolId, string nodeId, string filePath, int? timeout, DateTimeOffset? ocpDate, string ocpRange, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/files/", false); + uri.AppendPath(filePath, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json, application/octet-stream"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (ocpRange != null) + { + request.Headers.Add("ocp-range", ocpRange); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateGetPropertiesFromComputeNodeRequest(string poolId, string nodeId, string filePath, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Head; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/files/", false); + uri.AppendPath(filePath, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateGetFromTasksRequest(string jobId, string taskId, string filter, bool? recursive, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + uri.AppendPath("/files", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (recursive != null) + { + uri.AppendQuery("recursive", recursive.Value, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetFromComputeNodesRequest(string poolId, string nodeId, string filter, bool? recursive, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/files", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (recursive != null) + { + uri.AppendQuery("recursive", recursive.Value, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetFromTasksNextPageRequest(string nextLink, string jobId, string taskId, string filter, bool? recursive, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetFromComputeNodesNextPageRequest(string nextLink, string poolId, string nodeId, string filter, bool? recursive, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/JobClient.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/JobClient.cs new file mode 100644 index 000000000000..90443f19e627 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/JobClient.cs @@ -0,0 +1,1398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Temp.Batch +{ + // Data plane generated client. + /// The Job service client. + public partial class JobClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://batch.core.windows.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly string _batchUrl; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of JobClient for mocking. + protected JobClient() + { + } + + /// Initializes a new instance of JobClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public JobClient(string batchUrl, TokenCredential credential) : this(batchUrl, credential, new BatchServiceClientOptions()) + { + } + + /// Initializes a new instance of JobClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public JobClient(string batchUrl, TokenCredential credential, BatchServiceClientOptions options) + { + Argument.AssertNotNull(batchUrl, nameof(batchUrl)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new BatchServiceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _batchUrl = batchUrl; + _apiVersion = options.Version; + } + + /// + /// [Protocol Method] Deletes a Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job to delete. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string jobId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(jobId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job to delete. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string jobId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(jobId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetJobAsync(string jobId, string select, string expand, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.GetJob"); + scope.Start(); + try + { + using HttpMessage message = CreateGetJobRequest(jobId, select, expand, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetJob(string jobId, string select, string expand, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.GetJob"); + scope.Start(); + try + { + using HttpMessage message = CreateGetJobRequest(jobId, select, expand, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job whose properties you want to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task PatchAsync(string jobId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Patch"); + scope.Start(); + try + { + using HttpMessage message = CreatePatchRequest(jobId, content, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job whose properties you want to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Patch(string jobId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Patch"); + scope.Start(); + try + { + using HttpMessage message = CreatePatchRequest(jobId, content, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job whose properties you want to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task UpdateAsync(string jobId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Update"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateRequest(jobId, content, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job whose properties you want to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Update(string jobId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Update"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateRequest(jobId, content, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Disables the specified Job, preventing new Tasks from running. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job to disable. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DisableAsync(string jobId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Disable"); + scope.Start(); + try + { + using HttpMessage message = CreateDisableRequest(jobId, content, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Disables the specified Job, preventing new Tasks from running. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job to disable. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Disable(string jobId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Disable"); + scope.Start(); + try + { + using HttpMessage message = CreateDisableRequest(jobId, content, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Enables the specified Job, allowing new Tasks to run. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job to enable. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task EnableAsync(string jobId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Enable"); + scope.Start(); + try + { + using HttpMessage message = CreateEnableRequest(jobId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Enables the specified Job, allowing new Tasks to run. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job to enable. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Enable(string jobId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Enable"); + scope.Start(); + try + { + using HttpMessage message = CreateEnableRequest(jobId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Terminates the specified Job, marking it as completed. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job to terminate. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task TerminateAsync(string jobId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Terminate"); + scope.Start(); + try + { + using HttpMessage message = CreateTerminateRequest(jobId, content, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Terminates the specified Job, marking it as completed. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job to terminate. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Terminate(string jobId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Terminate"); + scope.Start(); + try + { + using HttpMessage message = CreateTerminateRequest(jobId, content, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds a Job to the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AddAsync(RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Add"); + scope.Start(); + try + { + using HttpMessage message = CreateAddRequest(content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds a Job to the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Add(RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.Add"); + scope.Start(); + try + { + using HttpMessage message = CreateAddRequest(content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the Task counts for the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTaskCountsAsync(string jobId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.GetTaskCounts"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTaskCountsRequest(jobId, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the Task counts for the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTaskCounts(string jobId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("JobClient.GetTaskCounts"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTaskCountsRequest(jobId, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists all of the Jobs in the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum number of items to return in the response. A maximum of 1000 Jobs can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetJobsAsync(string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsRequest(filter, select, expand, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsNextPageRequest(nextLink, filter, select, expand, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "JobClient.GetJobs", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists all of the Jobs in the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum number of items to return in the response. A maximum of 1000 Jobs can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetJobs(string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsRequest(filter, select, expand, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsNextPageRequest(nextLink, filter, select, expand, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "JobClient.GetJobs", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists the Jobs that have been created under the specified Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule from which you want to get a list of Jobs. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum number of items to return in the response. A maximum of 1000 Jobs can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetFromJobSchedulesAsync(string jobScheduleId, string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetFromJobSchedulesRequest(jobScheduleId, filter, select, expand, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetFromJobSchedulesNextPageRequest(nextLink, jobScheduleId, filter, select, expand, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "JobClient.GetFromJobSchedules", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists the Jobs that have been created under the specified Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule from which you want to get a list of Jobs. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum number of items to return in the response. A maximum of 1000 Jobs can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetFromJobSchedules(string jobScheduleId, string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetFromJobSchedulesRequest(jobScheduleId, filter, select, expand, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetFromJobSchedulesNextPageRequest(nextLink, jobScheduleId, filter, select, expand, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "JobClient.GetFromJobSchedules", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists the execution status of the Job Preparation and Job Release Task for the specified Job across the Compute Nodes where the Job has run. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. + /// An OData $select clause. + /// The maximum number of items to return in the response. A maximum of 1000 Tasks can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetPreparationAndReleaseTaskStatusesAsync(string jobId, string filter, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetPreparationAndReleaseTaskStatusesRequest(jobId, filter, select, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetPreparationAndReleaseTaskStatusesNextPageRequest(nextLink, jobId, filter, select, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "JobClient.GetPreparationAndReleaseTaskStatuses", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists the execution status of the Job Preparation and Job Release Task for the specified Job across the Compute Nodes where the Job has run. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. + /// An OData $select clause. + /// The maximum number of items to return in the response. A maximum of 1000 Tasks can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetPreparationAndReleaseTaskStatuses(string jobId, string filter, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetPreparationAndReleaseTaskStatusesRequest(jobId, filter, select, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetPreparationAndReleaseTaskStatusesNextPageRequest(nextLink, jobId, filter, select, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "JobClient.GetPreparationAndReleaseTaskStatuses", "value", "odata.nextLink", context); + } + + internal HttpMessage CreateDeleteRequest(string jobId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateGetJobRequest(string jobId, string select, string expand, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreatePatchRequest(string jobId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateUpdateRequest(string jobId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDisableRequest(string jobId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/disable", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateEnableRequest(string jobId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/enable", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateTerminateRequest(string jobId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/terminate", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateAddRequest(RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetJobsRequest(string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetFromJobSchedulesRequest(string jobScheduleId, string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobschedules/", false); + uri.AppendPath(jobScheduleId, true); + uri.AppendPath("/jobs", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetPreparationAndReleaseTaskStatusesRequest(string jobId, string filter, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/jobpreparationandreleasetaskstatus", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetTaskCountsRequest(string jobId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/taskcounts", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetJobsNextPageRequest(string nextLink, string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetFromJobSchedulesNextPageRequest(string nextLink, string jobScheduleId, string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetPreparationAndReleaseTaskStatusesNextPageRequest(string nextLink, string jobId, string filter, string select, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/JobScheduleClient.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/JobScheduleClient.cs new file mode 100644 index 000000000000..dd08e034e477 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/JobScheduleClient.cs @@ -0,0 +1,1153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Temp.Batch +{ + // Data plane generated client. + /// The JobSchedule service client. + public partial class JobScheduleClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://batch.core.windows.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly string _batchUrl; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of JobScheduleClient for mocking. + protected JobScheduleClient() + { + } + + /// Initializes a new instance of JobScheduleClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public JobScheduleClient(string batchUrl, TokenCredential credential) : this(batchUrl, credential, new BatchServiceClientOptions()) + { + } + + /// Initializes a new instance of JobScheduleClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public JobScheduleClient(string batchUrl, TokenCredential credential, BatchServiceClientOptions options) + { + Argument.AssertNotNull(batchUrl, nameof(batchUrl)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new BatchServiceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _batchUrl = batchUrl; + _apiVersion = options.Version; + } + + /// + /// [Protocol Method] Checks the specified Job Schedule exists. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule which you want to check. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ExistsAsync(string jobScheduleId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Exists"); + scope.Start(); + try + { + using HttpMessage message = CreateExistsRequest(jobScheduleId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Checks the specified Job Schedule exists. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule which you want to check. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Exists(string jobScheduleId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Exists"); + scope.Start(); + try + { + using HttpMessage message = CreateExistsRequest(jobScheduleId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a Job Schedule from the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to delete. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string jobScheduleId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(jobScheduleId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a Job Schedule from the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to delete. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string jobScheduleId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(jobScheduleId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to get. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetJobScheduleAsync(string jobScheduleId, string select, string expand, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.GetJobSchedule"); + scope.Start(); + try + { + using HttpMessage message = CreateGetJobScheduleRequest(jobScheduleId, select, expand, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to get. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetJobSchedule(string jobScheduleId, string select, string expand, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.GetJobSchedule"); + scope.Start(); + try + { + using HttpMessage message = CreateGetJobScheduleRequest(jobScheduleId, select, expand, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task PatchAsync(string jobScheduleId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Patch"); + scope.Start(); + try + { + using HttpMessage message = CreatePatchRequest(jobScheduleId, content, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Patch(string jobScheduleId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Patch"); + scope.Start(); + try + { + using HttpMessage message = CreatePatchRequest(jobScheduleId, content, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task UpdateAsync(string jobScheduleId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Update"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateRequest(jobScheduleId, content, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Update(string jobScheduleId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Update"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateRequest(jobScheduleId, content, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Disables a Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to disable. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DisableAsync(string jobScheduleId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Disable"); + scope.Start(); + try + { + using HttpMessage message = CreateDisableRequest(jobScheduleId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Disables a Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to disable. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Disable(string jobScheduleId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Disable"); + scope.Start(); + try + { + using HttpMessage message = CreateDisableRequest(jobScheduleId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Enables a Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to enable. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task EnableAsync(string jobScheduleId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Enable"); + scope.Start(); + try + { + using HttpMessage message = CreateEnableRequest(jobScheduleId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Enables a Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to enable. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Enable(string jobScheduleId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Enable"); + scope.Start(); + try + { + using HttpMessage message = CreateEnableRequest(jobScheduleId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Terminates a Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to terminates. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task TerminateAsync(string jobScheduleId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Terminate"); + scope.Start(); + try + { + using HttpMessage message = CreateTerminateRequest(jobScheduleId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Terminates a Job Schedule. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job Schedule to terminates. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Terminate(string jobScheduleId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Terminate"); + scope.Start(); + try + { + using HttpMessage message = CreateTerminateRequest(jobScheduleId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds a Job Schedule to the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AddAsync(RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Add"); + scope.Start(); + try + { + using HttpMessage message = CreateAddRequest(content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds a Job Schedule to the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Add(RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("JobScheduleClient.Add"); + scope.Start(); + try + { + using HttpMessage message = CreateAddRequest(content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists all of the Job Schedules in the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum number of items to return in the response. A maximum of 1000 Job Schedules can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetJobSchedulesAsync(string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobSchedulesRequest(filter, select, expand, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobSchedulesNextPageRequest(nextLink, filter, select, expand, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "JobScheduleClient.GetJobSchedules", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists all of the Job Schedules in the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum number of items to return in the response. A maximum of 1000 Job Schedules can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetJobSchedules(string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobSchedulesRequest(filter, select, expand, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobSchedulesNextPageRequest(nextLink, filter, select, expand, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "JobScheduleClient.GetJobSchedules", "value", "odata.nextLink", context); + } + + internal HttpMessage CreateExistsRequest(string jobScheduleId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200404); + var request = message.Request; + request.Method = RequestMethod.Head; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobschedules/", false); + uri.AppendPath(jobScheduleId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateDeleteRequest(string jobScheduleId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobschedules/", false); + uri.AppendPath(jobScheduleId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateGetJobScheduleRequest(string jobScheduleId, string select, string expand, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobschedules/", false); + uri.AppendPath(jobScheduleId, true); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreatePatchRequest(string jobScheduleId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobschedules/", false); + uri.AppendPath(jobScheduleId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateUpdateRequest(string jobScheduleId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobschedules/", false); + uri.AppendPath(jobScheduleId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDisableRequest(string jobScheduleId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobschedules/", false); + uri.AppendPath(jobScheduleId, true); + uri.AppendPath("/disable", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateEnableRequest(string jobScheduleId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobschedules/", false); + uri.AppendPath(jobScheduleId, true); + uri.AppendPath("/enable", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateTerminateRequest(string jobScheduleId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobschedules/", false); + uri.AppendPath(jobScheduleId, true); + uri.AppendPath("/terminate", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateAddRequest(RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobschedules", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetJobSchedulesRequest(string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobschedules", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetJobSchedulesNextPageRequest(string nextLink, string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + private static ResponseClassifier _responseClassifier200404; + private static ResponseClassifier ResponseClassifier200404 => _responseClassifier200404 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 404 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AccountListPoolNodeCountsOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AccountListPoolNodeCountsOptions.cs new file mode 100644 index 000000000000..6e8d255684e1 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AccountListPoolNodeCountsOptions.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class AccountListPoolNodeCountsOptions + { + /// Initializes a new instance of AccountListPoolNodeCountsOptions. + public AccountListPoolNodeCountsOptions() + { + } + + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch. + public string Filter { get; set; } + /// The maximum number of items to return in the response. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AccountListSupportedImagesOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AccountListSupportedImagesOptions.cs new file mode 100644 index 000000000000..776dcab9d2cb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AccountListSupportedImagesOptions.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class AccountListSupportedImagesOptions + { + /// Initializes a new instance of AccountListSupportedImagesOptions. + public AccountListSupportedImagesOptions() + { + } + + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. + public string Filter { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 results will be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AccountListSupportedImagesResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AccountListSupportedImagesResult.Serialization.cs new file mode 100644 index 000000000000..02471a014192 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AccountListSupportedImagesResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class AccountListSupportedImagesResult + { + internal static AccountListSupportedImagesResult DeserializeAccountListSupportedImagesResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ImageInformation.DeserializeImageInformation(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new AccountListSupportedImagesResult(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AccountListSupportedImagesResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AccountListSupportedImagesResult.cs new file mode 100644 index 000000000000..98ab5dbc2650 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AccountListSupportedImagesResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the supported Virtual Machine Images. + internal partial class AccountListSupportedImagesResult + { + /// Initializes a new instance of AccountListSupportedImagesResult. + internal AccountListSupportedImagesResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of AccountListSupportedImagesResult. + /// The list of supported Virtual Machine Images. + /// The URL to get the next set of results. + internal AccountListSupportedImagesResult(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// The list of supported Virtual Machine Images. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AffinityInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AffinityInformation.Serialization.cs new file mode 100644 index 000000000000..5e93a6bcf6b8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AffinityInformation.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class AffinityInformation : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("affinityId"u8); + writer.WriteStringValue(AffinityId); + writer.WriteEndObject(); + } + + internal static AffinityInformation DeserializeAffinityInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string affinityId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("affinityId"u8)) + { + affinityId = property.Value.GetString(); + continue; + } + } + return new AffinityInformation(affinityId); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AffinityInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AffinityInformation.cs new file mode 100644 index 000000000000..94ab7480c9dc --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AffinityInformation.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A locality hint that can be used by the Batch service to select a Compute Node on which to start a Task. + public partial class AffinityInformation + { + /// Initializes a new instance of AffinityInformation. + /// You can pass the affinityId of a Node to indicate that this Task needs to run on that Compute Node. Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will be scheduled elsewhere. + /// is null. + public AffinityInformation(string affinityId) + { + Argument.AssertNotNull(affinityId, nameof(affinityId)); + + AffinityId = affinityId; + } + + /// You can pass the affinityId of a Node to indicate that this Task needs to run on that Compute Node. Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will be scheduled elsewhere. + public string AffinityId { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AllocationState.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AllocationState.Serialization.cs new file mode 100644 index 000000000000..f77987a20bfd --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AllocationState.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class AllocationStateExtensions + { + public static string ToSerialString(this AllocationState value) => value switch + { + AllocationState.Steady => "steady", + AllocationState.Resizing => "resizing", + AllocationState.Stopping => "stopping", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AllocationState value.") + }; + + public static AllocationState ToAllocationState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "steady")) return AllocationState.Steady; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "resizing")) return AllocationState.Resizing; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "stopping")) return AllocationState.Stopping; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AllocationState value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AllocationState.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AllocationState.cs new file mode 100644 index 000000000000..ce77c31792d4 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AllocationState.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Whether the Pool is resizing. + public enum AllocationState + { + /// The Pool is not resizing. There are no changes to the number of Compute Nodes in the Pool in progress. A Pool enters this state when it is created and when no operations are being performed on the Pool to change the number of Compute Nodes. + Steady, + /// The Pool is resizing; that is, Compute Nodes are being added to or removed from the Pool. + Resizing, + /// The Pool was resizing, but the user has requested that the resize be stopped, but the stop request has not yet been completed. + Stopping + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationGetOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationGetOptions.cs new file mode 100644 index 000000000000..20482d9c0ef4 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationGetOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ApplicationGetOptions + { + /// Initializes a new instance of ApplicationGetOptions. + public ApplicationGetOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationListOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationListOptions.cs new file mode 100644 index 000000000000..fb096d1511fd --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationListOptions.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ApplicationListOptions + { + /// Initializes a new instance of ApplicationListOptions. + public ApplicationListOptions() + { + } + + /// The maximum number of items to return in the response. A maximum of 1000 applications can be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationListResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationListResult.Serialization.cs new file mode 100644 index 000000000000..f608a9b45f07 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationListResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class ApplicationListResult + { + internal static ApplicationListResult DeserializeApplicationListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ApplicationSummary.DeserializeApplicationSummary(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new ApplicationListResult(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationListResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationListResult.cs new file mode 100644 index 000000000000..319ad63b06bc --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the applications available in an Account. + internal partial class ApplicationListResult + { + /// Initializes a new instance of ApplicationListResult. + internal ApplicationListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ApplicationListResult. + /// The list of applications available in the Account. + /// The URL to get the next set of results. + internal ApplicationListResult(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// The list of applications available in the Account. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationPackageReference.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationPackageReference.Serialization.cs new file mode 100644 index 000000000000..e900e26ccb62 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationPackageReference.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ApplicationPackageReference : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("applicationId"u8); + writer.WriteStringValue(ApplicationId); + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + writer.WriteEndObject(); + } + + internal static ApplicationPackageReference DeserializeApplicationPackageReference(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string applicationId = default; + Optional version = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("applicationId"u8)) + { + applicationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + } + return new ApplicationPackageReference(applicationId, version.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationPackageReference.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationPackageReference.cs new file mode 100644 index 000000000000..eb02ca8d1a4a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationPackageReference.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A reference to an Package to be deployed to Compute Nodes. + public partial class ApplicationPackageReference + { + /// Initializes a new instance of ApplicationPackageReference. + /// When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). + /// is null. + public ApplicationPackageReference(string applicationId) + { + Argument.AssertNotNull(applicationId, nameof(applicationId)); + + ApplicationId = applicationId; + } + + /// Initializes a new instance of ApplicationPackageReference. + /// When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). + /// If this is omitted on a Pool, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences and HTTP status code 409. If this is omitted on a Task, and no default version is specified for this application, the Task fails with a pre-processing error. + internal ApplicationPackageReference(string applicationId, string version) + { + ApplicationId = applicationId; + Version = version; + } + + /// When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). + public string ApplicationId { get; set; } + /// If this is omitted on a Pool, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences and HTTP status code 409. If this is omitted on a Task, and no default version is specified for this application, the Task fails with a pre-processing error. + public string Version { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationSummary.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationSummary.Serialization.cs new file mode 100644 index 000000000000..369f7cb20794 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationSummary.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ApplicationSummary + { + internal static ApplicationSummary DeserializeApplicationSummary(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string displayName = default; + IReadOnlyList versions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("versions"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + versions = array; + continue; + } + } + return new ApplicationSummary(id, displayName, versions); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationSummary.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationSummary.cs new file mode 100644 index 000000000000..fcdc1c206ed7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ApplicationSummary.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Contains information about an application in an Azure Batch Account. + public partial class ApplicationSummary + { + /// Initializes a new instance of ApplicationSummary. + /// A string that uniquely identifies the application within the Account. + /// The display name for the application. + /// The list of available versions of the application. + /// , or is null. + internal ApplicationSummary(string id, string displayName, IEnumerable versions) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(displayName, nameof(displayName)); + Argument.AssertNotNull(versions, nameof(versions)); + + Id = id; + DisplayName = displayName; + Versions = versions.ToList(); + } + + /// Initializes a new instance of ApplicationSummary. + /// A string that uniquely identifies the application within the Account. + /// The display name for the application. + /// The list of available versions of the application. + internal ApplicationSummary(string id, string displayName, IReadOnlyList versions) + { + Id = id; + DisplayName = displayName; + Versions = versions; + } + + /// A string that uniquely identifies the application within the Account. + public string Id { get; } + /// The display name for the application. + public string DisplayName { get; } + /// The list of available versions of the application. + public IReadOnlyList Versions { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AuthenticationTokenSettings.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AuthenticationTokenSettings.Serialization.cs new file mode 100644 index 000000000000..aa02f8d33166 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AuthenticationTokenSettings.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class AuthenticationTokenSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Access)) + { + writer.WritePropertyName("access"u8); + writer.WriteStartArray(); + foreach (var item in Access) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static AuthenticationTokenSettings DeserializeAuthenticationTokenSettings(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> access = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("access"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + access = array; + continue; + } + } + return new AuthenticationTokenSettings(Optional.ToList(access)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AuthenticationTokenSettings.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AuthenticationTokenSettings.cs new file mode 100644 index 000000000000..87cc25f910ca --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AuthenticationTokenSettings.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The settings for an authentication token that the Task can use to perform Batch service operations. + public partial class AuthenticationTokenSettings + { + /// Initializes a new instance of AuthenticationTokenSettings. + public AuthenticationTokenSettings() + { + Access = new ChangeTrackingList(); + } + + /// Initializes a new instance of AuthenticationTokenSettings. + /// The authentication token grants access to a limited set of Batch service operations. Currently the only supported value for the access property is 'job', which grants access to all operations related to the Job which contains the Task. + internal AuthenticationTokenSettings(IList access) + { + Access = access; + } + + /// The authentication token grants access to a limited set of Batch service operations. Currently the only supported value for the access property is 'job', which grants access to all operations related to the Job which contains the Task. + public IList Access { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoPoolSpecification.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoPoolSpecification.Serialization.cs new file mode 100644 index 000000000000..342261f7e402 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoPoolSpecification.Serialization.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class AutoPoolSpecification : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(AutoPoolIdPrefix)) + { + writer.WritePropertyName("autoPoolIdPrefix"u8); + writer.WriteStringValue(AutoPoolIdPrefix); + } + writer.WritePropertyName("poolLifetimeOption"u8); + writer.WriteStringValue(PoolLifetimeOption.ToSerialString()); + if (Optional.IsDefined(KeepAlive)) + { + writer.WritePropertyName("keepAlive"u8); + writer.WriteBooleanValue(KeepAlive.Value); + } + if (Optional.IsDefined(Pool)) + { + writer.WritePropertyName("pool"u8); + writer.WriteObjectValue(Pool); + } + writer.WriteEndObject(); + } + + internal static AutoPoolSpecification DeserializeAutoPoolSpecification(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional autoPoolIdPrefix = default; + PoolLifetimeOption poolLifetimeOption = default; + Optional keepAlive = default; + Optional pool = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("autoPoolIdPrefix"u8)) + { + autoPoolIdPrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("poolLifetimeOption"u8)) + { + poolLifetimeOption = property.Value.GetString().ToPoolLifetimeOption(); + continue; + } + if (property.NameEquals("keepAlive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keepAlive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("pool"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pool = PoolSpecification.DeserializePoolSpecification(property.Value); + continue; + } + } + return new AutoPoolSpecification(autoPoolIdPrefix.Value, poolLifetimeOption, Optional.ToNullable(keepAlive), pool.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoPoolSpecification.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoPoolSpecification.cs new file mode 100644 index 000000000000..a4043c879b0e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoPoolSpecification.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Specifies characteristics for a temporary 'auto pool'. The Batch service will create this auto Pool when the Job is submitted. + public partial class AutoPoolSpecification + { + /// Initializes a new instance of AutoPoolSpecification. + /// The minimum lifetime of created auto Pools, and how multiple Jobs on a schedule are assigned to Pools. + public AutoPoolSpecification(PoolLifetimeOption poolLifetimeOption) + { + PoolLifetimeOption = poolLifetimeOption; + } + + /// Initializes a new instance of AutoPoolSpecification. + /// The Batch service assigns each auto Pool a unique identifier on creation. To distinguish between Pools created for different purposes, you can specify this element to add a prefix to the ID that is assigned. The prefix can be up to 20 characters long. + /// The minimum lifetime of created auto Pools, and how multiple Jobs on a schedule are assigned to Pools. + /// If false, the Batch service deletes the Pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the Job or Job Schedule completes. If true, the Batch service does not delete the Pool automatically. It is up to the user to delete auto Pools created with this option. + /// Specification for creating a new Pool. + internal AutoPoolSpecification(string autoPoolIdPrefix, PoolLifetimeOption poolLifetimeOption, bool? keepAlive, PoolSpecification pool) + { + AutoPoolIdPrefix = autoPoolIdPrefix; + PoolLifetimeOption = poolLifetimeOption; + KeepAlive = keepAlive; + Pool = pool; + } + + /// The Batch service assigns each auto Pool a unique identifier on creation. To distinguish between Pools created for different purposes, you can specify this element to add a prefix to the ID that is assigned. The prefix can be up to 20 characters long. + public string AutoPoolIdPrefix { get; set; } + /// The minimum lifetime of created auto Pools, and how multiple Jobs on a schedule are assigned to Pools. + public PoolLifetimeOption PoolLifetimeOption { get; set; } + /// If false, the Batch service deletes the Pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the Job or Job Schedule completes. If true, the Batch service does not delete the Pool automatically. It is up to the user to delete auto Pools created with this option. + public bool? KeepAlive { get; set; } + /// Specification for creating a new Pool. + public PoolSpecification Pool { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoScaleRun.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoScaleRun.Serialization.cs new file mode 100644 index 000000000000..ccca9b1c52cb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoScaleRun.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class AutoScaleRun + { + internal static AutoScaleRun DeserializeAutoScaleRun(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset timestamp = default; + Optional results = default; + Optional error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timestamp"u8)) + { + timestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("results"u8)) + { + results = property.Value.GetString(); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = AutoScaleRunError.DeserializeAutoScaleRunError(property.Value); + continue; + } + } + return new AutoScaleRun(timestamp, results.Value, error.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoScaleRun.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoScaleRun.cs new file mode 100644 index 000000000000..bbd185a21ea7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoScaleRun.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// The results and errors from an execution of a Pool autoscale formula. + public partial class AutoScaleRun + { + /// Initializes a new instance of AutoScaleRun. + /// The time at which the autoscale formula was last evaluated. + internal AutoScaleRun(DateTimeOffset timestamp) + { + Timestamp = timestamp; + } + + /// Initializes a new instance of AutoScaleRun. + /// The time at which the autoscale formula was last evaluated. + /// Each variable value is returned in the form $variable=value, and variables are separated by semicolons. + /// An error that occurred when executing or evaluating a Pool autoscale formula. + internal AutoScaleRun(DateTimeOffset timestamp, string results, AutoScaleRunError error) + { + Timestamp = timestamp; + Results = results; + Error = error; + } + + /// The time at which the autoscale formula was last evaluated. + public DateTimeOffset Timestamp { get; } + /// Each variable value is returned in the form $variable=value, and variables are separated by semicolons. + public string Results { get; } + /// An error that occurred when executing or evaluating a Pool autoscale formula. + public AutoScaleRunError Error { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoScaleRunError.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoScaleRunError.Serialization.cs new file mode 100644 index 000000000000..d2ee0018c2e7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoScaleRunError.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class AutoScaleRunError + { + internal static AutoScaleRunError DeserializeAutoScaleRunError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional message = default; + Optional> values = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("values"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePair.DeserializeNameValuePair(item)); + } + values = array; + continue; + } + } + return new AutoScaleRunError(code.Value, message.Value, Optional.ToList(values)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoScaleRunError.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoScaleRunError.cs new file mode 100644 index 000000000000..5e31bd83a417 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoScaleRunError.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// An error that occurred when executing or evaluating a Pool autoscale formula. + public partial class AutoScaleRunError + { + /// Initializes a new instance of AutoScaleRunError. + internal AutoScaleRunError() + { + Values = new ChangeTrackingList(); + } + + /// Initializes a new instance of AutoScaleRunError. + /// An identifier for the autoscale error. Codes are invariant and are intended to be consumed programmatically. + /// A message describing the autoscale error, intended to be suitable for display in a user interface. + /// A list of additional error details related to the autoscale error. + internal AutoScaleRunError(string code, string message, IReadOnlyList values) + { + Code = code; + Message = message; + Values = values; + } + + /// An identifier for the autoscale error. Codes are invariant and are intended to be consumed programmatically. + public string Code { get; } + /// A message describing the autoscale error, intended to be suitable for display in a user interface. + public string Message { get; } + /// A list of additional error details related to the autoscale error. + public IReadOnlyList Values { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoUserScope.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoUserScope.Serialization.cs new file mode 100644 index 000000000000..37832aeb1014 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoUserScope.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class AutoUserScopeExtensions + { + public static string ToSerialString(this AutoUserScope value) => value switch + { + AutoUserScope.Task => "task", + AutoUserScope.Pool => "pool", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AutoUserScope value.") + }; + + public static AutoUserScope ToAutoUserScope(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "task")) return AutoUserScope.Task; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "pool")) return AutoUserScope.Pool; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AutoUserScope value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoUserScope.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoUserScope.cs new file mode 100644 index 000000000000..6af9f94a9e5c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoUserScope.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The default value is pool. If the pool is running Windows a value of Task should be specified if stricter isolation between tasks is required. For example, if the task mutates the registry in a way which could impact other tasks, or if certificates have been specified on the pool which should not be accessible by normal tasks but should be accessible by StartTasks. + public enum AutoUserScope + { + /// Specifies that the service should create a new user for the Task. + Task, + /// Specifies that the Task runs as the common auto user Account which is created on every Compute Node in a Pool. + Pool + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoUserSpecification.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoUserSpecification.Serialization.cs new file mode 100644 index 000000000000..d7f95454aa89 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoUserSpecification.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class AutoUserSpecification : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Scope)) + { + writer.WritePropertyName("scope"u8); + writer.WriteStringValue(Scope.Value.ToSerialString()); + } + if (Optional.IsDefined(ElevationLevel)) + { + writer.WritePropertyName("elevationLevel"u8); + writer.WriteStringValue(ElevationLevel.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + internal static AutoUserSpecification DeserializeAutoUserSpecification(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional scope = default; + Optional elevationLevel = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scope"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scope = property.Value.GetString().ToAutoUserScope(); + continue; + } + if (property.NameEquals("elevationLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + elevationLevel = property.Value.GetString().ToElevationLevel(); + continue; + } + } + return new AutoUserSpecification(Optional.ToNullable(scope), Optional.ToNullable(elevationLevel)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoUserSpecification.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoUserSpecification.cs new file mode 100644 index 000000000000..e3b2d2203d1d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AutoUserSpecification.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Specifies the parameters for the auto user that runs a Task on the Batch service. + public partial class AutoUserSpecification + { + /// Initializes a new instance of AutoUserSpecification. + public AutoUserSpecification() + { + } + + /// Initializes a new instance of AutoUserSpecification. + /// The default value is pool. If the pool is running Windows a value of Task should be specified if stricter isolation between tasks is required. For example, if the task mutates the registry in a way which could impact other tasks, or if certificates have been specified on the pool which should not be accessible by normal tasks but should be accessible by StartTasks. + /// The default value is nonAdmin. + internal AutoUserSpecification(AutoUserScope? scope, ElevationLevel? elevationLevel) + { + Scope = scope; + ElevationLevel = elevationLevel; + } + + /// The default value is pool. If the pool is running Windows a value of Task should be specified if stricter isolation between tasks is required. For example, if the task mutates the registry in a way which could impact other tasks, or if certificates have been specified on the pool which should not be accessible by normal tasks but should be accessible by StartTasks. + public AutoUserScope? Scope { get; set; } + /// The default value is nonAdmin. + public ElevationLevel? ElevationLevel { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AzureBlobFileSystemConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AzureBlobFileSystemConfiguration.Serialization.cs new file mode 100644 index 000000000000..e05acb163e08 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AzureBlobFileSystemConfiguration.Serialization.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class AzureBlobFileSystemConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("accountName"u8); + writer.WriteStringValue(AccountName); + writer.WritePropertyName("containerName"u8); + writer.WriteStringValue(ContainerName); + if (Optional.IsDefined(AccountKey)) + { + writer.WritePropertyName("accountKey"u8); + writer.WriteStringValue(AccountKey); + } + if (Optional.IsDefined(SasKey)) + { + writer.WritePropertyName("sasKey"u8); + writer.WriteStringValue(SasKey); + } + if (Optional.IsDefined(BlobfuseOptions)) + { + writer.WritePropertyName("blobfuseOptions"u8); + writer.WriteStringValue(BlobfuseOptions); + } + writer.WritePropertyName("relativeMountPath"u8); + writer.WriteStringValue(RelativeMountPath); + if (Optional.IsDefined(IdentityReference)) + { + writer.WritePropertyName("identityReference"u8); + writer.WriteObjectValue(IdentityReference); + } + writer.WriteEndObject(); + } + + internal static AzureBlobFileSystemConfiguration DeserializeAzureBlobFileSystemConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string accountName = default; + string containerName = default; + Optional accountKey = default; + Optional sasKey = default; + Optional blobfuseOptions = default; + string relativeMountPath = default; + Optional identityReference = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("accountName"u8)) + { + accountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("containerName"u8)) + { + containerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("accountKey"u8)) + { + accountKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("sasKey"u8)) + { + sasKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("blobfuseOptions"u8)) + { + blobfuseOptions = property.Value.GetString(); + continue; + } + if (property.NameEquals("relativeMountPath"u8)) + { + relativeMountPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("identityReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityReference = ComputeNodeIdentityReference.DeserializeComputeNodeIdentityReference(property.Value); + continue; + } + } + return new AzureBlobFileSystemConfiguration(accountName, containerName, accountKey.Value, sasKey.Value, blobfuseOptions.Value, relativeMountPath, identityReference.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AzureBlobFileSystemConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AzureBlobFileSystemConfiguration.cs new file mode 100644 index 000000000000..cc1e327598e7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AzureBlobFileSystemConfiguration.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Information used to connect to an Azure Storage Container using Blobfuse. + public partial class AzureBlobFileSystemConfiguration + { + /// Initializes a new instance of AzureBlobFileSystemConfiguration. + /// The Azure Storage Account name. + /// The Azure Blob Storage Container name. + /// All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. + /// , or is null. + public AzureBlobFileSystemConfiguration(string accountName, string containerName, string relativeMountPath) + { + Argument.AssertNotNull(accountName, nameof(accountName)); + Argument.AssertNotNull(containerName, nameof(containerName)); + Argument.AssertNotNull(relativeMountPath, nameof(relativeMountPath)); + + AccountName = accountName; + ContainerName = containerName; + RelativeMountPath = relativeMountPath; + } + + /// Initializes a new instance of AzureBlobFileSystemConfiguration. + /// The Azure Storage Account name. + /// The Azure Blob Storage Container name. + /// This property is mutually exclusive with both sasKey and identity; exactly one must be specified. + /// This property is mutually exclusive with both accountKey and identity; exactly one must be specified. + /// These are 'net use' options in Windows and 'mount' options in Linux. + /// All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. + /// This property is mutually exclusive with both accountKey and sasKey; exactly one must be specified. + internal AzureBlobFileSystemConfiguration(string accountName, string containerName, string accountKey, string sasKey, string blobfuseOptions, string relativeMountPath, ComputeNodeIdentityReference identityReference) + { + AccountName = accountName; + ContainerName = containerName; + AccountKey = accountKey; + SasKey = sasKey; + BlobfuseOptions = blobfuseOptions; + RelativeMountPath = relativeMountPath; + IdentityReference = identityReference; + } + + /// The Azure Storage Account name. + public string AccountName { get; set; } + /// The Azure Blob Storage Container name. + public string ContainerName { get; set; } + /// This property is mutually exclusive with both sasKey and identity; exactly one must be specified. + public string AccountKey { get; set; } + /// This property is mutually exclusive with both accountKey and identity; exactly one must be specified. + public string SasKey { get; set; } + /// These are 'net use' options in Windows and 'mount' options in Linux. + public string BlobfuseOptions { get; set; } + /// 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; set; } + /// This property is mutually exclusive with both accountKey and sasKey; exactly one must be specified. + public ComputeNodeIdentityReference IdentityReference { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AzureFileShareConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AzureFileShareConfiguration.Serialization.cs new file mode 100644 index 000000000000..6e7d29dbfaa8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AzureFileShareConfiguration.Serialization.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class AzureFileShareConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("accountName"u8); + writer.WriteStringValue(AccountName); + writer.WritePropertyName("azureFileUrl"u8); + writer.WriteStringValue(AzureFileUrl); + writer.WritePropertyName("accountKey"u8); + writer.WriteStringValue(AccountKey); + writer.WritePropertyName("relativeMountPath"u8); + writer.WriteStringValue(RelativeMountPath); + if (Optional.IsDefined(MountOptions)) + { + writer.WritePropertyName("mountOptions"u8); + writer.WriteStringValue(MountOptions); + } + writer.WriteEndObject(); + } + + internal static AzureFileShareConfiguration DeserializeAzureFileShareConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string accountName = default; + string azureFileUrl = default; + string accountKey = default; + string relativeMountPath = default; + Optional mountOptions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("accountName"u8)) + { + accountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureFileUrl"u8)) + { + azureFileUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("accountKey"u8)) + { + accountKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("relativeMountPath"u8)) + { + relativeMountPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("mountOptions"u8)) + { + mountOptions = property.Value.GetString(); + continue; + } + } + return new AzureFileShareConfiguration(accountName, azureFileUrl, accountKey, relativeMountPath, mountOptions.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AzureFileShareConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AzureFileShareConfiguration.cs new file mode 100644 index 000000000000..197bda52373e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/AzureFileShareConfiguration.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Information used to connect to an Azure Fileshare. + public partial class AzureFileShareConfiguration + { + /// Initializes a new instance of AzureFileShareConfiguration. + /// The Azure Storage account name. + /// This is of the form 'https://{account}.file.core.windows.net/'. + /// The Azure Storage account key. + /// All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. + /// , , or is null. + public AzureFileShareConfiguration(string accountName, string azureFileUrl, string accountKey, string relativeMountPath) + { + Argument.AssertNotNull(accountName, nameof(accountName)); + Argument.AssertNotNull(azureFileUrl, nameof(azureFileUrl)); + Argument.AssertNotNull(accountKey, nameof(accountKey)); + Argument.AssertNotNull(relativeMountPath, nameof(relativeMountPath)); + + AccountName = accountName; + AzureFileUrl = azureFileUrl; + AccountKey = accountKey; + RelativeMountPath = relativeMountPath; + } + + /// Initializes a new instance of AzureFileShareConfiguration. + /// The Azure Storage account name. + /// This is of the form 'https://{account}.file.core.windows.net/'. + /// The Azure Storage account key. + /// All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. + /// These are 'net use' options in Windows and 'mount' options in Linux. + internal AzureFileShareConfiguration(string accountName, string azureFileUrl, string accountKey, string relativeMountPath, string mountOptions) + { + AccountName = accountName; + AzureFileUrl = azureFileUrl; + AccountKey = accountKey; + RelativeMountPath = relativeMountPath; + MountOptions = mountOptions; + } + + /// The Azure Storage account name. + public string AccountName { get; set; } + /// This is of the form 'https://{account}.file.core.windows.net/'. + public string AzureFileUrl { get; set; } + /// The Azure Storage account key. + public string AccountKey { get; set; } + /// 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; set; } + /// These are 'net use' options in Windows and 'mount' options in Linux. + public string MountOptions { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchError.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchError.Serialization.cs new file mode 100644 index 000000000000..2c1397dea155 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchError.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class BatchError + { + internal static BatchError DeserializeBatchError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional message = default; + Optional> values = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + message = ErrorMessage.DeserializeErrorMessage(property.Value); + continue; + } + if (property.NameEquals("values"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BatchErrorDetail.DeserializeBatchErrorDetail(item)); + } + values = array; + continue; + } + } + return new BatchError(code.Value, message.Value, Optional.ToList(values)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchError.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchError.cs new file mode 100644 index 000000000000..244c844db42c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchError.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// An error response received from the Azure Batch service. + public partial class BatchError + { + /// Initializes a new instance of BatchError. + internal BatchError() + { + Values = new ChangeTrackingList(); + } + + /// Initializes a new instance of BatchError. + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// An error message received in an Azure Batch error response. + /// A collection of key-value pairs containing additional details about the error. + internal BatchError(string code, ErrorMessage message, IReadOnlyList values) + { + Code = code; + Message = message; + Values = values; + } + + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + public string Code { get; } + /// An error message received in an Azure Batch error response. + public ErrorMessage Message { get; } + /// A collection of key-value pairs containing additional details about the error. + public IReadOnlyList Values { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchErrorDetail.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchErrorDetail.Serialization.cs new file mode 100644 index 000000000000..37e8960df307 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchErrorDetail.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class BatchErrorDetail + { + internal static BatchErrorDetail DeserializeBatchErrorDetail(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional key = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + } + return new BatchErrorDetail(key.Value, value.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchErrorDetail.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchErrorDetail.cs new file mode 100644 index 000000000000..769d68a1d5c7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchErrorDetail.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// An item of additional information included in an Azure Batch error response. + public partial class BatchErrorDetail + { + /// Initializes a new instance of BatchErrorDetail. + internal BatchErrorDetail() + { + } + + /// Initializes a new instance of BatchErrorDetail. + /// An identifier specifying the meaning of the Value property. + /// The additional information included with the error response. + internal BatchErrorDetail(string key, string value) + { + Key = key; + Value = value; + } + + /// An identifier specifying the meaning of the Value property. + public string Key { get; } + /// The additional information included with the error response. + public string Value { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchPoolIdentity.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchPoolIdentity.Serialization.cs new file mode 100644 index 000000000000..2cb7208cab00 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchPoolIdentity.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class BatchPoolIdentity + { + internal static BatchPoolIdentity DeserializeBatchPoolIdentity(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PoolIdentityType type = default; + Optional> userAssignedIdentities = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString().ToPoolIdentityType(); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserAssignedIdentity.DeserializeUserAssignedIdentity(item)); + } + userAssignedIdentities = array; + continue; + } + } + return new BatchPoolIdentity(type, Optional.ToList(userAssignedIdentities)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchPoolIdentity.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchPoolIdentity.cs new file mode 100644 index 000000000000..7dde2ce5f738 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/BatchPoolIdentity.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The identity of the Batch pool, if configured. + public partial class BatchPoolIdentity + { + /// Initializes a new instance of BatchPoolIdentity. + /// 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}'. + internal BatchPoolIdentity(PoolIdentityType type) + { + Type = type; + UserAssignedIdentities = new ChangeTrackingList(); + } + + /// Initializes a new instance of BatchPoolIdentity. + /// 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}'. + /// The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + internal BatchPoolIdentity(PoolIdentityType type, IReadOnlyList userAssignedIdentities) + { + Type = type; + UserAssignedIdentities = userAssignedIdentities; + } + + /// 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 PoolIdentityType Type { get; } + /// The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + public IReadOnlyList UserAssignedIdentities { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CachingType.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CachingType.Serialization.cs new file mode 100644 index 000000000000..6694627bfa2a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CachingType.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class CachingTypeExtensions + { + public static string ToSerialString(this CachingType value) => value switch + { + CachingType.None => "none", + CachingType.ReadOnly => "readonly", + CachingType.ReadWrite => "readwrite", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CachingType value.") + }; + + public static CachingType ToCachingType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "none")) return CachingType.None; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "readonly")) return CachingType.ReadOnly; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "readwrite")) return CachingType.ReadWrite; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CachingType value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CachingType.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CachingType.cs new file mode 100644 index 000000000000..898bcf617997 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CachingType.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. + public enum CachingType + { + /// The caching mode for the disk is not enabled. + None, + /// The caching mode for the disk is read only. + ReadOnly, + /// The caching mode for the disk is read and write. + ReadWrite + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/Certificate.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/Certificate.Serialization.cs new file mode 100644 index 000000000000..a9e85b744082 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/Certificate.Serialization.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class Certificate + { + internal static Certificate DeserializeCertificate(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional thumbprint = default; + Optional thumbprintAlgorithm = default; + Optional url = default; + Optional state = default; + Optional stateTransitionTime = default; + Optional previousState = default; + Optional previousStateTransitionTime = default; + Optional publicData = default; + Optional deleteCertificateError = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("thumbprint"u8)) + { + thumbprint = property.Value.GetString(); + continue; + } + if (property.NameEquals("thumbprintAlgorithm"u8)) + { + thumbprintAlgorithm = property.Value.GetString(); + continue; + } + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = property.Value.GetString().ToCertificateState(); + continue; + } + if (property.NameEquals("stateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("previousState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + previousState = property.Value.GetString().ToCertificateState(); + continue; + } + if (property.NameEquals("previousStateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + previousStateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("publicData"u8)) + { + publicData = property.Value.GetString(); + continue; + } + if (property.NameEquals("deleteCertificateError"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteCertificateError = DeleteCertificateError.DeserializeDeleteCertificateError(property.Value); + continue; + } + } + return new Certificate(thumbprint.Value, thumbprintAlgorithm.Value, url.Value, Optional.ToNullable(state), Optional.ToNullable(stateTransitionTime), Optional.ToNullable(previousState), Optional.ToNullable(previousStateTransitionTime), publicData.Value, deleteCertificateError.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/Certificate.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/Certificate.cs new file mode 100644 index 000000000000..09d1fa8fe3c8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/Certificate.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// A Certificate that can be installed on Compute Nodes and can be used to authenticate operations on the machine. + public partial class Certificate + { + /// Initializes a new instance of Certificate. + internal Certificate() + { + } + + /// Initializes a new instance of Certificate. + /// The X.509 thumbprint of the Certificate. This is a sequence of up to 40 hex digits. + /// The algorithm used to derive the thumbprint. + /// The URL of the Certificate. + /// The state of the Certificate. + /// The time at which the Certificate entered its current state. + /// This property is not set if the Certificate is in its initial active state. + /// This property is not set if the Certificate is in its initial Active state. + /// The public part of the Certificate as a base-64 encoded .cer file. + /// This property is set only if the Certificate is in the DeleteFailed state. + internal Certificate(string thumbprint, string thumbprintAlgorithm, string url, CertificateState? state, DateTimeOffset? stateTransitionTime, CertificateState? previousState, DateTimeOffset? previousStateTransitionTime, string publicData, DeleteCertificateError deleteCertificateError) + { + Thumbprint = thumbprint; + ThumbprintAlgorithm = thumbprintAlgorithm; + Url = url; + State = state; + StateTransitionTime = stateTransitionTime; + PreviousState = previousState; + PreviousStateTransitionTime = previousStateTransitionTime; + PublicData = publicData; + DeleteCertificateError = deleteCertificateError; + } + + /// The X.509 thumbprint of the Certificate. This is a sequence of up to 40 hex digits. + public string Thumbprint { get; } + /// The algorithm used to derive the thumbprint. + public string ThumbprintAlgorithm { get; } + /// The URL of the Certificate. + public string Url { get; } + /// The state of the Certificate. + public CertificateState? State { get; } + /// The time at which the Certificate entered its current state. + public DateTimeOffset? StateTransitionTime { get; } + /// This property is not set if the Certificate is in its initial active state. + public CertificateState? PreviousState { get; } + /// This property is not set if the Certificate is in its initial Active state. + public DateTimeOffset? PreviousStateTransitionTime { get; } + /// The public part of the Certificate as a base-64 encoded .cer file. + public string PublicData { get; } + /// This property is set only if the Certificate is in the DeleteFailed state. + public DeleteCertificateError DeleteCertificateError { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateAddOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateAddOptions.cs new file mode 100644 index 000000000000..3a399c261962 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateAddOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class CertificateAddOptions + { + /// Initializes a new instance of CertificateAddOptions. + public CertificateAddOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateAddParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateAddParameter.Serialization.cs new file mode 100644 index 000000000000..efade257f635 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateAddParameter.Serialization.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class CertificateAddParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("thumbprint"u8); + writer.WriteStringValue(Thumbprint); + writer.WritePropertyName("thumbprintAlgorithm"u8); + writer.WriteStringValue(ThumbprintAlgorithm); + writer.WritePropertyName("data"u8); + writer.WriteStringValue(Data); + if (Optional.IsDefined(CertificateFormat)) + { + writer.WritePropertyName("certificateFormat"u8); + writer.WriteStringValue(CertificateFormat.Value.ToSerialString()); + } + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateAddParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateAddParameter.cs new file mode 100644 index 000000000000..9f2acb2689a2 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateAddParameter.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A Certificate that can be installed on Compute Nodes and can be used to authenticate operations on the machine. + public partial class CertificateAddParameter + { + /// Initializes a new instance of CertificateAddParameter. + /// The X.509 thumbprint of the Certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed). + /// The algorithm used to derive the thumbprint. This must be sha1. + /// The base64-encoded contents of the Certificate. The maximum size is 10KB. + /// , or is null. + public CertificateAddParameter(string thumbprint, string thumbprintAlgorithm, string data) + { + Argument.AssertNotNull(thumbprint, nameof(thumbprint)); + Argument.AssertNotNull(thumbprintAlgorithm, nameof(thumbprintAlgorithm)); + Argument.AssertNotNull(data, nameof(data)); + + Thumbprint = thumbprint; + ThumbprintAlgorithm = thumbprintAlgorithm; + Data = data; + } + + /// The X.509 thumbprint of the Certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed). + public string Thumbprint { get; } + /// The algorithm used to derive the thumbprint. This must be sha1. + public string ThumbprintAlgorithm { get; } + /// The base64-encoded contents of the Certificate. The maximum size is 10KB. + public string Data { get; } + /// The format of the Certificate data. + public CertificateFormat? CertificateFormat { get; set; } + /// This must be omitted if the Certificate format is cer. + public string Password { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateCancelDeletionOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateCancelDeletionOptions.cs new file mode 100644 index 000000000000..fa791888d16d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateCancelDeletionOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class CertificateCancelDeletionOptions + { + /// Initializes a new instance of CertificateCancelDeletionOptions. + public CertificateCancelDeletionOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateDeleteOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateDeleteOptions.cs new file mode 100644 index 000000000000..8e7feacc63fc --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateDeleteOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class CertificateDeleteOptions + { + /// Initializes a new instance of CertificateDeleteOptions. + public CertificateDeleteOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateFormat.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateFormat.Serialization.cs new file mode 100644 index 000000000000..31be38912fee --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateFormat.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class CertificateFormatExtensions + { + public static string ToSerialString(this CertificateFormat value) => value switch + { + CertificateFormat.Pfx => "pfx", + CertificateFormat.Cer => "cer", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateFormat value.") + }; + + public static CertificateFormat ToCertificateFormat(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "pfx")) return CertificateFormat.Pfx; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "cer")) return CertificateFormat.Cer; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateFormat value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateFormat.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateFormat.cs new file mode 100644 index 000000000000..7d89b6cadbc1 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateFormat.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The format of the Certificate data. + public enum CertificateFormat + { + /// The Certificate is a PFX (PKCS#12) formatted Certificate or Certificate chain. + Pfx, + /// The Certificate is a base64-encoded X.509 Certificate. + Cer + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateGetOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateGetOptions.cs new file mode 100644 index 000000000000..e0fa1f5bfa24 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateGetOptions.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class CertificateGetOptions + { + /// Initializes a new instance of CertificateGetOptions. + public CertificateGetOptions() + { + } + + /// An OData $select clause. + public string Select { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateListOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateListOptions.cs new file mode 100644 index 000000000000..6c925b3014f9 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateListOptions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class CertificateListOptions + { + /// Initializes a new instance of CertificateListOptions. + public CertificateListOptions() + { + } + + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-certificates. + public string Filter { get; set; } + /// An OData $select clause. + public string Select { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 Certificates can be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateListResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateListResult.Serialization.cs new file mode 100644 index 000000000000..37e02f33cd0b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateListResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class CertificateListResult + { + internal static CertificateListResult DeserializeCertificateListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Certificate.DeserializeCertificate(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new CertificateListResult(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateListResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateListResult.cs new file mode 100644 index 000000000000..0874367a8137 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the Certificates in the Account. + internal partial class CertificateListResult + { + /// Initializes a new instance of CertificateListResult. + internal CertificateListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of CertificateListResult. + /// The list of Certificates. + /// The URL to get the next set of results. + internal CertificateListResult(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// The list of Certificates. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateReference.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateReference.Serialization.cs new file mode 100644 index 000000000000..a8d37135af79 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateReference.Serialization.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class CertificateReference : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("thumbprint"u8); + writer.WriteStringValue(Thumbprint); + writer.WritePropertyName("thumbprintAlgorithm"u8); + writer.WriteStringValue(ThumbprintAlgorithm); + if (Optional.IsDefined(StoreLocation)) + { + writer.WritePropertyName("storeLocation"u8); + writer.WriteStringValue(StoreLocation.Value.ToSerialString()); + } + if (Optional.IsDefined(StoreName)) + { + writer.WritePropertyName("storeName"u8); + writer.WriteStringValue(StoreName); + } + if (Optional.IsCollectionDefined(Visibility)) + { + writer.WritePropertyName("visibility"u8); + writer.WriteStartArray(); + foreach (var item in Visibility) + { + writer.WriteStringValue(item.ToSerialString()); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static CertificateReference DeserializeCertificateReference(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string thumbprint = default; + string thumbprintAlgorithm = default; + Optional storeLocation = default; + Optional storeName = default; + Optional> visibility = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("thumbprint"u8)) + { + thumbprint = property.Value.GetString(); + continue; + } + if (property.NameEquals("thumbprintAlgorithm"u8)) + { + thumbprintAlgorithm = property.Value.GetString(); + continue; + } + if (property.NameEquals("storeLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storeLocation = property.Value.GetString().ToCertificateStoreLocation(); + continue; + } + if (property.NameEquals("storeName"u8)) + { + storeName = property.Value.GetString(); + continue; + } + if (property.NameEquals("visibility"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString().ToCertificateVisibility()); + } + visibility = array; + continue; + } + } + return new CertificateReference(thumbprint, thumbprintAlgorithm, Optional.ToNullable(storeLocation), storeName.Value, Optional.ToList(visibility)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateReference.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateReference.cs new file mode 100644 index 000000000000..f917ee5419ef --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateReference.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Warning: This object is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + public partial class CertificateReference + { + /// Initializes a new instance of CertificateReference. + /// The thumbprint of the Certificate. + /// The algorithm with which the thumbprint is associated. This must be sha1. + /// or is null. + public CertificateReference(string thumbprint, string thumbprintAlgorithm) + { + Argument.AssertNotNull(thumbprint, nameof(thumbprint)); + Argument.AssertNotNull(thumbprintAlgorithm, nameof(thumbprintAlgorithm)); + + Thumbprint = thumbprint; + ThumbprintAlgorithm = thumbprintAlgorithm; + Visibility = new ChangeTrackingList(); + } + + /// Initializes a new instance of CertificateReference. + /// The thumbprint of the Certificate. + /// The algorithm with which the thumbprint is associated. This must be sha1. + /// The default value is currentuser. This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + /// This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My. + /// You can specify more than one visibility in this collection. The default is all Accounts. + internal CertificateReference(string thumbprint, string thumbprintAlgorithm, CertificateStoreLocation? storeLocation, string storeName, IList visibility) + { + Thumbprint = thumbprint; + ThumbprintAlgorithm = thumbprintAlgorithm; + StoreLocation = storeLocation; + StoreName = storeName; + Visibility = visibility; + } + + /// The thumbprint of the Certificate. + public string Thumbprint { get; set; } + /// The algorithm with which the thumbprint is associated. This must be sha1. + public string ThumbprintAlgorithm { get; set; } + /// The default value is currentuser. This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + public CertificateStoreLocation? StoreLocation { get; set; } + /// This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My. + public string StoreName { get; set; } + /// You can specify more than one visibility in this collection. The default is all Accounts. + public IList Visibility { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateState.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateState.Serialization.cs new file mode 100644 index 000000000000..c655b0d04bf5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateState.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class CertificateStateExtensions + { + public static string ToSerialString(this CertificateState value) => value switch + { + CertificateState.Active => "active", + CertificateState.Deleting => "deleting", + CertificateState.DeleteFailed => "deletefailed", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateState value.") + }; + + public static CertificateState ToCertificateState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "active")) return CertificateState.Active; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "deleting")) return CertificateState.Deleting; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "deletefailed")) return CertificateState.DeleteFailed; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateState value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateState.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateState.cs new file mode 100644 index 000000000000..1284d4899674 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateState.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The state of the Certificate. + public enum CertificateState + { + /// The Certificate is available for use in Pools. + Active, + /// The user has requested that the Certificate be deleted, but the delete operation has not yet completed. You may not reference the Certificate when creating or updating Pools. + Deleting, + /// The user requested that the Certificate be deleted, but there are Pools that still have references to the Certificate, or it is still installed on one or more Nodes. (The latter can occur if the Certificate has been removed from the Pool, but the Compute Node has not yet restarted. Compute Nodes refresh their Certificates only when they restart.) You may use the cancel Certificate delete operation to cancel the delete, or the delete Certificate operation to retry the delete. + DeleteFailed + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateStoreLocation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateStoreLocation.Serialization.cs new file mode 100644 index 000000000000..28a776177e37 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateStoreLocation.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class CertificateStoreLocationExtensions + { + public static string ToSerialString(this CertificateStoreLocation value) => value switch + { + CertificateStoreLocation.CurrentUser => "currentuser", + CertificateStoreLocation.LocalMachine => "localmachine", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateStoreLocation value.") + }; + + public static CertificateStoreLocation ToCertificateStoreLocation(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "currentuser")) return CertificateStoreLocation.CurrentUser; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "localmachine")) return CertificateStoreLocation.LocalMachine; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateStoreLocation value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateStoreLocation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateStoreLocation.cs new file mode 100644 index 000000000000..83f90abc4836 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateStoreLocation.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The default value is currentuser. This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + public enum CertificateStoreLocation + { + /// Certificates should be installed to the CurrentUser Certificate store. + CurrentUser, + /// Certificates should be installed to the LocalMachine Certificate store. + LocalMachine + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateVisibility.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateVisibility.Serialization.cs new file mode 100644 index 000000000000..69e2e1f96b3f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateVisibility.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class CertificateVisibilityExtensions + { + public static string ToSerialString(this CertificateVisibility value) => value switch + { + CertificateVisibility.StartTask => "starttask", + CertificateVisibility.Task => "task", + CertificateVisibility.RemoteUser => "remoteuser", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateVisibility value.") + }; + + public static CertificateVisibility ToCertificateVisibility(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "starttask")) return CertificateVisibility.StartTask; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "task")) return CertificateVisibility.Task; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "remoteuser")) return CertificateVisibility.RemoteUser; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateVisibility value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateVisibility.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateVisibility.cs new file mode 100644 index 000000000000..aa50753211ae --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CertificateVisibility.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The CertificateVisibility. + public enum CertificateVisibility + { + /// The Certificate should be visible to the user account under which the StartTask is run. Note that if AutoUser Scope is Pool for both the StartTask and a Task, this certificate will be visible to the Task as well. + StartTask, + /// The Certificate should be visible to the user accounts under which Job Tasks are run. + Task, + /// The Certificate should be visible to the user accounts under which users remotely access the Compute Node. + RemoteUser + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CifsMountConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CifsMountConfiguration.Serialization.cs new file mode 100644 index 000000000000..87c72f91c43c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CifsMountConfiguration.Serialization.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class CifsMountConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("username"u8); + writer.WriteStringValue(Username); + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + writer.WritePropertyName("relativeMountPath"u8); + writer.WriteStringValue(RelativeMountPath); + if (Optional.IsDefined(MountOptions)) + { + writer.WritePropertyName("mountOptions"u8); + writer.WriteStringValue(MountOptions); + } + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + writer.WriteEndObject(); + } + + internal static CifsMountConfiguration DeserializeCifsMountConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string username = default; + string source = default; + string relativeMountPath = default; + Optional mountOptions = default; + string password = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("username"u8)) + { + username = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("relativeMountPath"u8)) + { + relativeMountPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("mountOptions"u8)) + { + mountOptions = property.Value.GetString(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + } + return new CifsMountConfiguration(username, source, relativeMountPath, mountOptions.Value, password); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CifsMountConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CifsMountConfiguration.cs new file mode 100644 index 000000000000..6199cdd8572e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CifsMountConfiguration.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Information used to connect to a CIFS file system. + public partial class CifsMountConfiguration + { + /// Initializes a new instance of CifsMountConfiguration. + /// The user to use for authentication against the CIFS file system. + /// The URI of the file system to mount. + /// All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. + /// The password to use for authentication against the CIFS file system. + /// , , or is null. + public CifsMountConfiguration(string username, string source, string relativeMountPath, string password) + { + Argument.AssertNotNull(username, nameof(username)); + Argument.AssertNotNull(source, nameof(source)); + Argument.AssertNotNull(relativeMountPath, nameof(relativeMountPath)); + Argument.AssertNotNull(password, nameof(password)); + + Username = username; + Source = source; + RelativeMountPath = relativeMountPath; + Password = password; + } + + /// Initializes a new instance of CifsMountConfiguration. + /// The user to use for authentication against the CIFS file system. + /// The URI of the file system to mount. + /// All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. + /// These are 'net use' options in Windows and 'mount' options in Linux. + /// The password to use for authentication against the CIFS file system. + internal CifsMountConfiguration(string username, string source, string relativeMountPath, string mountOptions, string password) + { + Username = username; + Source = source; + RelativeMountPath = relativeMountPath; + MountOptions = mountOptions; + Password = password; + } + + /// The user to use for authentication against the CIFS file system. + public string Username { get; set; } + /// The URI of the file system to mount. + public string Source { get; set; } + /// 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; set; } + /// These are 'net use' options in Windows and 'mount' options in Linux. + public string MountOptions { get; set; } + /// The password to use for authentication against the CIFS file system. + public string Password { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJob.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJob.Serialization.cs new file mode 100644 index 000000000000..5b0580fe616d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJob.Serialization.cs @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class CloudJob + { + internal static CloudJob DeserializeCloudJob(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional displayName = default; + Optional usesTaskDependencies = default; + Optional url = default; + Optional eTag = default; + Optional lastModified = default; + Optional creationTime = default; + Optional state = default; + Optional stateTransitionTime = default; + Optional previousState = default; + Optional previousStateTransitionTime = default; + Optional priority = default; + Optional allowTaskPreemption = default; + Optional maxParallelTasks = default; + Optional constraints = default; + Optional jobManagerTask = default; + Optional jobPreparationTask = default; + Optional jobReleaseTask = default; + Optional> commonEnvironmentSettings = default; + Optional poolInfo = default; + Optional onAllTasksComplete = default; + Optional onTaskFailure = default; + Optional networkConfiguration = default; + Optional> metadata = default; + Optional executionInfo = default; + Optional stats = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("usesTaskDependencies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usesTaskDependencies = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("eTag"u8)) + { + eTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastModified"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModified = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = property.Value.GetString().ToJobState(); + continue; + } + if (property.NameEquals("stateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("previousState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + previousState = property.Value.GetString().ToJobState(); + continue; + } + if (property.NameEquals("previousStateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + previousStateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("priority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("allowTaskPreemption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowTaskPreemption = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("maxParallelTasks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxParallelTasks = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("constraints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + constraints = JobConstraints.DeserializeJobConstraints(property.Value); + continue; + } + if (property.NameEquals("jobManagerTask"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobManagerTask = JobManagerTask.DeserializeJobManagerTask(property.Value); + continue; + } + if (property.NameEquals("jobPreparationTask"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobPreparationTask = JobPreparationTask.DeserializeJobPreparationTask(property.Value); + continue; + } + if (property.NameEquals("jobReleaseTask"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobReleaseTask = JobReleaseTask.DeserializeJobReleaseTask(property.Value); + continue; + } + if (property.NameEquals("commonEnvironmentSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EnvironmentSetting.DeserializeEnvironmentSetting(item)); + } + commonEnvironmentSettings = array; + continue; + } + if (property.NameEquals("poolInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + poolInfo = PoolInformation.DeserializePoolInformation(property.Value); + continue; + } + if (property.NameEquals("onAllTasksComplete"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + onAllTasksComplete = property.Value.GetString().ToOnAllTasksComplete(); + continue; + } + if (property.NameEquals("onTaskFailure"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + onTaskFailure = property.Value.GetString().ToOnTaskFailure(); + continue; + } + if (property.NameEquals("networkConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkConfiguration = JobNetworkConfiguration.DeserializeJobNetworkConfiguration(property.Value); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MetadataItem.DeserializeMetadataItem(item)); + } + metadata = array; + continue; + } + if (property.NameEquals("executionInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + executionInfo = JobExecutionInformation.DeserializeJobExecutionInformation(property.Value); + continue; + } + if (property.NameEquals("stats"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stats = JobStatistics.DeserializeJobStatistics(property.Value); + continue; + } + } + return new CloudJob(id.Value, displayName.Value, Optional.ToNullable(usesTaskDependencies), url.Value, eTag.Value, Optional.ToNullable(lastModified), Optional.ToNullable(creationTime), Optional.ToNullable(state), Optional.ToNullable(stateTransitionTime), Optional.ToNullable(previousState), Optional.ToNullable(previousStateTransitionTime), Optional.ToNullable(priority), Optional.ToNullable(allowTaskPreemption), Optional.ToNullable(maxParallelTasks), constraints.Value, jobManagerTask.Value, jobPreparationTask.Value, jobReleaseTask.Value, Optional.ToList(commonEnvironmentSettings), poolInfo.Value, Optional.ToNullable(onAllTasksComplete), Optional.ToNullable(onTaskFailure), networkConfiguration.Value, Optional.ToList(metadata), executionInfo.Value, stats.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJob.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJob.cs new file mode 100644 index 000000000000..41d86b71bb64 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJob.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// An Azure Batch Job. + public partial class CloudJob + { + /// Initializes a new instance of CloudJob. + internal CloudJob() + { + CommonEnvironmentSettings = new ChangeTrackingList(); + Metadata = new ChangeTrackingList(); + } + + /// Initializes a new instance of CloudJob. + /// The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case). + /// The display name for the Job. + /// Whether Tasks in the Job can define dependencies on each other. The default is false. + /// The URL of the Job. + /// This is an opaque string. You can use it to detect whether the Job has changed between requests. In particular, you can be pass the ETag when updating a Job to specify that your changes should take effect only if nobody else has modified the Job in the meantime. + /// This is the last time at which the Job level data, such as the Job state or priority, changed. It does not factor in task-level changes such as adding new Tasks or Tasks changing state. + /// The creation time of the Job. + /// The state of the Job. + /// The time at which the Job entered its current state. + /// This property is not set if the Job is in its initial Active state. + /// This property is not set if the Job is in its initial Active state. + /// Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. + /// If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. + /// 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. + /// The execution constraints for a Job. + /// The Job Manager Task is automatically started when the Job is created. The Batch service tries to schedule the Job Manager Task before any other Tasks in the Job. When shrinking a Pool, the Batch service tries to preserve Nodes where Job Manager Tasks are running for as long as possible (that is, Compute Nodes running 'normal' Tasks are removed before Compute Nodes running Job Manager Tasks). When a Job Manager Task fails and needs to be restarted, the system tries to schedule it at the highest priority. If there are no idle Compute Nodes available, the system may terminate one of the running Tasks in the Pool and return it to the queue in order to make room for the Job Manager Task to restart. Note that a Job Manager Task in one Job does not have priority over Tasks in other Jobs. Across Jobs, only Job level priorities are observed. For example, if a Job Manager in a priority 0 Job needs to be restarted, it will not displace Tasks of a priority 1 Job. Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. + /// The Job Preparation Task is a special Task run on each Compute Node before any other Task of the Job. + /// The Job Release Task is a special Task run at the end of the Job on each Compute Node that has run any other Task of the Job. + /// Individual Tasks can override an environment setting specified here by specifying the same setting name with a different value. + /// Specifies how a Job should be assigned to a Pool. + /// The default is noaction. + /// A Task is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. + /// The network configuration for the Job. + /// The Batch service does not assign any meaning to metadata; it is solely for the use of user code. + /// Contains information about the execution of a Job in the Azure Batch service. + /// This property is populated only if the CloudJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. + internal CloudJob(string id, string displayName, bool? usesTaskDependencies, string url, string eTag, DateTimeOffset? lastModified, DateTimeOffset? creationTime, JobState? state, DateTimeOffset? stateTransitionTime, JobState? previousState, DateTimeOffset? previousStateTransitionTime, int? priority, bool? allowTaskPreemption, int? maxParallelTasks, JobConstraints constraints, JobManagerTask jobManagerTask, JobPreparationTask jobPreparationTask, JobReleaseTask jobReleaseTask, IReadOnlyList commonEnvironmentSettings, PoolInformation poolInfo, OnAllTasksComplete? onAllTasksComplete, OnTaskFailure? onTaskFailure, JobNetworkConfiguration networkConfiguration, IReadOnlyList metadata, JobExecutionInformation executionInfo, JobStatistics stats) + { + Id = id; + DisplayName = displayName; + UsesTaskDependencies = usesTaskDependencies; + Url = url; + ETag = eTag; + LastModified = lastModified; + CreationTime = creationTime; + State = state; + StateTransitionTime = stateTransitionTime; + PreviousState = previousState; + PreviousStateTransitionTime = previousStateTransitionTime; + Priority = priority; + AllowTaskPreemption = allowTaskPreemption; + MaxParallelTasks = maxParallelTasks; + Constraints = constraints; + JobManagerTask = jobManagerTask; + JobPreparationTask = jobPreparationTask; + JobReleaseTask = jobReleaseTask; + CommonEnvironmentSettings = commonEnvironmentSettings; + PoolInfo = poolInfo; + OnAllTasksComplete = onAllTasksComplete; + OnTaskFailure = onTaskFailure; + NetworkConfiguration = networkConfiguration; + Metadata = metadata; + ExecutionInfo = executionInfo; + Stats = stats; + } + + /// The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case). + public string Id { get; } + /// The display name for the Job. + public string DisplayName { get; } + /// Whether Tasks in the Job can define dependencies on each other. The default is false. + public bool? UsesTaskDependencies { get; } + /// The URL of the Job. + public string Url { get; } + /// This is an opaque string. You can use it to detect whether the Job has changed between requests. In particular, you can be pass the ETag when updating a Job to specify that your changes should take effect only if nobody else has modified the Job in the meantime. + public string ETag { get; } + /// This is the last time at which the Job level data, such as the Job state or priority, changed. It does not factor in task-level changes such as adding new Tasks or Tasks changing state. + public DateTimeOffset? LastModified { get; } + /// The creation time of the Job. + public DateTimeOffset? CreationTime { get; } + /// The state of the Job. + public JobState? State { get; } + /// The time at which the Job entered its current state. + public DateTimeOffset? StateTransitionTime { get; } + /// This property is not set if the Job is in its initial Active state. + public JobState? PreviousState { get; } + /// This property is not set if the Job is in its initial Active state. + public DateTimeOffset? PreviousStateTransitionTime { get; } + /// Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. + public int? Priority { get; } + /// If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. + public bool? AllowTaskPreemption { get; } + /// 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; } + /// The execution constraints for a Job. + public JobConstraints Constraints { get; } + /// The Job Manager Task is automatically started when the Job is created. The Batch service tries to schedule the Job Manager Task before any other Tasks in the Job. When shrinking a Pool, the Batch service tries to preserve Nodes where Job Manager Tasks are running for as long as possible (that is, Compute Nodes running 'normal' Tasks are removed before Compute Nodes running Job Manager Tasks). When a Job Manager Task fails and needs to be restarted, the system tries to schedule it at the highest priority. If there are no idle Compute Nodes available, the system may terminate one of the running Tasks in the Pool and return it to the queue in order to make room for the Job Manager Task to restart. Note that a Job Manager Task in one Job does not have priority over Tasks in other Jobs. Across Jobs, only Job level priorities are observed. For example, if a Job Manager in a priority 0 Job needs to be restarted, it will not displace Tasks of a priority 1 Job. Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. + public JobManagerTask JobManagerTask { get; } + /// The Job Preparation Task is a special Task run on each Compute Node before any other Task of the Job. + public JobPreparationTask JobPreparationTask { get; } + /// The Job Release Task is a special Task run at the end of the Job on each Compute Node that has run any other Task of the Job. + public JobReleaseTask JobReleaseTask { get; } + /// Individual Tasks can override an environment setting specified here by specifying the same setting name with a different value. + public IReadOnlyList CommonEnvironmentSettings { get; } + /// Specifies how a Job should be assigned to a Pool. + public PoolInformation PoolInfo { get; } + /// The default is noaction. + public OnAllTasksComplete? OnAllTasksComplete { get; } + /// A Task is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. + public OnTaskFailure? OnTaskFailure { get; } + /// The network configuration for the Job. + public JobNetworkConfiguration NetworkConfiguration { get; } + /// The Batch service does not assign any meaning to metadata; it is solely for the use of user code. + public IReadOnlyList Metadata { get; } + /// Contains information about the execution of a Job in the Azure Batch service. + public JobExecutionInformation ExecutionInfo { get; } + /// This property is populated only if the CloudJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. + public JobStatistics Stats { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobListPreparationAndReleaseTaskStatusResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobListPreparationAndReleaseTaskStatusResult.Serialization.cs new file mode 100644 index 000000000000..37b32addf414 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobListPreparationAndReleaseTaskStatusResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class CloudJobListPreparationAndReleaseTaskStatusResult + { + internal static CloudJobListPreparationAndReleaseTaskStatusResult DeserializeCloudJobListPreparationAndReleaseTaskStatusResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JobPreparationAndReleaseTaskExecutionInformation.DeserializeJobPreparationAndReleaseTaskExecutionInformation(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new CloudJobListPreparationAndReleaseTaskStatusResult(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobListPreparationAndReleaseTaskStatusResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobListPreparationAndReleaseTaskStatusResult.cs new file mode 100644 index 000000000000..6dce8882dcbb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobListPreparationAndReleaseTaskStatusResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the status of the Job Preparation and Job Release Tasks for a Job. + internal partial class CloudJobListPreparationAndReleaseTaskStatusResult + { + /// Initializes a new instance of CloudJobListPreparationAndReleaseTaskStatusResult. + internal CloudJobListPreparationAndReleaseTaskStatusResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of CloudJobListPreparationAndReleaseTaskStatusResult. + /// A list of Job Preparation and Job Release Task execution information. + /// The URL to get the next set of results. + internal CloudJobListPreparationAndReleaseTaskStatusResult(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// A list of Job Preparation and Job Release Task execution information. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobListResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobListResult.Serialization.cs new file mode 100644 index 000000000000..b04b843038da --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobListResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class CloudJobListResult + { + internal static CloudJobListResult DeserializeCloudJobListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CloudJob.DeserializeCloudJob(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new CloudJobListResult(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobListResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobListResult.cs new file mode 100644 index 000000000000..ed5d5f1b94dd --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the Jobs in an Account. + internal partial class CloudJobListResult + { + /// Initializes a new instance of CloudJobListResult. + internal CloudJobListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of CloudJobListResult. + /// The list of Jobs. + /// The URL to get the next set of results. + internal CloudJobListResult(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// The list of Jobs. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobSchedule.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobSchedule.Serialization.cs new file mode 100644 index 000000000000..647129b89622 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobSchedule.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class CloudJobSchedule + { + internal static CloudJobSchedule DeserializeCloudJobSchedule(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional displayName = default; + Optional url = default; + Optional eTag = default; + Optional lastModified = default; + Optional creationTime = default; + Optional state = default; + Optional stateTransitionTime = default; + Optional previousState = default; + Optional previousStateTransitionTime = default; + Optional schedule = default; + Optional jobSpecification = default; + Optional executionInfo = default; + Optional> metadata = default; + Optional stats = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("eTag"u8)) + { + eTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastModified"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModified = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = property.Value.GetString().ToJobScheduleState(); + continue; + } + if (property.NameEquals("stateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("previousState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + previousState = property.Value.GetString().ToJobScheduleState(); + continue; + } + if (property.NameEquals("previousStateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + previousStateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("schedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + schedule = Schedule.DeserializeSchedule(property.Value); + continue; + } + if (property.NameEquals("jobSpecification"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobSpecification = JobSpecification.DeserializeJobSpecification(property.Value); + continue; + } + if (property.NameEquals("executionInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + executionInfo = JobScheduleExecutionInformation.DeserializeJobScheduleExecutionInformation(property.Value); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MetadataItem.DeserializeMetadataItem(item)); + } + metadata = array; + continue; + } + if (property.NameEquals("stats"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stats = JobScheduleStatistics.DeserializeJobScheduleStatistics(property.Value); + continue; + } + } + return new CloudJobSchedule(id.Value, displayName.Value, url.Value, eTag.Value, Optional.ToNullable(lastModified), Optional.ToNullable(creationTime), Optional.ToNullable(state), Optional.ToNullable(stateTransitionTime), Optional.ToNullable(previousState), Optional.ToNullable(previousStateTransitionTime), schedule.Value, jobSpecification.Value, executionInfo.Value, Optional.ToList(metadata), stats.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobSchedule.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobSchedule.cs new file mode 100644 index 000000000000..6b3bef3f49be --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobSchedule.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A Job Schedule that allows recurring Jobs by specifying when to run Jobs and a specification used to create each Job. + public partial class CloudJobSchedule + { + /// Initializes a new instance of CloudJobSchedule. + internal CloudJobSchedule() + { + Metadata = new ChangeTrackingList(); + } + + /// Initializes a new instance of CloudJobSchedule. + /// A string that uniquely identifies the schedule within the Account. + /// The display name for the schedule. + /// The URL of the Job Schedule. + /// This is an opaque string. You can use it to detect whether the Job Schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime. + /// This is the last time at which the schedule level data, such as the Job specification or recurrence information, changed. It does not factor in job-level changes such as new Jobs being created or Jobs changing state. + /// The creation time of the Job Schedule. + /// The state of the Job Schedule. + /// The time at which the Job Schedule entered the current state. + /// This property is not present if the Job Schedule is in its initial active state. + /// This property is not present if the Job Schedule is in its initial active state. + /// All times are fixed respective to UTC and are not impacted by daylight saving time. + /// Specifies details of the Jobs to be created on a schedule. + /// Contains information about Jobs that have been and will be run under a Job Schedule. + /// The Batch service does not assign any meaning to metadata; it is solely for the use of user code. + /// Resource usage statistics for a Job Schedule. + internal CloudJobSchedule(string id, string displayName, string url, string eTag, DateTimeOffset? lastModified, DateTimeOffset? creationTime, JobScheduleState? state, DateTimeOffset? stateTransitionTime, JobScheduleState? previousState, DateTimeOffset? previousStateTransitionTime, Schedule schedule, JobSpecification jobSpecification, JobScheduleExecutionInformation executionInfo, IReadOnlyList metadata, JobScheduleStatistics stats) + { + Id = id; + DisplayName = displayName; + Url = url; + ETag = eTag; + LastModified = lastModified; + CreationTime = creationTime; + State = state; + StateTransitionTime = stateTransitionTime; + PreviousState = previousState; + PreviousStateTransitionTime = previousStateTransitionTime; + Schedule = schedule; + JobSpecification = jobSpecification; + ExecutionInfo = executionInfo; + Metadata = metadata; + Stats = stats; + } + + /// A string that uniquely identifies the schedule within the Account. + public string Id { get; } + /// The display name for the schedule. + public string DisplayName { get; } + /// The URL of the Job Schedule. + public string Url { get; } + /// This is an opaque string. You can use it to detect whether the Job Schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime. + public string ETag { get; } + /// This is the last time at which the schedule level data, such as the Job specification or recurrence information, changed. It does not factor in job-level changes such as new Jobs being created or Jobs changing state. + public DateTimeOffset? LastModified { get; } + /// The creation time of the Job Schedule. + public DateTimeOffset? CreationTime { get; } + /// The state of the Job Schedule. + public JobScheduleState? State { get; } + /// The time at which the Job Schedule entered the current state. + public DateTimeOffset? StateTransitionTime { get; } + /// This property is not present if the Job Schedule is in its initial active state. + public JobScheduleState? PreviousState { get; } + /// This property is not present if the Job Schedule is in its initial active state. + public DateTimeOffset? PreviousStateTransitionTime { get; } + /// All times are fixed respective to UTC and are not impacted by daylight saving time. + public Schedule Schedule { get; } + /// Specifies details of the Jobs to be created on a schedule. + public JobSpecification JobSpecification { get; } + /// Contains information about Jobs that have been and will be run under a Job Schedule. + public JobScheduleExecutionInformation ExecutionInfo { get; } + /// The Batch service does not assign any meaning to metadata; it is solely for the use of user code. + public IReadOnlyList Metadata { get; } + /// Resource usage statistics for a Job Schedule. + public JobScheduleStatistics Stats { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobScheduleListResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobScheduleListResult.Serialization.cs new file mode 100644 index 000000000000..7ccc2df343cb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobScheduleListResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class CloudJobScheduleListResult + { + internal static CloudJobScheduleListResult DeserializeCloudJobScheduleListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CloudJobSchedule.DeserializeCloudJobSchedule(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new CloudJobScheduleListResult(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobScheduleListResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobScheduleListResult.cs new file mode 100644 index 000000000000..4fac11a44a97 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudJobScheduleListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the Job Schedules in an Account. + internal partial class CloudJobScheduleListResult + { + /// Initializes a new instance of CloudJobScheduleListResult. + internal CloudJobScheduleListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of CloudJobScheduleListResult. + /// The list of Job Schedules. + /// The URL to get the next set of results. + internal CloudJobScheduleListResult(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// The list of Job Schedules. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudPool.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudPool.Serialization.cs new file mode 100644 index 000000000000..798a9e749c93 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudPool.Serialization.cs @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class CloudPool + { + internal static CloudPool DeserializeCloudPool(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional displayName = default; + Optional url = default; + Optional eTag = default; + Optional lastModified = default; + Optional creationTime = default; + Optional state = default; + Optional stateTransitionTime = default; + Optional allocationState = default; + Optional allocationStateTransitionTime = default; + Optional vmSize = default; + Optional cloudServiceConfiguration = default; + Optional virtualMachineConfiguration = default; + Optional resizeTimeout = default; + Optional> resizeErrors = default; + Optional currentDedicatedNodes = default; + Optional currentLowPriorityNodes = default; + Optional targetDedicatedNodes = default; + Optional targetLowPriorityNodes = default; + Optional enableAutoScale = default; + Optional autoScaleFormula = default; + Optional autoScaleEvaluationInterval = default; + Optional autoScaleRun = default; + Optional enableInterNodeCommunication = default; + Optional networkConfiguration = default; + Optional startTask = default; + Optional> certificateReferences = default; + Optional> applicationPackageReferences = default; + Optional> applicationLicenses = default; + Optional taskSlotsPerNode = default; + Optional taskSchedulingPolicy = default; + Optional> userAccounts = default; + Optional> metadata = default; + Optional stats = default; + Optional> mountConfiguration = default; + Optional identity = default; + Optional targetNodeCommunicationMode = default; + Optional currentNodeCommunicationMode = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("eTag"u8)) + { + eTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastModified"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModified = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = property.Value.GetString().ToPoolState(); + continue; + } + if (property.NameEquals("stateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("allocationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocationState = property.Value.GetString().ToAllocationState(); + continue; + } + if (property.NameEquals("allocationStateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocationStateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("vmSize"u8)) + { + vmSize = property.Value.GetString(); + continue; + } + if (property.NameEquals("cloudServiceConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cloudServiceConfiguration = CloudServiceConfiguration.DeserializeCloudServiceConfiguration(property.Value); + continue; + } + if (property.NameEquals("virtualMachineConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value); + continue; + } + if (property.NameEquals("resizeTimeout"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resizeTimeout = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("resizeErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResizeError.DeserializeResizeError(item)); + } + resizeErrors = array; + continue; + } + if (property.NameEquals("currentDedicatedNodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + currentDedicatedNodes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("currentLowPriorityNodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + currentLowPriorityNodes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("targetDedicatedNodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetDedicatedNodes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("targetLowPriorityNodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetLowPriorityNodes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("enableAutoScale"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutoScale = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("autoScaleFormula"u8)) + { + autoScaleFormula = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoScaleEvaluationInterval"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoScaleEvaluationInterval = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("autoScaleRun"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoScaleRun = AutoScaleRun.DeserializeAutoScaleRun(property.Value); + continue; + } + if (property.NameEquals("enableInterNodeCommunication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableInterNodeCommunication = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("networkConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkConfiguration = NetworkConfiguration.DeserializeNetworkConfiguration(property.Value); + continue; + } + if (property.NameEquals("startTask"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTask = StartTask.DeserializeStartTask(property.Value); + continue; + } + if (property.NameEquals("certificateReferences"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CertificateReference.DeserializeCertificateReference(item)); + } + certificateReferences = array; + continue; + } + if (property.NameEquals("applicationPackageReferences"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ApplicationPackageReference.DeserializeApplicationPackageReference(item)); + } + applicationPackageReferences = array; + continue; + } + if (property.NameEquals("applicationLicenses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + applicationLicenses = array; + continue; + } + if (property.NameEquals("taskSlotsPerNode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + taskSlotsPerNode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("taskSchedulingPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + taskSchedulingPolicy = TaskSchedulingPolicy.DeserializeTaskSchedulingPolicy(property.Value); + continue; + } + if (property.NameEquals("userAccounts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserAccount.DeserializeUserAccount(item)); + } + userAccounts = array; + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MetadataItem.DeserializeMetadataItem(item)); + } + metadata = array; + continue; + } + if (property.NameEquals("stats"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stats = PoolStatistics.DeserializePoolStatistics(property.Value); + continue; + } + if (property.NameEquals("mountConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.MountConfiguration.DeserializeMountConfiguration(item)); + } + mountConfiguration = array; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = BatchPoolIdentity.DeserializeBatchPoolIdentity(property.Value); + continue; + } + if (property.NameEquals("targetNodeCommunicationMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetNodeCommunicationMode = property.Value.GetString().ToNodeCommunicationMode(); + continue; + } + if (property.NameEquals("currentNodeCommunicationMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + currentNodeCommunicationMode = null; + continue; + } + currentNodeCommunicationMode = property.Value.GetString().ToNodeCommunicationMode(); + continue; + } + } + return new CloudPool(id.Value, displayName.Value, url.Value, eTag.Value, Optional.ToNullable(lastModified), Optional.ToNullable(creationTime), Optional.ToNullable(state), Optional.ToNullable(stateTransitionTime), Optional.ToNullable(allocationState), Optional.ToNullable(allocationStateTransitionTime), vmSize.Value, cloudServiceConfiguration.Value, virtualMachineConfiguration.Value, Optional.ToNullable(resizeTimeout), Optional.ToList(resizeErrors), Optional.ToNullable(currentDedicatedNodes), Optional.ToNullable(currentLowPriorityNodes), Optional.ToNullable(targetDedicatedNodes), Optional.ToNullable(targetLowPriorityNodes), Optional.ToNullable(enableAutoScale), autoScaleFormula.Value, Optional.ToNullable(autoScaleEvaluationInterval), autoScaleRun.Value, Optional.ToNullable(enableInterNodeCommunication), networkConfiguration.Value, startTask.Value, Optional.ToList(certificateReferences), Optional.ToList(applicationPackageReferences), Optional.ToList(applicationLicenses), Optional.ToNullable(taskSlotsPerNode), taskSchedulingPolicy.Value, Optional.ToList(userAccounts), Optional.ToList(metadata), stats.Value, Optional.ToList(mountConfiguration), identity.Value, Optional.ToNullable(targetNodeCommunicationMode), Optional.ToNullable(currentNodeCommunicationMode)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudPool.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudPool.cs new file mode 100644 index 000000000000..e002fad96f74 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudPool.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A Pool in the Azure Batch service. + public partial class CloudPool + { + /// Initializes a new instance of CloudPool. + internal CloudPool() + { + ResizeErrors = new ChangeTrackingList(); + CertificateReferences = new ChangeTrackingList(); + ApplicationPackageReferences = new ChangeTrackingList(); + ApplicationLicenses = new ChangeTrackingList(); + UserAccounts = new ChangeTrackingList(); + Metadata = new ChangeTrackingList(); + MountConfiguration = new ChangeTrackingList(); + } + + /// Initializes a new instance of CloudPool. + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case). + /// The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + /// The URL of the Pool. + /// This is an opaque string. You can use it to detect whether the Pool has changed between requests. In particular, you can be pass the ETag when updating a Pool to specify that your changes should take effect only if nobody else has modified the Pool in the meantime. + /// This is the last time at which the Pool level data, such as the targetDedicatedNodes or enableAutoscale settings, changed. It does not factor in node-level changes such as a Compute Node changing state. + /// The creation time of the Pool. + /// The current state of the Pool. + /// The time at which the Pool entered its current state. + /// Whether the Pool is resizing. + /// The time at which the Pool entered its current allocation state. + /// For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch Account was created with its poolAllocationMode property set to 'UserSubscription'. + /// This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. + /// This is the timeout for the most recent resize operation. (The initial sizing when the Pool is created counts as a resize.) The default value is 15 minutes. + /// This property is set only if one or more errors occurred during the last Pool resize, and only when the Pool allocationState is Steady. + /// The number of dedicated Compute Nodes currently in the Pool. + /// Spot/Low-priority Compute Nodes which have been preempted are included in this count. + /// The desired number of dedicated Compute Nodes in the Pool. + /// The desired number of Spot/Low-priority Compute Nodes in the Pool. + /// 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. + /// This property is set only if the Pool automatically scales, i.e. enableAutoScale is true. + /// This property is set only if the Pool automatically scales, i.e. enableAutoScale is true. + /// This property is set only if the Pool automatically scales, i.e. enableAutoScale is true. + /// This imposes restrictions on which Compute Nodes can be assigned to the Pool. Specifying this value can reduce the chance of the requested number of Compute Nodes to be allocated in the Pool. + /// The network configuration for a Pool. + /// Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. In some cases the StartTask may be re-run even though the Compute Node was not rebooted. Special care should be taken to avoid StartTasks which create breakaway process or install/launch services from the StartTask working directory, as this will block Batch from being able to re-run the StartTask. + /// + /// For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + /// + /// Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + /// Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Package references on any given Pool. + /// The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, Pool creation will fail. + /// The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. + /// If not specified, the default is spread. + /// The list of user Accounts to be created on each Compute Node in the Pool. + /// A list of name-value pairs associated with the Pool as metadata. + /// This property is populated only if the CloudPool was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. + /// This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. + /// 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}'. + /// If omitted, the default value is Default. + /// Determines how a pool communicates with the Batch service. + internal CloudPool(string id, string displayName, string url, string eTag, DateTimeOffset? lastModified, DateTimeOffset? creationTime, PoolState? state, DateTimeOffset? stateTransitionTime, AllocationState? allocationState, DateTimeOffset? allocationStateTransitionTime, string vmSize, CloudServiceConfiguration cloudServiceConfiguration, VirtualMachineConfiguration virtualMachineConfiguration, TimeSpan? resizeTimeout, IReadOnlyList resizeErrors, int? currentDedicatedNodes, int? currentLowPriorityNodes, int? targetDedicatedNodes, int? targetLowPriorityNodes, bool? enableAutoScale, string autoScaleFormula, TimeSpan? autoScaleEvaluationInterval, AutoScaleRun autoScaleRun, bool? enableInterNodeCommunication, NetworkConfiguration networkConfiguration, StartTask startTask, IReadOnlyList certificateReferences, IReadOnlyList applicationPackageReferences, IReadOnlyList applicationLicenses, int? taskSlotsPerNode, TaskSchedulingPolicy taskSchedulingPolicy, IReadOnlyList userAccounts, IReadOnlyList metadata, PoolStatistics stats, IReadOnlyList mountConfiguration, BatchPoolIdentity identity, NodeCommunicationMode? targetNodeCommunicationMode, NodeCommunicationMode? currentNodeCommunicationMode) + { + Id = id; + DisplayName = displayName; + Url = url; + ETag = eTag; + LastModified = lastModified; + CreationTime = creationTime; + State = state; + StateTransitionTime = stateTransitionTime; + AllocationState = allocationState; + AllocationStateTransitionTime = allocationStateTransitionTime; + VmSize = vmSize; + CloudServiceConfiguration = cloudServiceConfiguration; + VirtualMachineConfiguration = virtualMachineConfiguration; + ResizeTimeout = resizeTimeout; + ResizeErrors = resizeErrors; + CurrentDedicatedNodes = currentDedicatedNodes; + CurrentLowPriorityNodes = currentLowPriorityNodes; + TargetDedicatedNodes = targetDedicatedNodes; + TargetLowPriorityNodes = targetLowPriorityNodes; + EnableAutoScale = enableAutoScale; + AutoScaleFormula = autoScaleFormula; + AutoScaleEvaluationInterval = autoScaleEvaluationInterval; + AutoScaleRun = autoScaleRun; + EnableInterNodeCommunication = enableInterNodeCommunication; + NetworkConfiguration = networkConfiguration; + StartTask = startTask; + CertificateReferences = certificateReferences; + ApplicationPackageReferences = applicationPackageReferences; + ApplicationLicenses = applicationLicenses; + TaskSlotsPerNode = taskSlotsPerNode; + TaskSchedulingPolicy = taskSchedulingPolicy; + UserAccounts = userAccounts; + Metadata = metadata; + Stats = stats; + MountConfiguration = mountConfiguration; + Identity = identity; + TargetNodeCommunicationMode = targetNodeCommunicationMode; + CurrentNodeCommunicationMode = currentNodeCommunicationMode; + } + + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case). + public string Id { get; } + /// The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + public string DisplayName { get; } + /// The URL of the Pool. + public string Url { get; } + /// This is an opaque string. You can use it to detect whether the Pool has changed between requests. In particular, you can be pass the ETag when updating a Pool to specify that your changes should take effect only if nobody else has modified the Pool in the meantime. + public string ETag { get; } + /// This is the last time at which the Pool level data, such as the targetDedicatedNodes or enableAutoscale settings, changed. It does not factor in node-level changes such as a Compute Node changing state. + public DateTimeOffset? LastModified { get; } + /// The creation time of the Pool. + public DateTimeOffset? CreationTime { get; } + /// The current state of the Pool. + public PoolState? State { get; } + /// The time at which the Pool entered its current state. + public DateTimeOffset? StateTransitionTime { get; } + /// Whether the Pool is resizing. + public AllocationState? AllocationState { get; } + /// The time at which the Pool entered its current allocation state. + public DateTimeOffset? AllocationStateTransitionTime { get; } + /// For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + public string VmSize { get; } + /// This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch Account was created with its poolAllocationMode property set to 'UserSubscription'. + public CloudServiceConfiguration CloudServiceConfiguration { get; } + /// This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. + public VirtualMachineConfiguration VirtualMachineConfiguration { get; } + /// This is the timeout for the most recent resize operation. (The initial sizing when the Pool is created counts as a resize.) The default value is 15 minutes. + public TimeSpan? ResizeTimeout { get; } + /// This property is set only if one or more errors occurred during the last Pool resize, and only when the Pool allocationState is Steady. + public IReadOnlyList ResizeErrors { get; } + /// The number of dedicated Compute Nodes currently in the Pool. + public int? CurrentDedicatedNodes { get; } + /// Spot/Low-priority Compute Nodes which have been preempted are included in this count. + public int? CurrentLowPriorityNodes { get; } + /// The desired number of dedicated Compute Nodes in the Pool. + public int? TargetDedicatedNodes { get; } + /// The desired number of Spot/Low-priority Compute Nodes in the Pool. + public int? TargetLowPriorityNodes { get; } + /// 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. + public bool? EnableAutoScale { get; } + /// This property is set only if the Pool automatically scales, i.e. enableAutoScale is true. + public string AutoScaleFormula { get; } + /// This property is set only if the Pool automatically scales, i.e. enableAutoScale is true. + public TimeSpan? AutoScaleEvaluationInterval { get; } + /// This property is set only if the Pool automatically scales, i.e. enableAutoScale is true. + public AutoScaleRun AutoScaleRun { get; } + /// This imposes restrictions on which Compute Nodes can be assigned to the Pool. Specifying this value can reduce the chance of the requested number of Compute Nodes to be allocated in the Pool. + public bool? EnableInterNodeCommunication { get; } + /// The network configuration for a Pool. + public NetworkConfiguration NetworkConfiguration { get; } + /// Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. In some cases the StartTask may be re-run even though the Compute Node was not rebooted. Special care should be taken to avoid StartTasks which create breakaway process or install/launch services from the StartTask working directory, as this will block Batch from being able to re-run the StartTask. + public StartTask StartTask { get; } + /// + /// For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + /// + /// Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + public IReadOnlyList CertificateReferences { get; } + /// Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Package references on any given Pool. + public IReadOnlyList ApplicationPackageReferences { get; } + /// The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, Pool creation will fail. + public IReadOnlyList ApplicationLicenses { get; } + /// The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. + public int? TaskSlotsPerNode { get; } + /// If not specified, the default is spread. + public TaskSchedulingPolicy TaskSchedulingPolicy { get; } + /// The list of user Accounts to be created on each Compute Node in the Pool. + public IReadOnlyList UserAccounts { get; } + /// A list of name-value pairs associated with the Pool as metadata. + public IReadOnlyList Metadata { get; } + /// This property is populated only if the CloudPool was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. + public PoolStatistics Stats { get; } + /// This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. + public IReadOnlyList MountConfiguration { get; } + /// 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; } + /// If omitted, the default value is Default. + public NodeCommunicationMode? TargetNodeCommunicationMode { get; } + /// Determines how a pool communicates with the Batch service. + public NodeCommunicationMode? CurrentNodeCommunicationMode { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudPoolListResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudPoolListResult.Serialization.cs new file mode 100644 index 000000000000..9803d7e7f1f5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudPoolListResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class CloudPoolListResult + { + internal static CloudPoolListResult DeserializeCloudPoolListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CloudPool.DeserializeCloudPool(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new CloudPoolListResult(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudPoolListResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudPoolListResult.cs new file mode 100644 index 000000000000..c8a4dcd7472a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudPoolListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the Pools in an Account. + internal partial class CloudPoolListResult + { + /// Initializes a new instance of CloudPoolListResult. + internal CloudPoolListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of CloudPoolListResult. + /// The list of Pools. + /// The URL to get the next set of results. + internal CloudPoolListResult(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// The list of Pools. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudServiceConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudServiceConfiguration.Serialization.cs new file mode 100644 index 000000000000..0490103bcd69 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudServiceConfiguration.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class CloudServiceConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("osFamily"u8); + writer.WriteStringValue(OsFamily); + if (Optional.IsDefined(OsVersion)) + { + writer.WritePropertyName("osVersion"u8); + writer.WriteStringValue(OsVersion); + } + writer.WriteEndObject(); + } + + internal static CloudServiceConfiguration DeserializeCloudServiceConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string osFamily = default; + Optional osVersion = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("osFamily"u8)) + { + osFamily = property.Value.GetString(); + continue; + } + if (property.NameEquals("osVersion"u8)) + { + osVersion = property.Value.GetString(); + continue; + } + } + return new CloudServiceConfiguration(osFamily, osVersion.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudServiceConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudServiceConfiguration.cs new file mode 100644 index 000000000000..36e589892f08 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudServiceConfiguration.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The configuration for Compute Nodes in a Pool based on the Azure Cloud Services platform. + public partial class CloudServiceConfiguration + { + /// Initializes a new instance of CloudServiceConfiguration. + /// + /// Possible values are: + /// 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. + /// 3 - OS Family 3, equivalent to Windows Server 2012. + /// 4 - OS Family 4, equivalent to Windows Server 2012 R2. + /// 5 - OS Family 5, equivalent to Windows Server 2016. + /// 6 - OS Family 6, equivalent to Windows Server 2019. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). + /// + /// is null. + public CloudServiceConfiguration(string osFamily) + { + Argument.AssertNotNull(osFamily, nameof(osFamily)); + + OsFamily = osFamily; + } + + /// Initializes a new instance of CloudServiceConfiguration. + /// + /// Possible values are: + /// 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. + /// 3 - OS Family 3, equivalent to Windows Server 2012. + /// 4 - OS Family 4, equivalent to Windows Server 2012 R2. + /// 5 - OS Family 5, equivalent to Windows Server 2016. + /// 6 - OS Family 6, equivalent to Windows Server 2019. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). + /// + /// The default value is * which specifies the latest operating system version for the specified OS family. + internal CloudServiceConfiguration(string osFamily, string osVersion) + { + OsFamily = osFamily; + OsVersion = osVersion; + } + + /// + /// Possible values are: + /// 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. + /// 3 - OS Family 3, equivalent to Windows Server 2012. + /// 4 - OS Family 4, equivalent to Windows Server 2012 R2. + /// 5 - OS Family 5, equivalent to Windows Server 2016. + /// 6 - OS Family 6, equivalent to Windows Server 2019. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). + /// + public string OsFamily { get; set; } + /// The default value is * which specifies the latest operating system version for the specified OS family. + public string OsVersion { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTask.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTask.Serialization.cs new file mode 100644 index 000000000000..869b5ba7f4f4 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTask.Serialization.cs @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class CloudTask + { + internal static CloudTask DeserializeCloudTask(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional displayName = default; + Optional url = default; + Optional eTag = default; + Optional lastModified = default; + Optional creationTime = default; + Optional exitConditions = default; + Optional state = default; + Optional stateTransitionTime = default; + Optional previousState = default; + Optional previousStateTransitionTime = default; + Optional commandLine = default; + Optional containerSettings = default; + Optional> resourceFiles = default; + Optional> outputFiles = default; + Optional> environmentSettings = default; + Optional affinityInfo = default; + Optional constraints = default; + Optional requiredSlots = default; + Optional userIdentity = default; + Optional executionInfo = default; + Optional nodeInfo = default; + Optional multiInstanceSettings = default; + Optional stats = default; + Optional dependsOn = default; + Optional> applicationPackageReferences = default; + Optional authenticationTokenSettings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("eTag"u8)) + { + eTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastModified"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModified = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("exitConditions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exitConditions = ExitConditions.DeserializeExitConditions(property.Value); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = property.Value.GetString().ToTaskState(); + continue; + } + if (property.NameEquals("stateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("previousState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + previousState = property.Value.GetString().ToTaskState(); + continue; + } + if (property.NameEquals("previousStateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + previousStateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("commandLine"u8)) + { + commandLine = property.Value.GetString(); + continue; + } + if (property.NameEquals("containerSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerSettings = TaskContainerSettings.DeserializeTaskContainerSettings(property.Value); + continue; + } + if (property.NameEquals("resourceFiles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceFile.DeserializeResourceFile(item)); + } + resourceFiles = array; + continue; + } + if (property.NameEquals("outputFiles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFile.DeserializeOutputFile(item)); + } + outputFiles = array; + continue; + } + if (property.NameEquals("environmentSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EnvironmentSetting.DeserializeEnvironmentSetting(item)); + } + environmentSettings = array; + continue; + } + if (property.NameEquals("affinityInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affinityInfo = AffinityInformation.DeserializeAffinityInformation(property.Value); + continue; + } + if (property.NameEquals("constraints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + constraints = TaskConstraints.DeserializeTaskConstraints(property.Value); + continue; + } + if (property.NameEquals("requiredSlots"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + requiredSlots = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("userIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userIdentity = UserIdentity.DeserializeUserIdentity(property.Value); + continue; + } + if (property.NameEquals("executionInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + executionInfo = TaskExecutionInformation.DeserializeTaskExecutionInformation(property.Value); + continue; + } + if (property.NameEquals("nodeInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeInfo = ComputeNodeInformation.DeserializeComputeNodeInformation(property.Value); + continue; + } + if (property.NameEquals("multiInstanceSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + multiInstanceSettings = MultiInstanceSettings.DeserializeMultiInstanceSettings(property.Value); + continue; + } + if (property.NameEquals("stats"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stats = TaskStatistics.DeserializeTaskStatistics(property.Value); + continue; + } + if (property.NameEquals("dependsOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dependsOn = TaskDependencies.DeserializeTaskDependencies(property.Value); + continue; + } + if (property.NameEquals("applicationPackageReferences"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ApplicationPackageReference.DeserializeApplicationPackageReference(item)); + } + applicationPackageReferences = array; + continue; + } + if (property.NameEquals("authenticationTokenSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authenticationTokenSettings = AuthenticationTokenSettings.DeserializeAuthenticationTokenSettings(property.Value); + continue; + } + } + return new CloudTask(id.Value, displayName.Value, url.Value, eTag.Value, Optional.ToNullable(lastModified), Optional.ToNullable(creationTime), exitConditions.Value, Optional.ToNullable(state), Optional.ToNullable(stateTransitionTime), Optional.ToNullable(previousState), Optional.ToNullable(previousStateTransitionTime), commandLine.Value, containerSettings.Value, Optional.ToList(resourceFiles), Optional.ToList(outputFiles), Optional.ToList(environmentSettings), affinityInfo.Value, constraints.Value, Optional.ToNullable(requiredSlots), userIdentity.Value, executionInfo.Value, nodeInfo.Value, multiInstanceSettings.Value, stats.Value, dependsOn.Value, Optional.ToList(applicationPackageReferences), authenticationTokenSettings.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTask.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTask.cs new file mode 100644 index 000000000000..fa7f4214588d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTask.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. + public partial class CloudTask + { + /// Initializes a new instance of CloudTask. + internal CloudTask() + { + ResourceFiles = new ChangeTrackingList(); + OutputFiles = new ChangeTrackingList(); + EnvironmentSettings = new ChangeTrackingList(); + ApplicationPackageReferences = new ChangeTrackingList(); + } + + /// Initializes a new instance of CloudTask. + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. + /// The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + /// The URL of the Task. + /// This is an opaque string. You can use it to detect whether the Task has changed between requests. In particular, you can be pass the ETag when updating a Task to specify that your changes should take effect only if nobody else has modified the Task in the meantime. + /// The last modified time of the Task. + /// The creation time of the Task. + /// How the Batch service should respond when the Task completes. + /// The state of the Task. + /// The time at which the Task entered its current state. + /// This property is not set if the Task is in its initial Active state. + /// This property is not set if the Task is in its initial Active state. + /// For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + /// For multi-instance Tasks, the resource files will only be downloaded to the Compute Node on which the primary Task is executed. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. + /// For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. + /// A list of environment variable settings for the Task. + /// A locality hint that can be used by the Batch service to select a Compute Node on which to start a Task. + /// Execution constraints to apply to a Task. + /// 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. + /// If omitted, the Task runs as a non-administrative user unique to the Task. + /// Information about the execution of a Task. + /// Information about the Compute Node on which a Task ran. + /// Multi-instance Tasks are commonly used to support MPI Tasks. In the MPI case, if any of the subtasks fail (for example due to exiting with a non-zero exit code) the entire multi-instance Task fails. The multi-instance Task is then terminated and retried, up to its retry limit. + /// Resource usage statistics for a Task. + /// This Task will not be scheduled until all Tasks that it depends on have completed successfully. If any of those Tasks fail and exhaust their retry counts, this Task will never be scheduled. + /// Application packages are downloaded and deployed to a shared directory, not the Task working directory. Therefore, if a referenced package is already on the Node, and is up to date, then it is not re-downloaded; the existing copy on the Compute Node is used. If a referenced Package cannot be installed, for example because the package has been deleted or because download failed, the Task fails. + /// If this property is set, the Batch service provides the Task with an authentication token which can be used to authenticate Batch service operations without requiring an Account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the Task can carry out using the token depend on the settings. For example, a Task can request Job permissions in order to add other Tasks to the Job, or check the status of the Job or of other Tasks under the Job. + internal CloudTask(string id, string displayName, string url, string eTag, DateTimeOffset? lastModified, DateTimeOffset? creationTime, ExitConditions exitConditions, TaskState? state, DateTimeOffset? stateTransitionTime, TaskState? previousState, DateTimeOffset? previousStateTransitionTime, string commandLine, TaskContainerSettings containerSettings, IReadOnlyList resourceFiles, IReadOnlyList outputFiles, IReadOnlyList environmentSettings, AffinityInformation affinityInfo, TaskConstraints constraints, int? requiredSlots, UserIdentity userIdentity, TaskExecutionInformation executionInfo, ComputeNodeInformation nodeInfo, MultiInstanceSettings multiInstanceSettings, TaskStatistics stats, TaskDependencies dependsOn, IReadOnlyList applicationPackageReferences, AuthenticationTokenSettings authenticationTokenSettings) + { + Id = id; + DisplayName = displayName; + Url = url; + ETag = eTag; + LastModified = lastModified; + CreationTime = creationTime; + ExitConditions = exitConditions; + State = state; + StateTransitionTime = stateTransitionTime; + PreviousState = previousState; + PreviousStateTransitionTime = previousStateTransitionTime; + CommandLine = commandLine; + ContainerSettings = containerSettings; + ResourceFiles = resourceFiles; + OutputFiles = outputFiles; + EnvironmentSettings = environmentSettings; + AffinityInfo = affinityInfo; + Constraints = constraints; + RequiredSlots = requiredSlots; + UserIdentity = userIdentity; + ExecutionInfo = executionInfo; + NodeInfo = nodeInfo; + MultiInstanceSettings = multiInstanceSettings; + Stats = stats; + DependsOn = dependsOn; + ApplicationPackageReferences = applicationPackageReferences; + AuthenticationTokenSettings = authenticationTokenSettings; + } + + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. + public string Id { get; } + /// The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + public string DisplayName { get; } + /// The URL of the Task. + public string Url { get; } + /// This is an opaque string. You can use it to detect whether the Task has changed between requests. In particular, you can be pass the ETag when updating a Task to specify that your changes should take effect only if nobody else has modified the Task in the meantime. + public string ETag { get; } + /// The last modified time of the Task. + public DateTimeOffset? LastModified { get; } + /// The creation time of the Task. + public DateTimeOffset? CreationTime { get; } + /// How the Batch service should respond when the Task completes. + public ExitConditions ExitConditions { get; } + /// The state of the Task. + public TaskState? State { get; } + /// The time at which the Task entered its current state. + public DateTimeOffset? StateTransitionTime { get; } + /// This property is not set if the Task is in its initial Active state. + public TaskState? PreviousState { get; } + /// This property is not set if the Task is in its initial Active state. + public DateTimeOffset? PreviousStateTransitionTime { get; } + /// For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + public string CommandLine { get; } + /// If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + public TaskContainerSettings ContainerSettings { get; } + /// For multi-instance Tasks, the resource files will only be downloaded to the Compute Node on which the primary Task is executed. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. + public IReadOnlyList ResourceFiles { get; } + /// For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. + public IReadOnlyList OutputFiles { get; } + /// A list of environment variable settings for the Task. + public IReadOnlyList EnvironmentSettings { get; } + /// A locality hint that can be used by the Batch service to select a Compute Node on which to start a Task. + public AffinityInformation AffinityInfo { get; } + /// Execution constraints to apply to a Task. + public TaskConstraints Constraints { get; } + /// 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. + public int? RequiredSlots { get; } + /// If omitted, the Task runs as a non-administrative user unique to the Task. + public UserIdentity UserIdentity { get; } + /// Information about the execution of a Task. + public TaskExecutionInformation ExecutionInfo { get; } + /// Information about the Compute Node on which a Task ran. + public ComputeNodeInformation NodeInfo { get; } + /// Multi-instance Tasks are commonly used to support MPI Tasks. In the MPI case, if any of the subtasks fail (for example due to exiting with a non-zero exit code) the entire multi-instance Task fails. The multi-instance Task is then terminated and retried, up to its retry limit. + public MultiInstanceSettings MultiInstanceSettings { get; } + /// Resource usage statistics for a Task. + public TaskStatistics Stats { get; } + /// This Task will not be scheduled until all Tasks that it depends on have completed successfully. If any of those Tasks fail and exhaust their retry counts, this Task will never be scheduled. + public TaskDependencies DependsOn { get; } + /// Application packages are downloaded and deployed to a shared directory, not the Task working directory. Therefore, if a referenced package is already on the Node, and is up to date, then it is not re-downloaded; the existing copy on the Compute Node is used. If a referenced Package cannot be installed, for example because the package has been deleted or because download failed, the Task fails. + public IReadOnlyList ApplicationPackageReferences { get; } + /// If this property is set, the Batch service provides the Task with an authentication token which can be used to authenticate Batch service operations without requiring an Account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the Task can carry out using the token depend on the settings. For example, a Task can request Job permissions in order to add other Tasks to the Job, or check the status of the Job or of other Tasks under the Job. + public AuthenticationTokenSettings AuthenticationTokenSettings { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTaskListResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTaskListResult.Serialization.cs new file mode 100644 index 000000000000..7e34503eb925 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTaskListResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class CloudTaskListResult + { + internal static CloudTaskListResult DeserializeCloudTaskListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CloudTask.DeserializeCloudTask(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new CloudTaskListResult(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTaskListResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTaskListResult.cs new file mode 100644 index 000000000000..573750ca9d52 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTaskListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the Tasks in a Job. + internal partial class CloudTaskListResult + { + /// Initializes a new instance of CloudTaskListResult. + internal CloudTaskListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of CloudTaskListResult. + /// The list of Tasks. + /// The URL to get the next set of results. + internal CloudTaskListResult(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// The list of Tasks. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTaskListSubtasksResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTaskListSubtasksResult.Serialization.cs new file mode 100644 index 000000000000..64d37e27d3a3 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTaskListSubtasksResult.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class CloudTaskListSubtasksResult + { + internal static CloudTaskListSubtasksResult DeserializeCloudTaskListSubtasksResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SubtaskInformation.DeserializeSubtaskInformation(item)); + } + value = array; + continue; + } + } + return new CloudTaskListSubtasksResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTaskListSubtasksResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTaskListSubtasksResult.cs new file mode 100644 index 000000000000..2529dbb6b2cd --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/CloudTaskListSubtasksResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the subtasks of a Task. + public partial class CloudTaskListSubtasksResult + { + /// Initializes a new instance of CloudTaskListSubtasksResult. + internal CloudTaskListSubtasksResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of CloudTaskListSubtasksResult. + /// The list of subtasks. + internal CloudTaskListSubtasksResult(IReadOnlyList value) + { + Value = value; + } + + /// The list of subtasks. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNode.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNode.Serialization.cs new file mode 100644 index 000000000000..b925e2175660 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNode.Serialization.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ComputeNode + { + internal static ComputeNode DeserializeComputeNode(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional url = default; + Optional state = default; + Optional schedulingState = default; + Optional stateTransitionTime = default; + Optional lastBootTime = default; + Optional allocationTime = default; + Optional ipAddress = default; + Optional affinityId = default; + Optional vmSize = default; + Optional totalTasksRun = default; + Optional runningTasksCount = default; + Optional runningTaskSlotsCount = default; + Optional totalTasksSucceeded = default; + Optional> recentTasks = default; + Optional startTask = default; + Optional startTaskInfo = default; + Optional> certificateReferences = default; + Optional> errors = default; + Optional isDedicated = default; + Optional endpointConfiguration = default; + Optional nodeAgentInfo = default; + Optional virtualMachineInfo = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = property.Value.GetString().ToComputeNodeState(); + continue; + } + if (property.NameEquals("schedulingState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + schedulingState = property.Value.GetString().ToSchedulingState(); + continue; + } + if (property.NameEquals("stateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastBootTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastBootTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("allocationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("affinityId"u8)) + { + affinityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmSize"u8)) + { + vmSize = property.Value.GetString(); + continue; + } + if (property.NameEquals("totalTasksRun"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalTasksRun = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("runningTasksCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + runningTasksCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("runningTaskSlotsCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + runningTaskSlotsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("totalTasksSucceeded"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalTasksSucceeded = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("recentTasks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TaskInformation.DeserializeTaskInformation(item)); + } + recentTasks = array; + continue; + } + if (property.NameEquals("startTask"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTask = StartTask.DeserializeStartTask(property.Value); + continue; + } + if (property.NameEquals("startTaskInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTaskInfo = StartTaskInformation.DeserializeStartTaskInformation(property.Value); + continue; + } + if (property.NameEquals("certificateReferences"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CertificateReference.DeserializeCertificateReference(item)); + } + certificateReferences = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeNodeError.DeserializeComputeNodeError(item)); + } + errors = array; + continue; + } + if (property.NameEquals("isDedicated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDedicated = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("endpointConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointConfiguration = ComputeNodeEndpointConfiguration.DeserializeComputeNodeEndpointConfiguration(property.Value); + continue; + } + if (property.NameEquals("nodeAgentInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeAgentInfo = NodeAgentInformation.DeserializeNodeAgentInformation(property.Value); + continue; + } + if (property.NameEquals("virtualMachineInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + virtualMachineInfo = VirtualMachineInfo.DeserializeVirtualMachineInfo(property.Value); + continue; + } + } + return new ComputeNode(id.Value, url.Value, Optional.ToNullable(state), Optional.ToNullable(schedulingState), Optional.ToNullable(stateTransitionTime), Optional.ToNullable(lastBootTime), Optional.ToNullable(allocationTime), ipAddress.Value, affinityId.Value, vmSize.Value, Optional.ToNullable(totalTasksRun), Optional.ToNullable(runningTasksCount), Optional.ToNullable(runningTaskSlotsCount), Optional.ToNullable(totalTasksSucceeded), Optional.ToList(recentTasks), startTask.Value, startTaskInfo.Value, Optional.ToList(certificateReferences), Optional.ToList(errors), Optional.ToNullable(isDedicated), endpointConfiguration.Value, nodeAgentInfo.Value, virtualMachineInfo.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNode.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNode.cs new file mode 100644 index 000000000000..0bb652711429 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNode.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A Compute Node in the Batch service. + public partial class ComputeNode + { + /// Initializes a new instance of ComputeNode. + internal ComputeNode() + { + RecentTasks = new ChangeTrackingList(); + CertificateReferences = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of ComputeNode. + /// Every Compute Node that is added to a Pool is assigned a unique ID. Whenever a Compute Node is removed from a Pool, all of its local files are deleted, and the ID is reclaimed and could be reused for new Compute Nodes. + /// The URL of the Compute Node. + /// The Spot/Low-priority Compute Node has been preempted. Tasks which were running on the Compute Node when it was preempted will be rescheduled when another Compute Node becomes available. + /// Whether the Compute Node is available for Task scheduling. + /// The time at which the Compute Node entered its current state. + /// This property may not be present if the Compute Node state is unusable. + /// This is the time when the Compute Node was initially allocated and doesn't change once set. It is not updated when the Compute Node is service healed or preempted. + /// Every Compute Node that is added to a Pool is assigned a unique IP address. Whenever a Compute Node is removed from a Pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new Compute Nodes. + /// Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will be scheduled elsewhere. + /// For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The total number of Job Tasks completed on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. + /// The total number of currently running Job Tasks on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. + /// The total number of scheduling slots used by currently running Job Tasks on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. + /// The total number of Job Tasks which completed successfully (with exitCode 0) on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. + /// This property is present only if at least one Task has run on this Compute Node since it was assigned to the Pool. + /// Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. In some cases the StartTask may be re-run even though the Compute Node was not rebooted. Special care should be taken to avoid StartTasks which create breakaway process or install/launch services from the StartTask working directory, as this will block Batch from being able to re-run the StartTask. + /// Information about a StartTask running on a Compute Node. + /// + /// For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + /// + /// Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + /// The list of errors that are currently being encountered by the Compute Node. + /// Whether this Compute Node is a dedicated Compute Node. If false, the Compute Node is a Spot/Low-priority Compute Node. + /// The endpoint configuration for the Compute Node. + /// The Batch Compute Node agent is a program that runs on each Compute Node in the Pool and provides Batch capability on the Compute Node. + /// Info about the current state of the virtual machine. + internal ComputeNode(string id, string url, ComputeNodeState? state, SchedulingState? schedulingState, DateTimeOffset? stateTransitionTime, DateTimeOffset? lastBootTime, DateTimeOffset? allocationTime, string ipAddress, string affinityId, string vmSize, int? totalTasksRun, int? runningTasksCount, int? runningTaskSlotsCount, int? totalTasksSucceeded, IReadOnlyList recentTasks, StartTask startTask, StartTaskInformation startTaskInfo, IReadOnlyList certificateReferences, IReadOnlyList errors, bool? isDedicated, ComputeNodeEndpointConfiguration endpointConfiguration, NodeAgentInformation nodeAgentInfo, VirtualMachineInfo virtualMachineInfo) + { + Id = id; + Url = url; + State = state; + SchedulingState = schedulingState; + StateTransitionTime = stateTransitionTime; + LastBootTime = lastBootTime; + AllocationTime = allocationTime; + IpAddress = ipAddress; + AffinityId = affinityId; + VmSize = vmSize; + TotalTasksRun = totalTasksRun; + RunningTasksCount = runningTasksCount; + RunningTaskSlotsCount = runningTaskSlotsCount; + TotalTasksSucceeded = totalTasksSucceeded; + RecentTasks = recentTasks; + StartTask = startTask; + StartTaskInfo = startTaskInfo; + CertificateReferences = certificateReferences; + Errors = errors; + IsDedicated = isDedicated; + EndpointConfiguration = endpointConfiguration; + NodeAgentInfo = nodeAgentInfo; + VirtualMachineInfo = virtualMachineInfo; + } + + /// Every Compute Node that is added to a Pool is assigned a unique ID. Whenever a Compute Node is removed from a Pool, all of its local files are deleted, and the ID is reclaimed and could be reused for new Compute Nodes. + public string Id { get; } + /// The URL of the Compute Node. + public string Url { get; } + /// The Spot/Low-priority Compute Node has been preempted. Tasks which were running on the Compute Node when it was preempted will be rescheduled when another Compute Node becomes available. + public ComputeNodeState? State { get; } + /// Whether the Compute Node is available for Task scheduling. + public SchedulingState? SchedulingState { get; } + /// The time at which the Compute Node entered its current state. + public DateTimeOffset? StateTransitionTime { get; } + /// This property may not be present if the Compute Node state is unusable. + public DateTimeOffset? LastBootTime { get; } + /// This is the time when the Compute Node was initially allocated and doesn't change once set. It is not updated when the Compute Node is service healed or preempted. + public DateTimeOffset? AllocationTime { get; } + /// Every Compute Node that is added to a Pool is assigned a unique IP address. Whenever a Compute Node is removed from a Pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new Compute Nodes. + public string IpAddress { get; } + /// Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will be scheduled elsewhere. + public string AffinityId { get; } + /// For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + public string VmSize { get; } + /// The total number of Job Tasks completed on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. + public int? TotalTasksRun { get; } + /// The total number of currently running Job Tasks on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. + public int? RunningTasksCount { get; } + /// The total number of scheduling slots used by currently running Job Tasks on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. + public int? RunningTaskSlotsCount { get; } + /// The total number of Job Tasks which completed successfully (with exitCode 0) on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. + public int? TotalTasksSucceeded { get; } + /// This property is present only if at least one Task has run on this Compute Node since it was assigned to the Pool. + public IReadOnlyList RecentTasks { get; } + /// Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. In some cases the StartTask may be re-run even though the Compute Node was not rebooted. Special care should be taken to avoid StartTasks which create breakaway process or install/launch services from the StartTask working directory, as this will block Batch from being able to re-run the StartTask. + public StartTask StartTask { get; } + /// Information about a StartTask running on a Compute Node. + public StartTaskInformation StartTaskInfo { get; } + /// + /// For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + /// + /// Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + public IReadOnlyList CertificateReferences { get; } + /// The list of errors that are currently being encountered by the Compute Node. + public IReadOnlyList Errors { get; } + /// Whether this Compute Node is a dedicated Compute Node. If false, the Compute Node is a Spot/Low-priority Compute Node. + public bool? IsDedicated { get; } + /// The endpoint configuration for the Compute Node. + public ComputeNodeEndpointConfiguration EndpointConfiguration { get; } + /// The Batch Compute Node agent is a program that runs on each Compute Node in the Pool and provides Batch capability on the Compute Node. + public NodeAgentInformation NodeAgentInfo { get; } + /// Info about the current state of the virtual machine. + public VirtualMachineInfo VirtualMachineInfo { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeAddUserOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeAddUserOptions.cs new file mode 100644 index 000000000000..bae38fd3f53c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeAddUserOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeAddUserOptions + { + /// Initializes a new instance of ComputeNodeAddUserOptions. + public ComputeNodeAddUserOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeDeallocationOption.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeDeallocationOption.Serialization.cs new file mode 100644 index 000000000000..54612045ba0e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeDeallocationOption.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class ComputeNodeDeallocationOptionExtensions + { + public static string ToSerialString(this ComputeNodeDeallocationOption value) => value switch + { + ComputeNodeDeallocationOption.Requeue => "requeue", + ComputeNodeDeallocationOption.Terminate => "terminate", + ComputeNodeDeallocationOption.TaskCompletion => "taskcompletion", + ComputeNodeDeallocationOption.RetainedData => "retaineddata", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeNodeDeallocationOption value.") + }; + + public static ComputeNodeDeallocationOption ToComputeNodeDeallocationOption(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "requeue")) return ComputeNodeDeallocationOption.Requeue; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "terminate")) return ComputeNodeDeallocationOption.Terminate; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "taskcompletion")) return ComputeNodeDeallocationOption.TaskCompletion; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "retaineddata")) return ComputeNodeDeallocationOption.RetainedData; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeNodeDeallocationOption value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeDeallocationOption.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeDeallocationOption.cs new file mode 100644 index 000000000000..9ca96b877523 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeDeallocationOption.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The default value is requeue. + public enum ComputeNodeDeallocationOption + { + /// Terminate running Task processes and requeue the Tasks. The Tasks will run again when a Compute Node is available. Remove Compute Nodes as soon as Tasks have been terminated. + Requeue, + /// Terminate running Tasks. The Tasks will be completed with failureInfo indicating that they were terminated, and will not run again. Remove Compute Nodes as soon as Tasks have been terminated. + Terminate, + /// Allow currently running Tasks to complete. Schedule no new Tasks while waiting. Remove Compute Nodes when all Tasks have completed. + TaskCompletion, + /// Allow currently running Tasks to complete, then wait for all Task data retention periods to expire. Schedule no new Tasks while waiting. Remove Compute Nodes when all Task retention periods have expired. + RetainedData + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeDeleteUserOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeDeleteUserOptions.cs new file mode 100644 index 000000000000..96b4ab3fa5d3 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeDeleteUserOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeDeleteUserOptions + { + /// Initializes a new instance of ComputeNodeDeleteUserOptions. + public ComputeNodeDeleteUserOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeDisableSchedulingOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeDisableSchedulingOptions.cs new file mode 100644 index 000000000000..7a35bc850e73 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeDisableSchedulingOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeDisableSchedulingOptions + { + /// Initializes a new instance of ComputeNodeDisableSchedulingOptions. + public ComputeNodeDisableSchedulingOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeEnableSchedulingOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeEnableSchedulingOptions.cs new file mode 100644 index 000000000000..1cb1ee7fb6cc --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeEnableSchedulingOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeEnableSchedulingOptions + { + /// Initializes a new instance of ComputeNodeEnableSchedulingOptions. + public ComputeNodeEnableSchedulingOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeEndpointConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeEndpointConfiguration.Serialization.cs new file mode 100644 index 000000000000..4926e0c37c81 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeEndpointConfiguration.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ComputeNodeEndpointConfiguration + { + internal static ComputeNodeEndpointConfiguration DeserializeComputeNodeEndpointConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList inboundEndpoints = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("inboundEndpoints"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InboundEndpoint.DeserializeInboundEndpoint(item)); + } + inboundEndpoints = array; + continue; + } + } + return new ComputeNodeEndpointConfiguration(inboundEndpoints); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeEndpointConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeEndpointConfiguration.cs new file mode 100644 index 000000000000..849f6d12bc28 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeEndpointConfiguration.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The endpoint configuration for the Compute Node. + public partial class ComputeNodeEndpointConfiguration + { + /// Initializes a new instance of ComputeNodeEndpointConfiguration. + /// The list of inbound endpoints that are accessible on the Compute Node. + /// is null. + internal ComputeNodeEndpointConfiguration(IEnumerable inboundEndpoints) + { + Argument.AssertNotNull(inboundEndpoints, nameof(inboundEndpoints)); + + InboundEndpoints = inboundEndpoints.ToList(); + } + + /// Initializes a new instance of ComputeNodeEndpointConfiguration. + /// The list of inbound endpoints that are accessible on the Compute Node. + internal ComputeNodeEndpointConfiguration(IReadOnlyList inboundEndpoints) + { + InboundEndpoints = inboundEndpoints; + } + + /// The list of inbound endpoints that are accessible on the Compute Node. + public IReadOnlyList InboundEndpoints { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeError.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeError.Serialization.cs new file mode 100644 index 000000000000..1a557ab39412 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeError.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ComputeNodeError + { + internal static ComputeNodeError DeserializeComputeNodeError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional message = default; + Optional> errorDetails = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("errorDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePair.DeserializeNameValuePair(item)); + } + errorDetails = array; + continue; + } + } + return new ComputeNodeError(code.Value, message.Value, Optional.ToList(errorDetails)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeError.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeError.cs new file mode 100644 index 000000000000..db200c3894e5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeError.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// An error encountered by a Compute Node. + public partial class ComputeNodeError + { + /// Initializes a new instance of ComputeNodeError. + internal ComputeNodeError() + { + ErrorDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of ComputeNodeError. + /// An identifier for the Compute Node error. Codes are invariant and are intended to be consumed programmatically. + /// A message describing the Compute Node error, intended to be suitable for display in a user interface. + /// The list of additional error details related to the Compute Node error. + internal ComputeNodeError(string code, string message, IReadOnlyList errorDetails) + { + Code = code; + Message = message; + ErrorDetails = errorDetails; + } + + /// An identifier for the Compute Node error. Codes are invariant and are intended to be consumed programmatically. + public string Code { get; } + /// A message describing the Compute Node error, intended to be suitable for display in a user interface. + public string Message { get; } + /// The list of additional error details related to the Compute Node error. + public IReadOnlyList ErrorDetails { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeExtensionGetOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeExtensionGetOptions.cs new file mode 100644 index 000000000000..2f9f88137b3d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeExtensionGetOptions.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeExtensionGetOptions + { + /// Initializes a new instance of ComputeNodeExtensionGetOptions. + public ComputeNodeExtensionGetOptions() + { + } + + /// An OData $select clause. + public string Select { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeExtensionListOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeExtensionListOptions.cs new file mode 100644 index 000000000000..462f5ea26fbf --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeExtensionListOptions.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeExtensionListOptions + { + /// Initializes a new instance of ComputeNodeExtensionListOptions. + public ComputeNodeExtensionListOptions() + { + } + + /// An OData $select clause. + public string Select { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 Compute Nodes can be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeFillType.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeFillType.Serialization.cs new file mode 100644 index 000000000000..c7fd70de87ee --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeFillType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class ComputeNodeFillTypeExtensions + { + public static string ToSerialString(this ComputeNodeFillType value) => value switch + { + ComputeNodeFillType.Spread => "spread", + ComputeNodeFillType.Pack => "pack", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeNodeFillType value.") + }; + + public static ComputeNodeFillType ToComputeNodeFillType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "spread")) return ComputeNodeFillType.Spread; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "pack")) return ComputeNodeFillType.Pack; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeNodeFillType value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeFillType.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeFillType.cs new file mode 100644 index 000000000000..e2de79ced23f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeFillType.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// If not specified, the default is spread. + public enum ComputeNodeFillType + { + /// Tasks should be assigned evenly across all Compute Nodes in the Pool. + Spread, + /// As many Tasks as possible (taskSlotsPerNode) should be assigned to each Compute Node in the Pool before any Tasks are assigned to the next Compute Node in the Pool. + Pack + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetOptions.cs new file mode 100644 index 000000000000..a66479bf8fac --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetOptions.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeGetOptions + { + /// Initializes a new instance of ComputeNodeGetOptions. + public ComputeNodeGetOptions() + { + } + + /// An OData $select clause. + public string Select { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetRemoteDesktopOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetRemoteDesktopOptions.cs new file mode 100644 index 000000000000..655402a1a9a4 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetRemoteDesktopOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeGetRemoteDesktopOptions + { + /// Initializes a new instance of ComputeNodeGetRemoteDesktopOptions. + public ComputeNodeGetRemoteDesktopOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetRemoteLoginSettingsOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetRemoteLoginSettingsOptions.cs new file mode 100644 index 000000000000..c32fbead6a28 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetRemoteLoginSettingsOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeGetRemoteLoginSettingsOptions + { + /// Initializes a new instance of ComputeNodeGetRemoteLoginSettingsOptions. + public ComputeNodeGetRemoteLoginSettingsOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetRemoteLoginSettingsResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetRemoteLoginSettingsResult.Serialization.cs new file mode 100644 index 000000000000..7de8f9de0336 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetRemoteLoginSettingsResult.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ComputeNodeGetRemoteLoginSettingsResult + { + internal static ComputeNodeGetRemoteLoginSettingsResult DeserializeComputeNodeGetRemoteLoginSettingsResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string remoteLoginIPAddress = default; + int remoteLoginPort = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("remoteLoginIPAddress"u8)) + { + remoteLoginIPAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("remoteLoginPort"u8)) + { + remoteLoginPort = property.Value.GetInt32(); + continue; + } + } + return new ComputeNodeGetRemoteLoginSettingsResult(remoteLoginIPAddress, remoteLoginPort); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetRemoteLoginSettingsResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetRemoteLoginSettingsResult.cs new file mode 100644 index 000000000000..4188120254a8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeGetRemoteLoginSettingsResult.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The remote login settings for a Compute Node. + public partial class ComputeNodeGetRemoteLoginSettingsResult + { + /// Initializes a new instance of ComputeNodeGetRemoteLoginSettingsResult. + /// The IP address used for remote login to the Compute Node. + /// The port used for remote login to the Compute Node. + /// is null. + internal ComputeNodeGetRemoteLoginSettingsResult(string remoteLoginIPAddress, int remoteLoginPort) + { + Argument.AssertNotNull(remoteLoginIPAddress, nameof(remoteLoginIPAddress)); + + RemoteLoginIPAddress = remoteLoginIPAddress; + RemoteLoginPort = remoteLoginPort; + } + + /// The IP address used for remote login to the Compute Node. + public string RemoteLoginIPAddress { get; } + /// The port used for remote login to the Compute Node. + public int RemoteLoginPort { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeIdentityReference.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeIdentityReference.Serialization.cs new file mode 100644 index 000000000000..bdede9081f8c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeIdentityReference.Serialization.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ComputeNodeIdentityReference : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + writer.WriteEndObject(); + } + + internal static ComputeNodeIdentityReference DeserializeComputeNodeIdentityReference(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional resourceId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + } + return new ComputeNodeIdentityReference(resourceId.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeIdentityReference.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeIdentityReference.cs new file mode 100644 index 000000000000..27b919683b25 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeIdentityReference.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// 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 ComputeNodeIdentityReference. + public ComputeNodeIdentityReference() + { + } + + /// Initializes a new instance of ComputeNodeIdentityReference. + /// The ARM resource id of the user assigned identity. + internal ComputeNodeIdentityReference(string resourceId) + { + ResourceId = resourceId; + } + + /// The ARM resource id of the user assigned identity. + public string ResourceId { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeInformation.Serialization.cs new file mode 100644 index 000000000000..fa0e88eeffdf --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeInformation.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ComputeNodeInformation + { + internal static ComputeNodeInformation DeserializeComputeNodeInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional affinityId = default; + Optional nodeUrl = default; + Optional poolId = default; + Optional nodeId = default; + Optional taskRootDirectory = default; + Optional taskRootDirectoryUrl = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("affinityId"u8)) + { + affinityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("nodeUrl"u8)) + { + nodeUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("poolId"u8)) + { + poolId = property.Value.GetString(); + continue; + } + if (property.NameEquals("nodeId"u8)) + { + nodeId = property.Value.GetString(); + continue; + } + if (property.NameEquals("taskRootDirectory"u8)) + { + taskRootDirectory = property.Value.GetString(); + continue; + } + if (property.NameEquals("taskRootDirectoryUrl"u8)) + { + taskRootDirectoryUrl = property.Value.GetString(); + continue; + } + } + return new ComputeNodeInformation(affinityId.Value, nodeUrl.Value, poolId.Value, nodeId.Value, taskRootDirectory.Value, taskRootDirectoryUrl.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeInformation.cs new file mode 100644 index 000000000000..923d7d3f8fbd --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeInformation.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Information about the Compute Node on which a Task ran. + public partial class ComputeNodeInformation + { + /// Initializes a new instance of ComputeNodeInformation. + internal ComputeNodeInformation() + { + } + + /// Initializes a new instance of ComputeNodeInformation. + /// An identifier for the Node on which the Task ran, which can be passed when adding a Task to request that the Task be scheduled on this Compute Node. + /// The URL of the Compute Node on which the Task ran. + /// The ID of the Pool on which the Task ran. + /// The ID of the Compute Node on which the Task ran. + /// The root directory of the Task on the Compute Node. + /// The URL to the root directory of the Task on the Compute Node. + internal ComputeNodeInformation(string affinityId, string nodeUrl, string poolId, string nodeId, string taskRootDirectory, string taskRootDirectoryUrl) + { + AffinityId = affinityId; + NodeUrl = nodeUrl; + PoolId = poolId; + NodeId = nodeId; + TaskRootDirectory = taskRootDirectory; + TaskRootDirectoryUrl = taskRootDirectoryUrl; + } + + /// An identifier for the Node on which the Task ran, which can be passed when adding a Task to request that the Task be scheduled on this Compute Node. + public string AffinityId { get; } + /// The URL of the Compute Node on which the Task ran. + public string NodeUrl { get; } + /// The ID of the Pool on which the Task ran. + public string PoolId { get; } + /// The ID of the Compute Node on which the Task ran. + public string NodeId { get; } + /// The root directory of the Task on the Compute Node. + public string TaskRootDirectory { get; } + /// The URL to the root directory of the Task on the Compute Node. + public string TaskRootDirectoryUrl { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeListOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeListOptions.cs new file mode 100644 index 000000000000..987ca8c07bcb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeListOptions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeListOptions + { + /// Initializes a new instance of ComputeNodeListOptions. + public ComputeNodeListOptions() + { + } + + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. + public string Filter { get; set; } + /// An OData $select clause. + public string Select { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 Compute Nodes can be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeListResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeListResult.Serialization.cs new file mode 100644 index 000000000000..d041dd1933f1 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeListResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class ComputeNodeListResult + { + internal static ComputeNodeListResult DeserializeComputeNodeListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeNode.DeserializeComputeNode(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new ComputeNodeListResult(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeListResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeListResult.cs new file mode 100644 index 000000000000..de45d8039d3f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the Compute Nodes in a Pool. + internal partial class ComputeNodeListResult + { + /// Initializes a new instance of ComputeNodeListResult. + internal ComputeNodeListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ComputeNodeListResult. + /// The list of Compute Nodes. + /// The URL to get the next set of results. + internal ComputeNodeListResult(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// The list of Compute Nodes. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeRebootOption.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeRebootOption.Serialization.cs new file mode 100644 index 000000000000..4f14dd15db39 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeRebootOption.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class ComputeNodeRebootOptionExtensions + { + public static string ToSerialString(this ComputeNodeRebootOption value) => value switch + { + ComputeNodeRebootOption.Requeue => "requeue", + ComputeNodeRebootOption.Terminate => "terminate", + ComputeNodeRebootOption.TaskCompletion => "taskcompletion", + ComputeNodeRebootOption.RetainedData => "retaineddata", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeNodeRebootOption value.") + }; + + public static ComputeNodeRebootOption ToComputeNodeRebootOption(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "requeue")) return ComputeNodeRebootOption.Requeue; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "terminate")) return ComputeNodeRebootOption.Terminate; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "taskcompletion")) return ComputeNodeRebootOption.TaskCompletion; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "retaineddata")) return ComputeNodeRebootOption.RetainedData; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeNodeRebootOption value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeRebootOption.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeRebootOption.cs new file mode 100644 index 000000000000..d31bc5217937 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeRebootOption.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The default value is requeue. + public enum ComputeNodeRebootOption + { + /// Terminate running Task processes and requeue the Tasks. The Tasks will run again when a Compute Node is available. Restart the Compute Node as soon as Tasks have been terminated. + Requeue, + /// Terminate running Tasks. The Tasks will be completed with failureInfo indicating that they were terminated, and will not run again. Restart the Compute Node as soon as Tasks have been terminated. + Terminate, + /// Allow currently running Tasks to complete. Schedule no new Tasks while waiting. Restart the Compute Node when all Tasks have completed. + TaskCompletion, + /// Allow currently running Tasks to complete, then wait for all Task data retention periods to expire. Schedule no new Tasks while waiting. Restart the Compute Node when all Task retention periods have expired. + RetainedData + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeRebootOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeRebootOptions.cs new file mode 100644 index 000000000000..eb661242b2a5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeRebootOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeRebootOptions + { + /// Initializes a new instance of ComputeNodeRebootOptions. + public ComputeNodeRebootOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeReimageOption.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeReimageOption.Serialization.cs new file mode 100644 index 000000000000..65b98efff825 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeReimageOption.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class ComputeNodeReimageOptionExtensions + { + public static string ToSerialString(this ComputeNodeReimageOption value) => value switch + { + ComputeNodeReimageOption.Requeue => "requeue", + ComputeNodeReimageOption.Terminate => "terminate", + ComputeNodeReimageOption.TaskCompletion => "taskcompletion", + ComputeNodeReimageOption.RetainedData => "retaineddata", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeNodeReimageOption value.") + }; + + public static ComputeNodeReimageOption ToComputeNodeReimageOption(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "requeue")) return ComputeNodeReimageOption.Requeue; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "terminate")) return ComputeNodeReimageOption.Terminate; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "taskcompletion")) return ComputeNodeReimageOption.TaskCompletion; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "retaineddata")) return ComputeNodeReimageOption.RetainedData; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeNodeReimageOption value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeReimageOption.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeReimageOption.cs new file mode 100644 index 000000000000..f8aa2d043764 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeReimageOption.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The default value is requeue. + public enum ComputeNodeReimageOption + { + /// Terminate running Task processes and requeue the Tasks. The Tasks will run again when a Compute Node is available. Reimage the Compute Node as soon as Tasks have been terminated. + Requeue, + /// Terminate running Tasks. The Tasks will be completed with failureInfo indicating that they were terminated, and will not run again. Reimage the Compute Node as soon as Tasks have been terminated. + Terminate, + /// Allow currently running Tasks to complete. Schedule no new Tasks while waiting. Reimage the Compute Node when all Tasks have completed. + TaskCompletion, + /// Allow currently running Tasks to complete, then wait for all Task data retention periods to expire. Schedule no new Tasks while waiting. Reimage the Compute Node when all Task retention periods have expired. + RetainedData + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeReimageOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeReimageOptions.cs new file mode 100644 index 000000000000..14f4a1505295 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeReimageOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeReimageOptions + { + /// Initializes a new instance of ComputeNodeReimageOptions. + public ComputeNodeReimageOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeState.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeState.Serialization.cs new file mode 100644 index 000000000000..55a2d84bc783 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeState.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class ComputeNodeStateExtensions + { + public static string ToSerialString(this ComputeNodeState value) => value switch + { + ComputeNodeState.Idle => "idle", + ComputeNodeState.Rebooting => "rebooting", + ComputeNodeState.Reimaging => "reimaging", + ComputeNodeState.Running => "running", + ComputeNodeState.Unusable => "unusable", + ComputeNodeState.Creating => "creating", + ComputeNodeState.Starting => "starting", + ComputeNodeState.WaitingForStartTask => "waitingforstarttask", + ComputeNodeState.StartTaskFailed => "starttaskfailed", + ComputeNodeState.Unknown => "unknown", + ComputeNodeState.LeavingPool => "leavingpool", + ComputeNodeState.Offline => "offline", + ComputeNodeState.Preempted => "preempted", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeNodeState value.") + }; + + public static ComputeNodeState ToComputeNodeState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "idle")) return ComputeNodeState.Idle; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "rebooting")) return ComputeNodeState.Rebooting; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "reimaging")) return ComputeNodeState.Reimaging; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "running")) return ComputeNodeState.Running; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "unusable")) return ComputeNodeState.Unusable; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "creating")) return ComputeNodeState.Creating; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "starting")) return ComputeNodeState.Starting; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "waitingforstarttask")) return ComputeNodeState.WaitingForStartTask; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "starttaskfailed")) return ComputeNodeState.StartTaskFailed; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "unknown")) return ComputeNodeState.Unknown; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "leavingpool")) return ComputeNodeState.LeavingPool; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "offline")) return ComputeNodeState.Offline; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "preempted")) return ComputeNodeState.Preempted; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeNodeState value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeState.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeState.cs new file mode 100644 index 000000000000..ed5e87084bc8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeState.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The Spot/Low-priority Compute Node has been preempted. Tasks which were running on the Compute Node when it was preempted will be rescheduled when another Compute Node becomes available. + public enum ComputeNodeState + { + /// The Compute Node is not currently running a Task. + Idle, + /// The Compute Node is rebooting. + Rebooting, + /// The Compute Node is reimaging. + Reimaging, + /// The Compute Node is running one or more Tasks (other than a StartTask). + Running, + /// The Compute Node cannot be used for Task execution due to errors. + Unusable, + /// The Batch service has obtained the underlying virtual machine from Azure Compute, but it has not yet started to join the Pool. + Creating, + /// The Batch service is starting on the underlying virtual machine. + Starting, + /// The StartTask has started running on the Compute Node, but waitForSuccess is set and the StartTask has not yet completed. + WaitingForStartTask, + /// The StartTask has failed on the Compute Node (and exhausted all retries), and waitForSuccess is set. The Compute Node is not usable for running Tasks. + StartTaskFailed, + /// The Batch service has lost contact with the Compute Node, and does not know its true state. + Unknown, + /// The Compute Node is leaving the Pool, either because the user explicitly removed it or because the Pool is resizing or autoscaling down. + LeavingPool, + /// The Compute Node is not currently running a Task, and scheduling of new Tasks to the Compute Node is disabled. + Offline, + /// The Spot/Low-priority Compute Node has been preempted. Tasks which were running on the Compute Node when it was preempted will be rescheduled when another Compute Node becomes available. + Preempted + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeUpdateUserOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeUpdateUserOptions.cs new file mode 100644 index 000000000000..50c8bb0a693a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeUpdateUserOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeUpdateUserOptions + { + /// Initializes a new instance of ComputeNodeUpdateUserOptions. + public ComputeNodeUpdateUserOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeUploadBatchServiceLogsOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeUploadBatchServiceLogsOptions.cs new file mode 100644 index 000000000000..5a708658bfaa --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeUploadBatchServiceLogsOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class ComputeNodeUploadBatchServiceLogsOptions + { + /// Initializes a new instance of ComputeNodeUploadBatchServiceLogsOptions. + public ComputeNodeUploadBatchServiceLogsOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeUser.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeUser.Serialization.cs new file mode 100644 index 000000000000..453ab00c0540 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeUser.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ComputeNodeUser : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(IsAdmin)) + { + writer.WritePropertyName("isAdmin"u8); + writer.WriteBooleanValue(IsAdmin.Value); + } + if (Optional.IsDefined(ExpiryTime)) + { + writer.WritePropertyName("expiryTime"u8); + writer.WriteStringValue(ExpiryTime.Value, "O"); + } + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + if (Optional.IsDefined(SshPublicKey)) + { + writer.WritePropertyName("sshPublicKey"u8); + writer.WriteStringValue(SshPublicKey); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeUser.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeUser.cs new file mode 100644 index 000000000000..baef1d63481b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ComputeNodeUser.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A user Account for RDP or SSH access on a Compute Node. + public partial class ComputeNodeUser + { + /// Initializes a new instance of ComputeNodeUser. + /// The user name of the Account. + /// is null. + public ComputeNodeUser(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// The user name of the Account. + public string Name { get; } + /// The default value is false. + public bool? IsAdmin { get; set; } + /// If omitted, the default is 1 day from the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. + public DateTimeOffset? ExpiryTime { get; set; } + /// The password is required for Windows Compute Nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows Image reference). For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. + public string Password { get; set; } + /// The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux Compute Nodes. If this is specified for a Windows Compute Node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public string SshPublicKey { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerConfiguration.Serialization.cs new file mode 100644 index 000000000000..ac00218efc70 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerConfiguration.Serialization.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ContainerConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsCollectionDefined(ContainerImageNames)) + { + writer.WritePropertyName("containerImageNames"u8); + writer.WriteStartArray(); + foreach (var item in ContainerImageNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ContainerRegistries)) + { + writer.WritePropertyName("containerRegistries"u8); + writer.WriteStartArray(); + foreach (var item in ContainerRegistries) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static ContainerConfiguration DeserializeContainerConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerType type = default; + Optional> containerImageNames = default; + Optional> containerRegistries = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new ContainerType(property.Value.GetString()); + continue; + } + if (property.NameEquals("containerImageNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + containerImageNames = array; + continue; + } + if (property.NameEquals("containerRegistries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistry.DeserializeContainerRegistry(item)); + } + containerRegistries = array; + continue; + } + } + return new ContainerConfiguration(type, Optional.ToList(containerImageNames), Optional.ToList(containerRegistries)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerConfiguration.cs new file mode 100644 index 000000000000..fdc517bdcd4e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerConfiguration.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The configuration for container-enabled Pools. + public partial class ContainerConfiguration + { + /// Initializes a new instance of ContainerConfiguration. + /// The container technology to be used. + public ContainerConfiguration(ContainerType type) + { + Type = type; + ContainerImageNames = new ChangeTrackingList(); + ContainerRegistries = new ChangeTrackingList(); + } + + /// Initializes a new instance of ContainerConfiguration. + /// The container technology to be used. + /// This is the full Image reference, as would be specified to "docker pull". An Image will be sourced from the default Docker registry unless the Image is fully qualified with an alternative registry. + /// If any Images must be downloaded from a private registry which requires credentials, then those credentials must be provided here. + internal ContainerConfiguration(ContainerType type, IList containerImageNames, IList containerRegistries) + { + Type = type; + ContainerImageNames = containerImageNames; + ContainerRegistries = containerRegistries; + } + + /// The container technology to be used. + public ContainerType Type { get; set; } + /// This is the full Image reference, as would be specified to "docker pull". An Image will be sourced from the default Docker registry unless the Image is fully qualified with an alternative registry. + public IList ContainerImageNames { get; } + /// If any Images must be downloaded from a private registry which requires credentials, then those credentials must be provided here. + public IList ContainerRegistries { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerRegistry.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerRegistry.Serialization.cs new file mode 100644 index 000000000000..e221d653f42a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerRegistry.Serialization.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ContainerRegistry : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(UserName)) + { + writer.WritePropertyName("username"u8); + writer.WriteStringValue(UserName); + } + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + if (Optional.IsDefined(RegistryServer)) + { + writer.WritePropertyName("registryServer"u8); + writer.WriteStringValue(RegistryServer); + } + if (Optional.IsDefined(IdentityReference)) + { + writer.WritePropertyName("identityReference"u8); + writer.WriteObjectValue(IdentityReference); + } + writer.WriteEndObject(); + } + + internal static ContainerRegistry DeserializeContainerRegistry(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional username = default; + Optional password = default; + Optional registryServer = default; + Optional identityReference = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("username"u8)) + { + username = property.Value.GetString(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("registryServer"u8)) + { + registryServer = property.Value.GetString(); + continue; + } + if (property.NameEquals("identityReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityReference = ComputeNodeIdentityReference.DeserializeComputeNodeIdentityReference(property.Value); + continue; + } + } + return new ContainerRegistry(username.Value, password.Value, registryServer.Value, identityReference.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerRegistry.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerRegistry.cs new file mode 100644 index 000000000000..6d611ec9850a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerRegistry.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// A private container registry. + public partial class ContainerRegistry + { + /// Initializes a new instance of ContainerRegistry. + public ContainerRegistry() + { + } + + /// Initializes a new instance of ContainerRegistry. + /// The user name to log into the registry server. + /// The password to log into the registry server. + /// If omitted, the default is "docker.io". + /// The reference to a user assigned identity associated with the Batch pool which a compute node will use. + internal ContainerRegistry(string userName, string password, string registryServer, ComputeNodeIdentityReference identityReference) + { + UserName = userName; + Password = password; + RegistryServer = registryServer; + IdentityReference = identityReference; + } + + /// The user name to log into the registry server. + public string UserName { get; set; } + /// The password to log into the registry server. + public string Password { get; set; } + /// If omitted, the default is "docker.io". + public string RegistryServer { get; set; } + /// The reference to a user assigned identity associated with the Batch pool which a compute node will use. + public ComputeNodeIdentityReference IdentityReference { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerType.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerType.cs new file mode 100644 index 000000000000..735256d441a3 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Temp.Batch.Models +{ + /// The container technology to be used. + public readonly partial struct ContainerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DockerCompatibleValue = "dockerCompatible"; + private const string CriCompatibleValue = "criCompatible"; + + /// A Docker compatible container technology will be used to launch the containers. + public static ContainerType DockerCompatible { get; } = new ContainerType(DockerCompatibleValue); + /// A CRI based technology will be used to launch the containers. + public static ContainerType CriCompatible { get; } = new ContainerType(CriCompatibleValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerType left, ContainerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerType left, ContainerType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ContainerType(string value) => new ContainerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerType other && Equals(other); + /// + public bool Equals(ContainerType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerWorkingDirectory.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerWorkingDirectory.Serialization.cs new file mode 100644 index 000000000000..870b3710d512 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerWorkingDirectory.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class ContainerWorkingDirectoryExtensions + { + public static string ToSerialString(this ContainerWorkingDirectory value) => value switch + { + ContainerWorkingDirectory.TaskWorkingDirectory => "taskWorkingDirectory", + ContainerWorkingDirectory.ContainerImageDefault => "containerImageDefault", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ContainerWorkingDirectory value.") + }; + + public static ContainerWorkingDirectory ToContainerWorkingDirectory(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "taskWorkingDirectory")) return ContainerWorkingDirectory.TaskWorkingDirectory; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "containerImageDefault")) return ContainerWorkingDirectory.ContainerImageDefault; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ContainerWorkingDirectory value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerWorkingDirectory.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerWorkingDirectory.cs new file mode 100644 index 000000000000..5701a7659962 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ContainerWorkingDirectory.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The default is 'taskWorkingDirectory'. + public enum ContainerWorkingDirectory + { + /// Use the standard Batch service Task working directory, which will contain the Task Resource Files populated by Batch. + TaskWorkingDirectory, + /// Use the working directory defined in the container Image. Beware that this directory will not contain the Resource Files downloaded by Batch. + ContainerImageDefault + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DataDisk.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DataDisk.Serialization.cs new file mode 100644 index 000000000000..7fd8975a7ede --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DataDisk.Serialization.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class DataDisk : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("lun"u8); + writer.WriteNumberValue(Lun); + if (Optional.IsDefined(Caching)) + { + writer.WritePropertyName("caching"u8); + writer.WriteStringValue(Caching.Value.ToSerialString()); + } + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeGB); + if (Optional.IsDefined(StorageAccountType)) + { + writer.WritePropertyName("storageAccountType"u8); + writer.WriteStringValue(StorageAccountType.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + internal static DataDisk DeserializeDataDisk(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int lun = default; + Optional caching = default; + int diskSizeGB = default; + Optional storageAccountType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lun"u8)) + { + lun = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("caching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + caching = property.Value.GetString().ToCachingType(); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + diskSizeGB = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("storageAccountType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageAccountType = property.Value.GetString().ToStorageAccountType(); + continue; + } + } + return new DataDisk(lun, Optional.ToNullable(caching), diskSizeGB, Optional.ToNullable(storageAccountType)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DataDisk.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DataDisk.cs new file mode 100644 index 000000000000..df0f313d92bf --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DataDisk.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Settings which will be used by the data disks associated to Compute Nodes in the Pool. When using attached data disks, you need to mount and format the disks from within a VM to use them. + public partial class DataDisk + { + /// Initializes a new instance of DataDisk. + /// The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. The value must be between 0 and 63, inclusive. + /// The initial disk size in gigabytes. + public DataDisk(int lun, int diskSizeGB) + { + Lun = lun; + DiskSizeGB = diskSizeGB; + } + + /// Initializes a new instance of DataDisk. + /// The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. The value must be between 0 and 63, inclusive. + /// The default value for caching is readwrite. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. + /// The initial disk size in gigabytes. + /// If omitted, the default is "standard_lrs". + internal DataDisk(int lun, CachingType? caching, int diskSizeGB, StorageAccountType? storageAccountType) + { + Lun = lun; + Caching = caching; + DiskSizeGB = diskSizeGB; + StorageAccountType = storageAccountType; + } + + /// The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. The value must be between 0 and 63, inclusive. + public int Lun { get; set; } + /// The default value for caching is readwrite. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. + public CachingType? Caching { get; set; } + /// The initial disk size in gigabytes. + public int DiskSizeGB { get; set; } + /// If omitted, the default is "standard_lrs". + public StorageAccountType? StorageAccountType { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DeleteCertificateError.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DeleteCertificateError.Serialization.cs new file mode 100644 index 000000000000..7ef72fdf3383 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DeleteCertificateError.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class DeleteCertificateError + { + internal static DeleteCertificateError DeserializeDeleteCertificateError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional message = default; + Optional> values = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("values"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePair.DeserializeNameValuePair(item)); + } + values = array; + continue; + } + } + return new DeleteCertificateError(code.Value, message.Value, Optional.ToList(values)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DeleteCertificateError.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DeleteCertificateError.cs new file mode 100644 index 000000000000..641cec0b9f71 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DeleteCertificateError.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// An error encountered by the Batch service when deleting a Certificate. + public partial class DeleteCertificateError + { + /// Initializes a new instance of DeleteCertificateError. + internal DeleteCertificateError() + { + Values = new ChangeTrackingList(); + } + + /// Initializes a new instance of DeleteCertificateError. + /// An identifier for the Certificate deletion error. Codes are invariant and are intended to be consumed programmatically. + /// A message describing the Certificate deletion error, intended to be suitable for display in a user interface. + /// This list includes details such as the active Pools and Compute Nodes referencing this Certificate. However, if a large number of resources reference the Certificate, the list contains only about the first hundred. + internal DeleteCertificateError(string code, string message, IReadOnlyList values) + { + Code = code; + Message = message; + Values = values; + } + + /// An identifier for the Certificate deletion error. Codes are invariant and are intended to be consumed programmatically. + public string Code { get; } + /// A message describing the Certificate deletion error, intended to be suitable for display in a user interface. + public string Message { get; } + /// This list includes details such as the active Pools and Compute Nodes referencing this Certificate. However, if a large number of resources reference the Certificate, the list contains only about the first hundred. + public IReadOnlyList Values { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DependencyAction.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DependencyAction.Serialization.cs new file mode 100644 index 000000000000..69191394010f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DependencyAction.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class DependencyActionExtensions + { + public static string ToSerialString(this DependencyAction value) => value switch + { + DependencyAction.Satisfy => "satisfy", + DependencyAction.Block => "block", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DependencyAction value.") + }; + + public static DependencyAction ToDependencyAction(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "satisfy")) return DependencyAction.Satisfy; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "block")) return DependencyAction.Block; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DependencyAction value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DependencyAction.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DependencyAction.cs new file mode 100644 index 000000000000..d83c135b2291 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DependencyAction.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Possible values are 'satisfy' (allowing dependent tasks to progress) and 'block' (dependent tasks continue to wait). Batch does not yet support cancellation of dependent tasks. + public enum DependencyAction + { + /// Satisfy tasks waiting on this task; once all dependencies are satisfied, the task will be scheduled to run. + Satisfy, + /// Blocks tasks waiting on this task, preventing them from being scheduled. + Block + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiffDiskPlacement.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiffDiskPlacement.cs new file mode 100644 index 000000000000..4690acd60f1b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiffDiskPlacement.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Temp.Batch.Models +{ + /// 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 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 readonly partial struct DiffDiskPlacement : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DiffDiskPlacement(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CacheDiskValue = "CacheDisk"; + + /// CacheDisk. + public static DiffDiskPlacement CacheDisk { get; } = new DiffDiskPlacement(CacheDiskValue); + /// Determines if two values are the same. + public static bool operator ==(DiffDiskPlacement left, DiffDiskPlacement right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DiffDiskPlacement left, DiffDiskPlacement right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DiffDiskPlacement(string value) => new DiffDiskPlacement(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DiffDiskPlacement other && Equals(other); + /// + public bool Equals(DiffDiskPlacement other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiffDiskSettings.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiffDiskSettings.Serialization.cs new file mode 100644 index 000000000000..aba8be5494cc --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiffDiskSettings.Serialization.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class DiffDiskSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Placement)) + { + writer.WritePropertyName("placement"u8); + writer.WriteStringValue(Placement.Value.ToString()); + } + writer.WriteEndObject(); + } + + internal static DiffDiskSettings DeserializeDiffDiskSettings(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional placement = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("placement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + placement = new DiffDiskPlacement(property.Value.GetString()); + continue; + } + } + return new DiffDiskSettings(Optional.ToNullable(placement)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiffDiskSettings.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiffDiskSettings.cs new file mode 100644 index 000000000000..f4329f5d4967 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiffDiskSettings.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// 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 DiffDiskSettings. + public DiffDiskSettings() + { + } + + /// Initializes a new instance of DiffDiskSettings. + /// 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. + internal DiffDiskSettings(DiffDiskPlacement? placement) + { + Placement = placement; + } + + /// 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 DiffDiskPlacement? Placement { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DisableComputeNodeSchedulingOption.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DisableComputeNodeSchedulingOption.Serialization.cs new file mode 100644 index 000000000000..d21d5e808cd1 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DisableComputeNodeSchedulingOption.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class DisableComputeNodeSchedulingOptionExtensions + { + public static string ToSerialString(this DisableComputeNodeSchedulingOption value) => value switch + { + DisableComputeNodeSchedulingOption.Requeue => "requeue", + DisableComputeNodeSchedulingOption.Terminate => "terminate", + DisableComputeNodeSchedulingOption.TaskCompletion => "taskcompletion", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DisableComputeNodeSchedulingOption value.") + }; + + public static DisableComputeNodeSchedulingOption ToDisableComputeNodeSchedulingOption(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "requeue")) return DisableComputeNodeSchedulingOption.Requeue; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "terminate")) return DisableComputeNodeSchedulingOption.Terminate; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "taskcompletion")) return DisableComputeNodeSchedulingOption.TaskCompletion; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DisableComputeNodeSchedulingOption value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DisableComputeNodeSchedulingOption.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DisableComputeNodeSchedulingOption.cs new file mode 100644 index 000000000000..54d962a28e59 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DisableComputeNodeSchedulingOption.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The default value is requeue. + public enum DisableComputeNodeSchedulingOption + { + /// Terminate running Task processes and requeue the Tasks. The Tasks may run again on other Compute Nodes, or when Task scheduling is re-enabled on this Compute Node. Enter offline state as soon as Tasks have been terminated. + Requeue, + /// Terminate running Tasks. The Tasks will be completed with failureInfo indicating that they were terminated, and will not run again. Enter offline state as soon as Tasks have been terminated. + Terminate, + /// Allow currently running Tasks to complete. Schedule no new Tasks while waiting. Enter offline state when all Tasks have completed. + TaskCompletion + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DisableJobOption.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DisableJobOption.Serialization.cs new file mode 100644 index 000000000000..be09fe93d100 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DisableJobOption.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class DisableJobOptionExtensions + { + public static string ToSerialString(this DisableJobOption value) => value switch + { + DisableJobOption.Requeue => "requeue", + DisableJobOption.Terminate => "terminate", + DisableJobOption.Wait => "wait", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DisableJobOption value.") + }; + + public static DisableJobOption ToDisableJobOption(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "requeue")) return DisableJobOption.Requeue; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "terminate")) return DisableJobOption.Terminate; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "wait")) return DisableJobOption.Wait; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DisableJobOption value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DisableJobOption.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DisableJobOption.cs new file mode 100644 index 000000000000..f227d583c8da --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DisableJobOption.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// What to do with active Tasks associated with the Job. + public enum DisableJobOption + { + /// Terminate running Tasks and requeue them. The Tasks will run again when the Job is enabled. + Requeue, + /// Terminate running Tasks. The Tasks will be completed with failureInfo indicating that they were terminated, and will not run again. + Terminate, + /// Allow currently running Tasks to complete. + Wait + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiskEncryptionConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiskEncryptionConfiguration.Serialization.cs new file mode 100644 index 000000000000..cdc629303fbd --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiskEncryptionConfiguration.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class DiskEncryptionConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Targets)) + { + writer.WritePropertyName("targets"u8); + writer.WriteStartArray(); + foreach (var item in Targets) + { + writer.WriteStringValue(item.ToSerialString()); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static DiskEncryptionConfiguration DeserializeDiskEncryptionConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> targets = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString().ToDiskEncryptionTarget()); + } + targets = array; + continue; + } + } + return new DiskEncryptionConfiguration(Optional.ToList(targets)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiskEncryptionConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiskEncryptionConfiguration.cs new file mode 100644 index 000000000000..29d48b2c44d6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiskEncryptionConfiguration.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The disk encryption configuration applied on compute nodes in the pool. Disk encryption configuration is not supported on Linux pool created with Shared Image Gallery Image. + public partial class DiskEncryptionConfiguration + { + /// Initializes a new instance of DiskEncryptionConfiguration. + public DiskEncryptionConfiguration() + { + Targets = new ChangeTrackingList(); + } + + /// Initializes a new instance of DiskEncryptionConfiguration. + /// If omitted, no disks on the compute nodes in the pool will be encrypted. On Linux pool, only "TemporaryDisk" is supported; on Windows pool, "OsDisk" and "TemporaryDisk" must be specified. + internal DiskEncryptionConfiguration(IList targets) + { + Targets = targets; + } + + /// If omitted, no disks on the compute nodes in the pool will be encrypted. On Linux pool, only "TemporaryDisk" is supported; on Windows pool, "OsDisk" and "TemporaryDisk" must be specified. + public IList Targets { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiskEncryptionTarget.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiskEncryptionTarget.Serialization.cs new file mode 100644 index 000000000000..83f8b1ff9702 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiskEncryptionTarget.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class DiskEncryptionTargetExtensions + { + public static string ToSerialString(this DiskEncryptionTarget value) => value switch + { + DiskEncryptionTarget.OsDisk => "osdisk", + DiskEncryptionTarget.TemporaryDisk => "temporarydisk", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DiskEncryptionTarget value.") + }; + + public static DiskEncryptionTarget ToDiskEncryptionTarget(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "osdisk")) return DiskEncryptionTarget.OsDisk; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "temporarydisk")) return DiskEncryptionTarget.TemporaryDisk; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DiskEncryptionTarget value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiskEncryptionTarget.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiskEncryptionTarget.cs new file mode 100644 index 000000000000..ae1bae6c8d9d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DiskEncryptionTarget.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// A disk to encrypt. + public enum DiskEncryptionTarget + { + /// The OS Disk on the compute node is encrypted. + OsDisk, + /// 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. + TemporaryDisk + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DynamicVNetAssignmentScope.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DynamicVNetAssignmentScope.Serialization.cs new file mode 100644 index 000000000000..3a8015d232ce --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DynamicVNetAssignmentScope.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class DynamicVNetAssignmentScopeExtensions + { + public static string ToSerialString(this DynamicVNetAssignmentScope value) => value switch + { + DynamicVNetAssignmentScope.None => "none", + DynamicVNetAssignmentScope.Job => "job", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DynamicVNetAssignmentScope value.") + }; + + public static DynamicVNetAssignmentScope ToDynamicVNetAssignmentScope(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "none")) return DynamicVNetAssignmentScope.None; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "job")) return DynamicVNetAssignmentScope.Job; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DynamicVNetAssignmentScope value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DynamicVNetAssignmentScope.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DynamicVNetAssignmentScope.cs new file mode 100644 index 000000000000..eca1d0c4610a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/DynamicVNetAssignmentScope.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The scope of dynamic vnet assignment. + public enum DynamicVNetAssignmentScope + { + /// No dynamic VNet assignment is enabled. + None, + /// Dynamic VNet assignment is done per-job. + Job + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ElevationLevel.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ElevationLevel.Serialization.cs new file mode 100644 index 000000000000..f6f3ce102480 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ElevationLevel.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class ElevationLevelExtensions + { + public static string ToSerialString(this ElevationLevel value) => value switch + { + ElevationLevel.NonAdmin => "nonadmin", + ElevationLevel.Admin => "admin", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ElevationLevel value.") + }; + + public static ElevationLevel ToElevationLevel(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "nonadmin")) return ElevationLevel.NonAdmin; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "admin")) return ElevationLevel.Admin; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ElevationLevel value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ElevationLevel.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ElevationLevel.cs new file mode 100644 index 000000000000..c45fb526d1a5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ElevationLevel.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The elevation level of the user. + public enum ElevationLevel + { + /// The user is a standard user without elevated access. + NonAdmin, + /// The user is a user with elevated access and operates with full Administrator permissions. + Admin + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/EnvironmentSetting.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/EnvironmentSetting.Serialization.cs new file mode 100644 index 000000000000..4ef1f2621e45 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/EnvironmentSetting.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class EnvironmentSetting : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + writer.WriteEndObject(); + } + + internal static EnvironmentSetting DeserializeEnvironmentSetting(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + } + return new EnvironmentSetting(name, value.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/EnvironmentSetting.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/EnvironmentSetting.cs new file mode 100644 index 000000000000..f04d875c2fdf --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/EnvironmentSetting.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// An environment variable to be set on a Task process. + public partial class EnvironmentSetting + { + /// Initializes a new instance of EnvironmentSetting. + /// The name of the environment variable. + /// is null. + public EnvironmentSetting(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of EnvironmentSetting. + /// The name of the environment variable. + /// The value of the environment variable. + internal EnvironmentSetting(string name, string value) + { + Name = name; + Value = value; + } + + /// The name of the environment variable. + public string Name { get; set; } + /// The value of the environment variable. + public string Value { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ErrorCategory.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ErrorCategory.Serialization.cs new file mode 100644 index 000000000000..21a5278bcf02 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ErrorCategory.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class ErrorCategoryExtensions + { + public static string ToSerialString(this ErrorCategory value) => value switch + { + ErrorCategory.UserError => "usererror", + ErrorCategory.ServerError => "servererror", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ErrorCategory value.") + }; + + public static ErrorCategory ToErrorCategory(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "usererror")) return ErrorCategory.UserError; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "servererror")) return ErrorCategory.ServerError; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ErrorCategory value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ErrorCategory.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ErrorCategory.cs new file mode 100644 index 000000000000..acc30de65e8e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ErrorCategory.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The category of the error. + public enum ErrorCategory + { + /// The error is due to a user issue, such as misconfiguration. + UserError, + /// The error is due to an internal server issue. + ServerError + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ErrorMessage.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ErrorMessage.Serialization.cs new file mode 100644 index 000000000000..76ebea4563a7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ErrorMessage.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ErrorMessage + { + internal static ErrorMessage DeserializeErrorMessage(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional lang = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lang"u8)) + { + lang = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + } + return new ErrorMessage(lang.Value, value.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ErrorMessage.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ErrorMessage.cs new file mode 100644 index 000000000000..81b39de86271 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ErrorMessage.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// An error message received in an Azure Batch error response. + public partial class ErrorMessage + { + /// Initializes a new instance of ErrorMessage. + internal ErrorMessage() + { + } + + /// Initializes a new instance of ErrorMessage. + /// The language code of the error message. + /// The text of the message. + internal ErrorMessage(string lang, string value) + { + Lang = lang; + Value = value; + } + + /// The language code of the error message. + public string Lang { get; } + /// The text of the message. + public string Value { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitCodeMapping.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitCodeMapping.Serialization.cs new file mode 100644 index 000000000000..f412275b3804 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitCodeMapping.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ExitCodeMapping : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("code"u8); + writer.WriteNumberValue(Code); + writer.WritePropertyName("exitOptions"u8); + writer.WriteObjectValue(ExitOptions); + writer.WriteEndObject(); + } + + internal static ExitCodeMapping DeserializeExitCodeMapping(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int code = default; + ExitOptions exitOptions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("exitOptions"u8)) + { + exitOptions = ExitOptions.DeserializeExitOptions(property.Value); + continue; + } + } + return new ExitCodeMapping(code, exitOptions); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitCodeMapping.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitCodeMapping.cs new file mode 100644 index 000000000000..f37555df3e20 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitCodeMapping.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// How the Batch service should respond if a Task exits with a particular exit code. + public partial class ExitCodeMapping + { + /// Initializes a new instance of ExitCodeMapping. + /// A process exit code. + /// Specifies how the Batch service responds to a particular exit condition. + /// is null. + public ExitCodeMapping(int code, ExitOptions exitOptions) + { + Argument.AssertNotNull(exitOptions, nameof(exitOptions)); + + Code = code; + ExitOptions = exitOptions; + } + + /// A process exit code. + public int Code { get; set; } + /// Specifies how the Batch service responds to a particular exit condition. + public ExitOptions ExitOptions { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitCodeRangeMapping.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitCodeRangeMapping.Serialization.cs new file mode 100644 index 000000000000..407e840f26dc --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitCodeRangeMapping.Serialization.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ExitCodeRangeMapping : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("start"u8); + writer.WriteNumberValue(Start); + writer.WritePropertyName("end"u8); + writer.WriteNumberValue(End); + writer.WritePropertyName("exitOptions"u8); + writer.WriteObjectValue(ExitOptions); + writer.WriteEndObject(); + } + + internal static ExitCodeRangeMapping DeserializeExitCodeRangeMapping(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int start = default; + int end = default; + ExitOptions exitOptions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("start"u8)) + { + start = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("end"u8)) + { + end = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("exitOptions"u8)) + { + exitOptions = ExitOptions.DeserializeExitOptions(property.Value); + continue; + } + } + return new ExitCodeRangeMapping(start, end, exitOptions); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitCodeRangeMapping.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitCodeRangeMapping.cs new file mode 100644 index 000000000000..dec2a3edd7cc --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitCodeRangeMapping.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A range of exit codes and how the Batch service should respond to exit codes within that range. + public partial class ExitCodeRangeMapping + { + /// Initializes a new instance of ExitCodeRangeMapping. + /// The first exit code in the range. + /// The last exit code in the range. + /// Specifies how the Batch service responds to a particular exit condition. + /// is null. + public ExitCodeRangeMapping(int start, int end, ExitOptions exitOptions) + { + Argument.AssertNotNull(exitOptions, nameof(exitOptions)); + + Start = start; + End = end; + ExitOptions = exitOptions; + } + + /// The first exit code in the range. + public int Start { get; set; } + /// The last exit code in the range. + public int End { get; set; } + /// Specifies how the Batch service responds to a particular exit condition. + public ExitOptions ExitOptions { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitConditions.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitConditions.Serialization.cs new file mode 100644 index 000000000000..03bf53d0a57c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitConditions.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ExitConditions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(ExitCodes)) + { + writer.WritePropertyName("exitCodes"u8); + writer.WriteStartArray(); + foreach (var item in ExitCodes) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ExitCodeRanges)) + { + writer.WritePropertyName("exitCodeRanges"u8); + writer.WriteStartArray(); + foreach (var item in ExitCodeRanges) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PreProcessingError)) + { + writer.WritePropertyName("preProcessingError"u8); + writer.WriteObjectValue(PreProcessingError); + } + if (Optional.IsDefined(FileUploadError)) + { + writer.WritePropertyName("fileUploadError"u8); + writer.WriteObjectValue(FileUploadError); + } + if (Optional.IsDefined(Default)) + { + writer.WritePropertyName("default"u8); + writer.WriteObjectValue(Default); + } + writer.WriteEndObject(); + } + + internal static ExitConditions DeserializeExitConditions(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> exitCodes = default; + Optional> exitCodeRanges = default; + Optional preProcessingError = default; + Optional fileUploadError = default; + Optional @default = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exitCodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExitCodeMapping.DeserializeExitCodeMapping(item)); + } + exitCodes = array; + continue; + } + if (property.NameEquals("exitCodeRanges"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExitCodeRangeMapping.DeserializeExitCodeRangeMapping(item)); + } + exitCodeRanges = array; + continue; + } + if (property.NameEquals("preProcessingError"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + preProcessingError = ExitOptions.DeserializeExitOptions(property.Value); + continue; + } + if (property.NameEquals("fileUploadError"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fileUploadError = ExitOptions.DeserializeExitOptions(property.Value); + continue; + } + if (property.NameEquals("default"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @default = ExitOptions.DeserializeExitOptions(property.Value); + continue; + } + } + return new ExitConditions(Optional.ToList(exitCodes), Optional.ToList(exitCodeRanges), preProcessingError.Value, fileUploadError.Value, @default.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitConditions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitConditions.cs new file mode 100644 index 000000000000..fde10225f166 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitConditions.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Specifies how the Batch service should respond when the Task completes. + public partial class ExitConditions + { + /// Initializes a new instance of ExitConditions. + public ExitConditions() + { + ExitCodes = new ChangeTrackingList(); + ExitCodeRanges = new ChangeTrackingList(); + } + + /// Initializes a new instance of ExitConditions. + /// A list of individual Task exit codes and how the Batch service should respond to them. + /// A list of Task exit code ranges and how the Batch service should respond to them. + /// Specifies how the Batch service responds to a particular exit condition. + /// If the Task exited with an exit code that was specified via exitCodes or exitCodeRanges, and then encountered a file upload error, then the action specified by the exit code takes precedence. + /// This value is used if the Task exits with any nonzero exit code not listed in the exitCodes or exitCodeRanges collection, with a pre-processing error if the preProcessingError property is not present, or with a file upload error if the fileUploadError property is not present. If you want non-default behavior on exit code 0, you must list it explicitly using the exitCodes or exitCodeRanges collection. + internal ExitConditions(IList exitCodes, IList exitCodeRanges, ExitOptions preProcessingError, ExitOptions fileUploadError, ExitOptions @default) + { + ExitCodes = exitCodes; + ExitCodeRanges = exitCodeRanges; + PreProcessingError = preProcessingError; + FileUploadError = fileUploadError; + Default = @default; + } + + /// A list of individual Task exit codes and how the Batch service should respond to them. + public IList ExitCodes { get; } + /// A list of Task exit code ranges and how the Batch service should respond to them. + public IList ExitCodeRanges { get; } + /// Specifies how the Batch service responds to a particular exit condition. + public ExitOptions PreProcessingError { get; set; } + /// If the Task exited with an exit code that was specified via exitCodes or exitCodeRanges, and then encountered a file upload error, then the action specified by the exit code takes precedence. + public ExitOptions FileUploadError { get; set; } + /// This value is used if the Task exits with any nonzero exit code not listed in the exitCodes or exitCodeRanges collection, with a pre-processing error if the preProcessingError property is not present, or with a file upload error if the fileUploadError property is not present. If you want non-default behavior on exit code 0, you must list it explicitly using the exitCodes or exitCodeRanges collection. + public ExitOptions Default { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitOptions.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitOptions.Serialization.cs new file mode 100644 index 000000000000..c17c8b7d0e3b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitOptions.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ExitOptions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(JobAction)) + { + writer.WritePropertyName("jobAction"u8); + writer.WriteStringValue(JobAction.Value.ToSerialString()); + } + if (Optional.IsDefined(DependencyAction)) + { + writer.WritePropertyName("dependencyAction"u8); + writer.WriteStringValue(DependencyAction.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + internal static ExitOptions DeserializeExitOptions(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional jobAction = default; + Optional dependencyAction = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobAction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobAction = property.Value.GetString().ToJobAction(); + continue; + } + if (property.NameEquals("dependencyAction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dependencyAction = property.Value.GetString().ToDependencyAction(); + continue; + } + } + return new ExitOptions(Optional.ToNullable(jobAction), Optional.ToNullable(dependencyAction)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitOptions.cs new file mode 100644 index 000000000000..f12e0fc5db7b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ExitOptions.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Specifies how the Batch service responds to a particular exit condition. + public partial class ExitOptions + { + /// Initializes a new instance of ExitOptions. + public ExitOptions() + { + } + + /// Initializes a new instance of ExitOptions. + /// The default is none for exit code 0 and terminate for all other exit conditions. If the Job's onTaskFailed property is noaction, then specifying this property returns an error and the add Task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + /// Possible values are 'satisfy' (allowing dependent tasks to progress) and 'block' (dependent tasks continue to wait). Batch does not yet support cancellation of dependent tasks. + internal ExitOptions(JobAction? jobAction, DependencyAction? dependencyAction) + { + JobAction = jobAction; + DependencyAction = dependencyAction; + } + + /// The default is none for exit code 0 and terminate for all other exit conditions. If the Job's onTaskFailed property is noaction, then specifying this property returns an error and the add Task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public JobAction? JobAction { get; set; } + /// Possible values are 'satisfy' (allowing dependent tasks to progress) and 'block' (dependent tasks continue to wait). Batch does not yet support cancellation of dependent tasks. + public DependencyAction? DependencyAction { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileDeleteFromComputeNodeOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileDeleteFromComputeNodeOptions.cs new file mode 100644 index 000000000000..c52390a5eca9 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileDeleteFromComputeNodeOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class FileDeleteFromComputeNodeOptions + { + /// Initializes a new instance of FileDeleteFromComputeNodeOptions. + public FileDeleteFromComputeNodeOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileDeleteFromTaskOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileDeleteFromTaskOptions.cs new file mode 100644 index 000000000000..fbf05e63cc39 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileDeleteFromTaskOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class FileDeleteFromTaskOptions + { + /// Initializes a new instance of FileDeleteFromTaskOptions. + public FileDeleteFromTaskOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileGetFromComputeNodeOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileGetFromComputeNodeOptions.cs new file mode 100644 index 000000000000..d0d7a0752ac2 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileGetFromComputeNodeOptions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class FileGetFromComputeNodeOptions + { + /// Initializes a new instance of FileGetFromComputeNodeOptions. + public FileGetFromComputeNodeOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// The byte range to be retrieved. The default is to retrieve the entire file. The format is bytes=startRange-endRange. + public string OcpRange { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileGetFromTaskOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileGetFromTaskOptions.cs new file mode 100644 index 000000000000..1892321d7536 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileGetFromTaskOptions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class FileGetFromTaskOptions + { + /// Initializes a new instance of FileGetFromTaskOptions. + public FileGetFromTaskOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// The byte range to be retrieved. The default is to retrieve the entire file. The format is bytes=startRange-endRange. + public string OcpRange { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileGetPropertiesFromComputeNodeOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileGetPropertiesFromComputeNodeOptions.cs new file mode 100644 index 000000000000..55e0b7766a55 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileGetPropertiesFromComputeNodeOptions.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class FileGetPropertiesFromComputeNodeOptions + { + /// Initializes a new instance of FileGetPropertiesFromComputeNodeOptions. + public FileGetPropertiesFromComputeNodeOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileGetPropertiesFromTaskOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileGetPropertiesFromTaskOptions.cs new file mode 100644 index 000000000000..462ce0d6dce5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileGetPropertiesFromTaskOptions.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class FileGetPropertiesFromTaskOptions + { + /// Initializes a new instance of FileGetPropertiesFromTaskOptions. + public FileGetPropertiesFromTaskOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileListFromComputeNodeOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileListFromComputeNodeOptions.cs new file mode 100644 index 000000000000..a5b34cad8140 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileListFromComputeNodeOptions.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class FileListFromComputeNodeOptions + { + /// Initializes a new instance of FileListFromComputeNodeOptions. + public FileListFromComputeNodeOptions() + { + } + + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. + public string Filter { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 files can be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileListFromTaskOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileListFromTaskOptions.cs new file mode 100644 index 000000000000..63f6ad871760 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileListFromTaskOptions.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class FileListFromTaskOptions + { + /// Initializes a new instance of FileListFromTaskOptions. + public FileListFromTaskOptions() + { + } + + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-task-files. + public string Filter { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 files can be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileProperties.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileProperties.Serialization.cs new file mode 100644 index 000000000000..801a93864308 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileProperties.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class FileProperties + { + internal static FileProperties DeserializeFileProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional creationTime = default; + DateTimeOffset lastModified = default; + long contentLength = default; + Optional contentType = default; + Optional fileMode = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModified"u8)) + { + lastModified = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("contentLength"u8)) + { + contentLength = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("contentType"u8)) + { + contentType = property.Value.GetString(); + continue; + } + if (property.NameEquals("fileMode"u8)) + { + fileMode = property.Value.GetString(); + continue; + } + } + return new FileProperties(Optional.ToNullable(creationTime), lastModified, contentLength, contentType.Value, fileMode.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileProperties.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileProperties.cs new file mode 100644 index 000000000000..838c40200069 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/FileProperties.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// The properties of a file on a Compute Node. + public partial class FileProperties + { + /// Initializes a new instance of FileProperties. + /// The time at which the file was last modified. + /// The length of the file. + internal FileProperties(DateTimeOffset lastModified, long contentLength) + { + LastModified = lastModified; + ContentLength = contentLength; + } + + /// Initializes a new instance of FileProperties. + /// The creation time is not returned for files on Linux Compute Nodes. + /// The time at which the file was last modified. + /// The length of the file. + /// The content type of the file. + /// The file mode is returned only for files on Linux Compute Nodes. + internal FileProperties(DateTimeOffset? creationTime, DateTimeOffset lastModified, long contentLength, string contentType, string fileMode) + { + CreationTime = creationTime; + LastModified = lastModified; + ContentLength = contentLength; + ContentType = contentType; + FileMode = fileMode; + } + + /// The creation time is not returned for files on Linux Compute Nodes. + public DateTimeOffset? CreationTime { get; } + /// The time at which the file was last modified. + public DateTimeOffset LastModified { get; } + /// The length of the file. + public long ContentLength { get; } + /// The content type of the file. + public string ContentType { get; } + /// The file mode is returned only for files on Linux Compute Nodes. + public string FileMode { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/HttpHeader.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/HttpHeader.Serialization.cs new file mode 100644 index 000000000000..7975ead76ea5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/HttpHeader.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class HttpHeader : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + writer.WriteEndObject(); + } + + internal static HttpHeader DeserializeHttpHeader(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + } + return new HttpHeader(name, value.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/HttpHeader.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/HttpHeader.cs new file mode 100644 index 000000000000..ce2d0cb7cc6a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/HttpHeader.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// An HTTP header name-value pair. + public partial class HttpHeader + { + /// Initializes a new instance of HttpHeader. + /// The case-insensitive name of the header to be used while uploading output files. + /// is null. + public HttpHeader(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of HttpHeader. + /// The case-insensitive name of the header to be used while uploading output files. + /// The value of the header to be used while uploading output files. + internal HttpHeader(string name, string value) + { + Name = name; + Value = value; + } + + /// The case-insensitive name of the header to be used while uploading output files. + public string Name { get; set; } + /// The value of the header to be used while uploading output files. + public string Value { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/IPAddressProvisioningType.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/IPAddressProvisioningType.Serialization.cs new file mode 100644 index 000000000000..8eaeeaaf225f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/IPAddressProvisioningType.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class IPAddressProvisioningTypeExtensions + { + public static string ToSerialString(this IPAddressProvisioningType value) => value switch + { + IPAddressProvisioningType.BatchManaged => "batchmanaged", + IPAddressProvisioningType.UserManaged => "usermanaged", + IPAddressProvisioningType.NoPublicIPAddresses => "nopublicipaddresses", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IPAddressProvisioningType value.") + }; + + public static IPAddressProvisioningType ToIPAddressProvisioningType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "batchmanaged")) return IPAddressProvisioningType.BatchManaged; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "usermanaged")) return IPAddressProvisioningType.UserManaged; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "nopublicipaddresses")) return IPAddressProvisioningType.NoPublicIPAddresses; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IPAddressProvisioningType value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/IPAddressProvisioningType.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/IPAddressProvisioningType.cs new file mode 100644 index 000000000000..78f2470191ca --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/IPAddressProvisioningType.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The provisioning type for Public IP Addresses for the Pool. + public enum IPAddressProvisioningType + { + /// A public IP will be created and managed by Batch. There may be multiple public IPs depending on the size of the Pool. + BatchManaged, + /// Public IPs are provided by the user and will be used to provision the Compute Nodes. + UserManaged, + /// No public IP Address will be created. + NoPublicIPAddresses + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ImageInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ImageInformation.Serialization.cs new file mode 100644 index 000000000000..00681c5a588d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ImageInformation.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ImageInformation + { + internal static ImageInformation DeserializeImageInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nodeAgentSKUId = default; + ImageReference imageReference = default; + OSType osType = default; + Optional> capabilities = default; + Optional batchSupportEndOfLife = default; + VerificationType verificationType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nodeAgentSKUId"u8)) + { + nodeAgentSKUId = property.Value.GetString(); + continue; + } + if (property.NameEquals("imageReference"u8)) + { + imageReference = ImageReference.DeserializeImageReference(property.Value); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = property.Value.GetString().ToOSType(); + continue; + } + if (property.NameEquals("capabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + capabilities = array; + continue; + } + if (property.NameEquals("batchSupportEndOfLife"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batchSupportEndOfLife = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("verificationType"u8)) + { + verificationType = property.Value.GetString().ToVerificationType(); + continue; + } + } + return new ImageInformation(nodeAgentSKUId, imageReference, osType, Optional.ToList(capabilities), Optional.ToNullable(batchSupportEndOfLife), verificationType); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ImageInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ImageInformation.cs new file mode 100644 index 000000000000..69265a20bd4c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ImageInformation.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A reference to the Azure Virtual Machines Marketplace Image and additional information about the Image. + public partial class ImageInformation + { + /// Initializes a new instance of ImageInformation. + /// The ID of the Compute Node agent SKU which the Image supports. + /// 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. + /// The type of operating system (e.g. Windows or Linux) of the Image. + /// Whether the Azure Batch service actively verifies that the Image is compatible with the associated Compute Node agent SKU. + /// or is null. + internal ImageInformation(string nodeAgentSKUId, ImageReference imageReference, OSType osType, VerificationType verificationType) + { + Argument.AssertNotNull(nodeAgentSKUId, nameof(nodeAgentSKUId)); + Argument.AssertNotNull(imageReference, nameof(imageReference)); + + NodeAgentSKUId = nodeAgentSKUId; + ImageReference = imageReference; + OsType = osType; + Capabilities = new ChangeTrackingList(); + VerificationType = verificationType; + } + + /// Initializes a new instance of ImageInformation. + /// The ID of the Compute Node agent SKU which the Image supports. + /// 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. + /// The type of operating system (e.g. Windows or Linux) of the Image. + /// Not every capability of the Image is listed. Capabilities in this list are considered of special interest and are generally related to integration with other features in the Azure Batch service. + /// The time when the Azure Batch service will stop accepting create Pool requests for the Image. + /// Whether the Azure Batch service actively verifies that the Image is compatible with the associated Compute Node agent SKU. + internal ImageInformation(string nodeAgentSKUId, ImageReference imageReference, OSType osType, IReadOnlyList capabilities, DateTimeOffset? batchSupportEndOfLife, VerificationType verificationType) + { + NodeAgentSKUId = nodeAgentSKUId; + ImageReference = imageReference; + OsType = osType; + Capabilities = capabilities; + BatchSupportEndOfLife = batchSupportEndOfLife; + VerificationType = verificationType; + } + + /// The ID of the Compute Node agent SKU which the Image supports. + public string NodeAgentSKUId { get; } + /// 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 ImageReference ImageReference { get; } + /// The type of operating system (e.g. Windows or Linux) of the Image. + public OSType OsType { get; } + /// Not every capability of the Image is listed. Capabilities in this list are considered of special interest and are generally related to integration with other features in the Azure Batch service. + public IReadOnlyList Capabilities { get; } + /// The time when the Azure Batch service will stop accepting create Pool requests for the Image. + public DateTimeOffset? BatchSupportEndOfLife { get; } + /// Whether the Azure Batch service actively verifies that the Image is compatible with the associated Compute Node agent SKU. + public VerificationType VerificationType { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ImageReference.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ImageReference.Serialization.cs new file mode 100644 index 000000000000..dce4a0eef8fb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ImageReference.Serialization.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ImageReference : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Publisher)) + { + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + } + if (Optional.IsDefined(Offer)) + { + writer.WritePropertyName("offer"u8); + writer.WriteStringValue(Offer); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteStringValue(Sku); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (Optional.IsDefined(VirtualMachineImageId)) + { + writer.WritePropertyName("virtualMachineImageId"u8); + writer.WriteStringValue(VirtualMachineImageId); + } + writer.WriteEndObject(); + } + + internal static ImageReference DeserializeImageReference(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional publisher = default; + Optional offer = default; + Optional sku = default; + Optional version = default; + Optional virtualMachineImageId = default; + Optional exactVersion = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("publisher"u8)) + { + publisher = property.Value.GetString(); + continue; + } + if (property.NameEquals("offer"u8)) + { + offer = property.Value.GetString(); + continue; + } + if (property.NameEquals("sku"u8)) + { + sku = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("virtualMachineImageId"u8)) + { + virtualMachineImageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("exactVersion"u8)) + { + exactVersion = property.Value.GetString(); + continue; + } + } + return new ImageReference(publisher.Value, offer.Value, sku.Value, version.Value, virtualMachineImageId.Value, exactVersion.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ImageReference.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ImageReference.cs new file mode 100644 index 000000000000..d441fc50bb28 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ImageReference.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// 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 + { + /// Initializes a new instance of ImageReference. + public ImageReference() + { + } + + /// Initializes a new instance of ImageReference. + /// For example, Canonical or MicrosoftWindowsServer. + /// For example, UbuntuServer or WindowsServer. + /// For example, 18.04-LTS or 2019-Datacenter. + /// A value of 'latest' can be specified to select the latest version of an Image. If omitted, the default is 'latest'. + /// This property is mutually exclusive with other ImageReference properties. The Shared Image Gallery Image must have replicas in the same region and must be in the same subscription as the Azure Batch account. If the image version is not specified in the imageId, the latest version will be used. For information about the firewall settings for the Batch Compute Node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// 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'. + internal ImageReference(string publisher, string offer, string sku, string version, string virtualMachineImageId, string exactVersion) + { + Publisher = publisher; + Offer = offer; + Sku = sku; + Version = version; + VirtualMachineImageId = virtualMachineImageId; + ExactVersion = exactVersion; + } + + /// For example, Canonical or MicrosoftWindowsServer. + public string Publisher { get; set; } + /// For example, UbuntuServer or WindowsServer. + public string Offer { get; set; } + /// For example, 18.04-LTS or 2019-Datacenter. + public string Sku { get; set; } + /// A value of 'latest' can be specified to select the latest version of an Image. If omitted, the default is 'latest'. + public string Version { get; set; } + /// This property is mutually exclusive with other ImageReference properties. The Shared Image Gallery Image must have replicas in the same region and must be in the same subscription as the Azure Batch account. If the image version is not specified in the imageId, the latest version will be used. For information about the firewall settings for the Batch Compute Node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + public string VirtualMachineImageId { get; set; } + /// 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; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundEndpoint.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundEndpoint.Serialization.cs new file mode 100644 index 000000000000..3a8ee97e334f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundEndpoint.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class InboundEndpoint + { + internal static InboundEndpoint DeserializeInboundEndpoint(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + InboundEndpointProtocol protocol = default; + string publicIPAddress = default; + string publicFQDN = default; + int frontendPort = default; + int backendPort = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("protocol"u8)) + { + protocol = property.Value.GetString().ToInboundEndpointProtocol(); + continue; + } + if (property.NameEquals("publicIPAddress"u8)) + { + publicIPAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("publicFQDN"u8)) + { + publicFQDN = property.Value.GetString(); + continue; + } + if (property.NameEquals("frontendPort"u8)) + { + frontendPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("backendPort"u8)) + { + backendPort = property.Value.GetInt32(); + continue; + } + } + return new InboundEndpoint(name, protocol, publicIPAddress, publicFQDN, frontendPort, backendPort); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundEndpoint.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundEndpoint.cs new file mode 100644 index 000000000000..088455c2d952 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundEndpoint.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// An inbound endpoint on a Compute Node. + public partial class InboundEndpoint + { + /// Initializes a new instance of InboundEndpoint. + /// The name of the endpoint. + /// The protocol of the endpoint. + /// The public IP address of the Compute Node. + /// The public fully qualified domain name for the Compute Node. + /// The public port number of the endpoint. + /// The backend port number of the endpoint. + /// , or is null. + internal InboundEndpoint(string name, InboundEndpointProtocol protocol, string publicIPAddress, string publicFqdn, int frontendPort, int backendPort) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(publicIPAddress, nameof(publicIPAddress)); + Argument.AssertNotNull(publicFqdn, nameof(publicFqdn)); + + Name = name; + Protocol = protocol; + PublicIPAddress = publicIPAddress; + PublicFqdn = publicFqdn; + FrontendPort = frontendPort; + BackendPort = backendPort; + } + + /// The name of the endpoint. + public string Name { get; } + /// The protocol of the endpoint. + public InboundEndpointProtocol Protocol { get; } + /// The public IP address of the Compute Node. + public string PublicIPAddress { get; } + /// The public fully qualified domain name for the Compute Node. + public string PublicFqdn { get; } + /// The public port number of the endpoint. + public int FrontendPort { get; } + /// The backend port number of the endpoint. + public int BackendPort { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundEndpointProtocol.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundEndpointProtocol.Serialization.cs new file mode 100644 index 000000000000..14e963495752 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundEndpointProtocol.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class InboundEndpointProtocolExtensions + { + public static string ToSerialString(this InboundEndpointProtocol value) => value switch + { + InboundEndpointProtocol.Tcp => "tcp", + InboundEndpointProtocol.Udp => "udp", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown InboundEndpointProtocol value.") + }; + + public static InboundEndpointProtocol ToInboundEndpointProtocol(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "tcp")) return InboundEndpointProtocol.Tcp; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "udp")) return InboundEndpointProtocol.Udp; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown InboundEndpointProtocol value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundEndpointProtocol.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundEndpointProtocol.cs new file mode 100644 index 000000000000..9e00edee5cac --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundEndpointProtocol.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The protocol of the endpoint. + public enum InboundEndpointProtocol + { + /// Use TCP for the endpoint. + Tcp, + /// Use UDP for the endpoint. + Udp + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundNATPool.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundNATPool.Serialization.cs new file mode 100644 index 000000000000..13b5743937c6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundNATPool.Serialization.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class InboundNATPool : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("protocol"u8); + writer.WriteStringValue(Protocol.ToSerialString()); + writer.WritePropertyName("backendPort"u8); + writer.WriteNumberValue(BackendPort); + writer.WritePropertyName("frontendPortRangeStart"u8); + writer.WriteNumberValue(FrontendPortRangeStart); + writer.WritePropertyName("frontendPortRangeEnd"u8); + writer.WriteNumberValue(FrontendPortRangeEnd); + if (Optional.IsCollectionDefined(NetworkSecurityGroupRules)) + { + writer.WritePropertyName("networkSecurityGroupRules"u8); + writer.WriteStartArray(); + foreach (var item in NetworkSecurityGroupRules) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static InboundNATPool DeserializeInboundNATPool(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + InboundEndpointProtocol protocol = default; + int backendPort = default; + int frontendPortRangeStart = default; + int frontendPortRangeEnd = default; + Optional> networkSecurityGroupRules = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("protocol"u8)) + { + protocol = property.Value.GetString().ToInboundEndpointProtocol(); + continue; + } + if (property.NameEquals("backendPort"u8)) + { + backendPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("frontendPortRangeStart"u8)) + { + frontendPortRangeStart = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("frontendPortRangeEnd"u8)) + { + frontendPortRangeEnd = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("networkSecurityGroupRules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkSecurityGroupRule.DeserializeNetworkSecurityGroupRule(item)); + } + networkSecurityGroupRules = array; + continue; + } + } + return new InboundNATPool(name, protocol, backendPort, frontendPortRangeStart, frontendPortRangeEnd, Optional.ToList(networkSecurityGroupRules)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundNATPool.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundNATPool.cs new file mode 100644 index 000000000000..a8c30f453778 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InboundNATPool.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A inbound NAT Pool that can be used to address specific ports on Compute Nodes in a Batch Pool externally. + public partial class InboundNATPool + { + /// Initializes a new instance of InboundNATPool. + /// The name must be unique within a Batch Pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. + /// The protocol of the endpoint. + /// This must be unique within a Batch Pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a Pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. + /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a Pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. + /// is null. + public InboundNATPool(string name, InboundEndpointProtocol protocol, int backendPort, int frontendPortRangeStart, int frontendPortRangeEnd) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Protocol = protocol; + BackendPort = backendPort; + FrontendPortRangeStart = frontendPortRangeStart; + FrontendPortRangeEnd = frontendPortRangeEnd; + NetworkSecurityGroupRules = new ChangeTrackingList(); + } + + /// Initializes a new instance of InboundNATPool. + /// The name must be unique within a Batch Pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. + /// The protocol of the endpoint. + /// This must be unique within a Batch Pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a Pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. + /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a Pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. + /// The maximum number of rules that can be specified across all the endpoints on a Batch Pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400. + internal InboundNATPool(string name, InboundEndpointProtocol protocol, int backendPort, int frontendPortRangeStart, int frontendPortRangeEnd, IList networkSecurityGroupRules) + { + Name = name; + Protocol = protocol; + BackendPort = backendPort; + FrontendPortRangeStart = frontendPortRangeStart; + FrontendPortRangeEnd = frontendPortRangeEnd; + NetworkSecurityGroupRules = networkSecurityGroupRules; + } + + /// The name must be unique within a Batch Pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. + public string Name { get; set; } + /// The protocol of the endpoint. + public InboundEndpointProtocol Protocol { get; set; } + /// This must be unique within a Batch Pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + public int BackendPort { get; set; } + /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a Pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. + public int FrontendPortRangeStart { get; set; } + /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a Pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. + public int FrontendPortRangeEnd { get; set; } + /// The maximum number of rules that can be specified across all the endpoints on a Batch Pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400. + public IList NetworkSecurityGroupRules { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InstanceViewStatus.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InstanceViewStatus.Serialization.cs new file mode 100644 index 000000000000..05168cd5179f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InstanceViewStatus.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class InstanceViewStatus + { + internal static InstanceViewStatus DeserializeInstanceViewStatus(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional displayStatus = default; + Optional level = default; + Optional message = default; + Optional time = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayStatus"u8)) + { + displayStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("level"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + level = property.Value.GetString().ToStatusLevelTypes(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("time"u8)) + { + time = property.Value.GetString(); + continue; + } + } + return new InstanceViewStatus(code.Value, displayStatus.Value, Optional.ToNullable(level), message.Value, time.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InstanceViewStatus.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InstanceViewStatus.cs new file mode 100644 index 000000000000..0b1c45e6101b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/InstanceViewStatus.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The instance view status. + public partial class InstanceViewStatus + { + /// Initializes a new instance of InstanceViewStatus. + internal InstanceViewStatus() + { + } + + /// Initializes a new instance of InstanceViewStatus. + /// The status code. + /// The localized label for the status. + /// Level code. + /// The detailed status message. + /// The time of the status. + internal InstanceViewStatus(string code, string displayStatus, StatusLevelTypes? level, string message, string time) + { + Code = code; + DisplayStatus = displayStatus; + Level = level; + Message = message; + Time = time; + } + + /// The status code. + public string Code { get; } + /// The localized label for the status. + public string DisplayStatus { get; } + /// Level code. + public StatusLevelTypes? Level { get; } + /// The detailed status message. + public string Message { get; } + /// The time of the status. + public string Time { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAction.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAction.Serialization.cs new file mode 100644 index 000000000000..e165702b029f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAction.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class JobActionExtensions + { + public static string ToSerialString(this JobAction value) => value switch + { + JobAction.None => "none", + JobAction.Disable => "disable", + JobAction.Terminate => "terminate", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown JobAction value.") + }; + + public static JobAction ToJobAction(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "none")) return JobAction.None; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "disable")) return JobAction.Disable; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "terminate")) return JobAction.Terminate; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown JobAction value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAction.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAction.cs new file mode 100644 index 000000000000..dbae3ec3edaf --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAction.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The default is none for exit code 0 and terminate for all other exit conditions. If the Job's onTaskFailed property is noaction, then specifying this property returns an error and the add Task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public enum JobAction + { + /// Take no action. + None, + /// Disable the Job. This is equivalent to calling the disable Job API, with a disableTasks value of requeue. + Disable, + /// Terminate the Job. The terminateReason in the Job's executionInfo is set to "TaskFailed". + Terminate + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAddOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAddOptions.cs new file mode 100644 index 000000000000..9145f0067f90 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAddOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobAddOptions + { + /// Initializes a new instance of JobAddOptions. + public JobAddOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAddParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAddParameter.Serialization.cs new file mode 100644 index 000000000000..799d8d099f71 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAddParameter.Serialization.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobAddParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Priority)) + { + writer.WritePropertyName("priority"u8); + writer.WriteNumberValue(Priority.Value); + } + if (Optional.IsDefined(MaxParallelTasks)) + { + writer.WritePropertyName("maxParallelTasks"u8); + writer.WriteNumberValue(MaxParallelTasks.Value); + } + if (Optional.IsDefined(AllowTaskPreemption)) + { + writer.WritePropertyName("allowTaskPreemption"u8); + writer.WriteBooleanValue(AllowTaskPreemption.Value); + } + if (Optional.IsDefined(Constraints)) + { + writer.WritePropertyName("constraints"u8); + writer.WriteObjectValue(Constraints); + } + if (Optional.IsDefined(JobManagerTask)) + { + writer.WritePropertyName("jobManagerTask"u8); + writer.WriteObjectValue(JobManagerTask); + } + if (Optional.IsDefined(JobPreparationTask)) + { + writer.WritePropertyName("jobPreparationTask"u8); + writer.WriteObjectValue(JobPreparationTask); + } + if (Optional.IsDefined(JobReleaseTask)) + { + writer.WritePropertyName("jobReleaseTask"u8); + writer.WriteObjectValue(JobReleaseTask); + } + if (Optional.IsCollectionDefined(CommonEnvironmentSettings)) + { + writer.WritePropertyName("commonEnvironmentSettings"u8); + writer.WriteStartArray(); + foreach (var item in CommonEnvironmentSettings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("poolInfo"u8); + writer.WriteObjectValue(PoolInfo); + if (Optional.IsDefined(OnAllTasksComplete)) + { + writer.WritePropertyName("onAllTasksComplete"u8); + writer.WriteStringValue(OnAllTasksComplete.Value.ToSerialString()); + } + if (Optional.IsDefined(OnTaskFailure)) + { + writer.WritePropertyName("onTaskFailure"u8); + writer.WriteStringValue(OnTaskFailure.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(UsesTaskDependencies)) + { + writer.WritePropertyName("usesTaskDependencies"u8); + writer.WriteBooleanValue(UsesTaskDependencies.Value); + } + if (Optional.IsDefined(NetworkConfiguration)) + { + writer.WritePropertyName("networkConfiguration"u8); + writer.WriteObjectValue(NetworkConfiguration); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAddParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAddParameter.cs new file mode 100644 index 000000000000..82d539386f2f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobAddParameter.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// An Azure Batch Job to add. + public partial class JobAddParameter + { + /// Initializes a new instance of JobAddParameter. + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case). + /// Specifies how a Job should be assigned to a Pool. + /// or is null. + public JobAddParameter(string id, PoolInformation poolInfo) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(poolInfo, nameof(poolInfo)); + + Id = id; + CommonEnvironmentSettings = new ChangeTrackingList(); + PoolInfo = poolInfo; + Metadata = new ChangeTrackingList(); + } + + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case). + public string Id { get; } + /// The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + public string DisplayName { get; set; } + /// Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. + public int? Priority { get; set; } + /// 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; set; } + /// If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. + public bool? AllowTaskPreemption { get; set; } + /// The execution constraints for the Job. + public JobConstraints Constraints { get; set; } + /// If the Job does not specify a Job Manager Task, the user must explicitly add Tasks to the Job. If the Job does specify a Job Manager Task, the Batch service creates the Job Manager Task when the Job is created, and will try to schedule the Job Manager Task before scheduling other Tasks in the Job. The Job Manager Task's typical purpose is to control and/or monitor Job execution, for example by deciding what additional Tasks to run, determining when the work is complete, etc. (However, a Job Manager Task is not restricted to these activities - it is a fully-fledged Task in the system and perform whatever actions are required for the Job.) For example, a Job Manager Task might download a file specified as a parameter, analyze the contents of that file and submit additional Tasks based on those contents. + public JobManagerTask JobManagerTask { get; set; } + /// If a Job has a Job Preparation Task, the Batch service will run the Job Preparation Task on a Node before starting any Tasks of that Job on that Compute Node. + public JobPreparationTask JobPreparationTask { get; set; } + /// A Job Release Task cannot be specified without also specifying a Job Preparation Task for the Job. The Batch service runs the Job Release Task on the Nodes that have run the Job Preparation Task. The primary purpose of the Job Release Task is to undo changes to Compute Nodes made by the Job Preparation Task. Example activities include deleting local files, or shutting down services that were started as part of Job preparation. + public JobReleaseTask JobReleaseTask { get; set; } + /// Individual Tasks can override an environment setting specified here by specifying the same setting name with a different value. + public IList CommonEnvironmentSettings { get; } + /// Specifies how a Job should be assigned to a Pool. + public PoolInformation PoolInfo { get; } + /// Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. + public OnAllTasksComplete? OnAllTasksComplete { get; set; } + /// A Task is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. + public OnTaskFailure? OnTaskFailure { get; set; } + /// The Batch service does not assign any meaning to metadata; it is solely for the use of user code. + public IList Metadata { get; } + /// Whether Tasks in the Job can define dependencies on each other. The default is false. + public bool? UsesTaskDependencies { get; set; } + /// The network configuration for the Job. + public JobNetworkConfiguration NetworkConfiguration { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobConstraints.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobConstraints.Serialization.cs new file mode 100644 index 000000000000..f694fa2392eb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobConstraints.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobConstraints : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(MaxWallClockTime)) + { + writer.WritePropertyName("maxWallClockTime"u8); + writer.WriteStringValue(MaxWallClockTime.Value, "P"); + } + if (Optional.IsDefined(MaxTaskRetryCount)) + { + writer.WritePropertyName("maxTaskRetryCount"u8); + writer.WriteNumberValue(MaxTaskRetryCount.Value); + } + writer.WriteEndObject(); + } + + internal static JobConstraints DeserializeJobConstraints(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional maxWallClockTime = default; + Optional maxTaskRetryCount = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxWallClockTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxWallClockTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("maxTaskRetryCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTaskRetryCount = property.Value.GetInt32(); + continue; + } + } + return new JobConstraints(Optional.ToNullable(maxWallClockTime), Optional.ToNullable(maxTaskRetryCount)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobConstraints.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobConstraints.cs new file mode 100644 index 000000000000..bd1d8fb1ab68 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobConstraints.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// The execution constraints for a Job. + public partial class JobConstraints + { + /// Initializes a new instance of JobConstraints. + public JobConstraints() + { + } + + /// Initializes a new instance of JobConstraints. + /// If the Job does not complete within the time limit, the Batch service terminates it and any Tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the Job may run. + /// Note that this value specifically controls the number of retries. The Batch service will try each Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry Tasks. If the maximum retry count is -1, the Batch service retries Tasks without limit. The default value is 0 (no retries). + internal JobConstraints(TimeSpan? maxWallClockTime, int? maxTaskRetryCount) + { + MaxWallClockTime = maxWallClockTime; + MaxTaskRetryCount = maxTaskRetryCount; + } + + /// If the Job does not complete within the time limit, the Batch service terminates it and any Tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the Job may run. + public TimeSpan? MaxWallClockTime { get; set; } + /// Note that this value specifically controls the number of retries. The Batch service will try each Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry Tasks. If the maximum retry count is -1, the Batch service retries Tasks without limit. The default value is 0 (no retries). + public int? MaxTaskRetryCount { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobDeleteOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobDeleteOptions.cs new file mode 100644 index 000000000000..e916f3f69c49 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobDeleteOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobDeleteOptions + { + /// Initializes a new instance of JobDeleteOptions. + public JobDeleteOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobDisableOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobDisableOptions.cs new file mode 100644 index 000000000000..b9b157ba787e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobDisableOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobDisableOptions + { + /// Initializes a new instance of JobDisableOptions. + public JobDisableOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobDisableParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobDisableParameter.Serialization.cs new file mode 100644 index 000000000000..f4b0f8ad2887 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobDisableParameter.Serialization.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobDisableParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("disableTasks"u8); + writer.WriteStringValue(DisableTasks.ToSerialString()); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobDisableParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobDisableParameter.cs new file mode 100644 index 000000000000..a680569933c5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobDisableParameter.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Options when disabling a Job. + public partial class JobDisableParameter + { + /// Initializes a new instance of JobDisableParameter. + /// What to do with active Tasks associated with the Job. + public JobDisableParameter(DisableJobOption disableTasks) + { + DisableTasks = disableTasks; + } + + /// What to do with active Tasks associated with the Job. + public DisableJobOption DisableTasks { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobEnableOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobEnableOptions.cs new file mode 100644 index 000000000000..7cca694d6d03 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobEnableOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobEnableOptions + { + /// Initializes a new instance of JobEnableOptions. + public JobEnableOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobExecutionInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobExecutionInformation.Serialization.cs new file mode 100644 index 000000000000..e277c48f1a69 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobExecutionInformation.Serialization.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobExecutionInformation + { + internal static JobExecutionInformation DeserializeJobExecutionInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset startTime = default; + Optional endTime = default; + Optional poolId = default; + Optional schedulingError = default; + Optional terminateReason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("poolId"u8)) + { + poolId = property.Value.GetString(); + continue; + } + if (property.NameEquals("schedulingError"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + schedulingError = JobSchedulingError.DeserializeJobSchedulingError(property.Value); + continue; + } + if (property.NameEquals("terminateReason"u8)) + { + terminateReason = property.Value.GetString(); + continue; + } + } + return new JobExecutionInformation(startTime, Optional.ToNullable(endTime), poolId.Value, schedulingError.Value, terminateReason.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobExecutionInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobExecutionInformation.cs new file mode 100644 index 000000000000..cb7ae32e4ff7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobExecutionInformation.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Contains information about the execution of a Job in the Azure Batch service. + public partial class JobExecutionInformation + { + /// Initializes a new instance of JobExecutionInformation. + /// This is the time at which the Job was created. + internal JobExecutionInformation(DateTimeOffset startTime) + { + StartTime = startTime; + } + + /// Initializes a new instance of JobExecutionInformation. + /// This is the time at which the Job was created. + /// This property is set only if the Job is in the completed state. + /// This element contains the actual Pool where the Job is assigned. When you get Job details from the service, they also contain a poolInfo element, which contains the Pool configuration data from when the Job was added or updated. That poolInfo element may also contain a poolId element. If it does, the two IDs are the same. If it does not, it means the Job ran on an auto Pool, and this property contains the ID of that auto Pool. + /// This property is not set if there was no error starting the Job. + /// This property is set only if the Job is in the completed state. If the Batch service terminates the Job, it sets the reason as follows: JMComplete - the Job Manager Task completed, and killJobOnCompletion was set to true. MaxWallClockTimeExpiry - the Job reached its maxWallClockTime constraint. TerminateJobSchedule - the Job ran as part of a schedule, and the schedule terminated. AllTasksComplete - the Job's onAllTasksComplete attribute is set to terminatejob, and all Tasks in the Job are complete. TaskFailed - the Job's onTaskFailure attribute is set to performExitOptionsJobAction, and a Task in the Job failed with an exit condition that specified a jobAction of terminatejob. Any other string is a user-defined reason specified in a call to the 'Terminate a Job' operation. + internal JobExecutionInformation(DateTimeOffset startTime, DateTimeOffset? endTime, string poolId, JobSchedulingError schedulingError, string terminateReason) + { + StartTime = startTime; + EndTime = endTime; + PoolId = poolId; + SchedulingError = schedulingError; + TerminateReason = terminateReason; + } + + /// This is the time at which the Job was created. + public DateTimeOffset StartTime { get; } + /// This property is set only if the Job is in the completed state. + public DateTimeOffset? EndTime { get; } + /// This element contains the actual Pool where the Job is assigned. When you get Job details from the service, they also contain a poolInfo element, which contains the Pool configuration data from when the Job was added or updated. That poolInfo element may also contain a poolId element. If it does, the two IDs are the same. If it does not, it means the Job ran on an auto Pool, and this property contains the ID of that auto Pool. + public string PoolId { get; } + /// This property is not set if there was no error starting the Job. + public JobSchedulingError SchedulingError { get; } + /// This property is set only if the Job is in the completed state. If the Batch service terminates the Job, it sets the reason as follows: JMComplete - the Job Manager Task completed, and killJobOnCompletion was set to true. MaxWallClockTimeExpiry - the Job reached its maxWallClockTime constraint. TerminateJobSchedule - the Job ran as part of a schedule, and the schedule terminated. AllTasksComplete - the Job's onAllTasksComplete attribute is set to terminatejob, and all Tasks in the Job are complete. TaskFailed - the Job's onTaskFailure attribute is set to performExitOptionsJobAction, and a Task in the Job failed with an exit condition that specified a jobAction of terminatejob. Any other string is a user-defined reason specified in a call to the 'Terminate a Job' operation. + public string TerminateReason { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobGetOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobGetOptions.cs new file mode 100644 index 000000000000..daae0d8ab887 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobGetOptions.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobGetOptions + { + /// Initializes a new instance of JobGetOptions. + public JobGetOptions() + { + } + + /// An OData $select clause. + public string Select { get; set; } + /// An OData $expand clause. + public string Expand { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobGetTaskCountsOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobGetTaskCountsOptions.cs new file mode 100644 index 000000000000..f7f2e7442373 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobGetTaskCountsOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobGetTaskCountsOptions + { + /// Initializes a new instance of JobGetTaskCountsOptions. + public JobGetTaskCountsOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobListFromJobScheduleOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobListFromJobScheduleOptions.cs new file mode 100644 index 000000000000..cbdb647208a7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobListFromJobScheduleOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobListFromJobScheduleOptions + { + /// Initializes a new instance of JobListFromJobScheduleOptions. + public JobListFromJobScheduleOptions() + { + } + + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. + public string Filter { get; set; } + /// An OData $select clause. + public string Select { get; set; } + /// An OData $expand clause. + public string Expand { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 Jobs can be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobListOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobListOptions.cs new file mode 100644 index 000000000000..883e0333ad95 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobListOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobListOptions + { + /// Initializes a new instance of JobListOptions. + public JobListOptions() + { + } + + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs. + public string Filter { get; set; } + /// An OData $select clause. + public string Select { get; set; } + /// An OData $expand clause. + public string Expand { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 Jobs can be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobListPreparationAndReleaseTaskStatusOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobListPreparationAndReleaseTaskStatusOptions.cs new file mode 100644 index 000000000000..edd8138f10a5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobListPreparationAndReleaseTaskStatusOptions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobListPreparationAndReleaseTaskStatusOptions + { + /// Initializes a new instance of JobListPreparationAndReleaseTaskStatusOptions. + public JobListPreparationAndReleaseTaskStatusOptions() + { + } + + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. + public string Filter { get; set; } + /// An OData $select clause. + public string Select { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 Tasks can be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobManagerTask.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobManagerTask.Serialization.cs new file mode 100644 index 000000000000..40111f8a6307 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobManagerTask.Serialization.cs @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobManagerTask : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + writer.WritePropertyName("commandLine"u8); + writer.WriteStringValue(CommandLine); + if (Optional.IsDefined(ContainerSettings)) + { + writer.WritePropertyName("containerSettings"u8); + writer.WriteObjectValue(ContainerSettings); + } + if (Optional.IsCollectionDefined(ResourceFiles)) + { + writer.WritePropertyName("resourceFiles"u8); + writer.WriteStartArray(); + foreach (var item in ResourceFiles) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(OutputFiles)) + { + writer.WritePropertyName("outputFiles"u8); + writer.WriteStartArray(); + foreach (var item in OutputFiles) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(EnvironmentSettings)) + { + writer.WritePropertyName("environmentSettings"u8); + writer.WriteStartArray(); + foreach (var item in EnvironmentSettings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Constraints)) + { + writer.WritePropertyName("constraints"u8); + writer.WriteObjectValue(Constraints); + } + if (Optional.IsDefined(RequiredSlots)) + { + writer.WritePropertyName("requiredSlots"u8); + writer.WriteNumberValue(RequiredSlots.Value); + } + if (Optional.IsDefined(KillJobOnCompletion)) + { + writer.WritePropertyName("killJobOnCompletion"u8); + writer.WriteBooleanValue(KillJobOnCompletion.Value); + } + if (Optional.IsDefined(UserIdentity)) + { + writer.WritePropertyName("userIdentity"u8); + writer.WriteObjectValue(UserIdentity); + } + if (Optional.IsDefined(RunExclusive)) + { + writer.WritePropertyName("runExclusive"u8); + writer.WriteBooleanValue(RunExclusive.Value); + } + if (Optional.IsCollectionDefined(ApplicationPackageReferences)) + { + writer.WritePropertyName("applicationPackageReferences"u8); + writer.WriteStartArray(); + foreach (var item in ApplicationPackageReferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AuthenticationTokenSettings)) + { + writer.WritePropertyName("authenticationTokenSettings"u8); + writer.WriteObjectValue(AuthenticationTokenSettings); + } + if (Optional.IsDefined(AllowLowPriorityNode)) + { + writer.WritePropertyName("allowLowPriorityNode"u8); + writer.WriteBooleanValue(AllowLowPriorityNode.Value); + } + writer.WriteEndObject(); + } + + internal static JobManagerTask DeserializeJobManagerTask(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + Optional displayName = default; + string commandLine = default; + Optional containerSettings = default; + Optional> resourceFiles = default; + Optional> outputFiles = default; + Optional> environmentSettings = default; + Optional constraints = default; + Optional requiredSlots = default; + Optional killJobOnCompletion = default; + Optional userIdentity = default; + Optional runExclusive = default; + Optional> applicationPackageReferences = default; + Optional authenticationTokenSettings = default; + Optional allowLowPriorityNode = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("commandLine"u8)) + { + commandLine = property.Value.GetString(); + continue; + } + if (property.NameEquals("containerSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerSettings = TaskContainerSettings.DeserializeTaskContainerSettings(property.Value); + continue; + } + if (property.NameEquals("resourceFiles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceFile.DeserializeResourceFile(item)); + } + resourceFiles = array; + continue; + } + if (property.NameEquals("outputFiles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutputFile.DeserializeOutputFile(item)); + } + outputFiles = array; + continue; + } + if (property.NameEquals("environmentSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EnvironmentSetting.DeserializeEnvironmentSetting(item)); + } + environmentSettings = array; + continue; + } + if (property.NameEquals("constraints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + constraints = TaskConstraints.DeserializeTaskConstraints(property.Value); + continue; + } + if (property.NameEquals("requiredSlots"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + requiredSlots = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("killJobOnCompletion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + killJobOnCompletion = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("userIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userIdentity = UserIdentity.DeserializeUserIdentity(property.Value); + continue; + } + if (property.NameEquals("runExclusive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + runExclusive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("applicationPackageReferences"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ApplicationPackageReference.DeserializeApplicationPackageReference(item)); + } + applicationPackageReferences = array; + continue; + } + if (property.NameEquals("authenticationTokenSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authenticationTokenSettings = AuthenticationTokenSettings.DeserializeAuthenticationTokenSettings(property.Value); + continue; + } + if (property.NameEquals("allowLowPriorityNode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowLowPriorityNode = property.Value.GetBoolean(); + continue; + } + } + return new JobManagerTask(id, displayName.Value, commandLine, containerSettings.Value, Optional.ToList(resourceFiles), Optional.ToList(outputFiles), Optional.ToList(environmentSettings), constraints.Value, Optional.ToNullable(requiredSlots), Optional.ToNullable(killJobOnCompletion), userIdentity.Value, Optional.ToNullable(runExclusive), Optional.ToList(applicationPackageReferences), authenticationTokenSettings.Value, Optional.ToNullable(allowLowPriorityNode)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobManagerTask.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobManagerTask.cs new file mode 100644 index 000000000000..53677491cc9d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobManagerTask.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The Job Manager Task is automatically started when the Job is created. The Batch service tries to schedule the Job Manager Task before any other Tasks in the Job. When shrinking a Pool, the Batch service tries to preserve Nodes where Job Manager Tasks are running for as long as possible (that is, Compute Nodes running 'normal' Tasks are removed before Compute Nodes running Job Manager Tasks). When a Job Manager Task fails and needs to be restarted, the system tries to schedule it at the highest priority. If there are no idle Compute Nodes available, the system may terminate one of the running Tasks in the Pool and return it to the queue in order to make room for the Job Manager Task to restart. Note that a Job Manager Task in one Job does not have priority over Tasks in other Jobs. Across Jobs, only Job level priorities are observed. For example, if a Job Manager in a priority 0 Job needs to be restarted, it will not displace Tasks of a priority 1 Job. Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. + public partial class JobManagerTask + { + /// Initializes a new instance of JobManagerTask. + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. + /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// or is null. + public JobManagerTask(string id, string commandLine) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(commandLine, nameof(commandLine)); + + Id = id; + CommandLine = commandLine; + ResourceFiles = new ChangeTrackingList(); + OutputFiles = new ChangeTrackingList(); + EnvironmentSettings = new ChangeTrackingList(); + ApplicationPackageReferences = new ChangeTrackingList(); + } + + /// Initializes a new instance of JobManagerTask. + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. + /// It need not be unique and can contain any Unicode characters up to a maximum length of 1024. + /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + /// Files listed under this element are located in the Task's working directory. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. + /// For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. + /// A list of environment variable settings for the Job Manager Task. + /// Execution constraints to apply to a Task. + /// 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. + /// If true, when the Job Manager Task completes, the Batch service marks the Job as complete. If any Tasks are still running at this time (other than Job Release), those Tasks are terminated. If false, the completion of the Job Manager Task does not affect the Job status. In this case, you should either use the onAllTasksComplete attribute to terminate the Job, or have a client or user terminate the Job explicitly. An example of this is if the Job Manager creates a set of Tasks but then takes no further role in their execution. The default value is true. If you are using the onAllTasksComplete and onTaskFailure attributes to control Job lifetime, and using the Job Manager Task only to create the Tasks for the Job (not to monitor progress), then it is important to set killJobOnCompletion to false. + /// If omitted, the Task runs as a non-administrative user unique to the Task. + /// If true, no other Tasks will run on the same Node for as long as the Job Manager is running. If false, other Tasks can run simultaneously with the Job Manager on a Compute Node. The Job Manager Task counts normally against the Compute Node's concurrent Task limit, so this is only relevant if the Compute Node allows multiple concurrent Tasks. The default value is true. + /// Application Packages are downloaded and deployed to a shared directory, not the Task working directory. Therefore, if a referenced Application Package is already on the Compute Node, and is up to date, then it is not re-downloaded; the existing copy on the Compute Node is used. If a referenced Application Package cannot be installed, for example because the package has been deleted or because download failed, the Task fails. + /// If this property is set, the Batch service provides the Task with an authentication token which can be used to authenticate Batch service operations without requiring an Account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the Task can carry out using the token depend on the settings. For example, a Task can request Job permissions in order to add other Tasks to the Job, or check the status of the Job or of other Tasks under the Job. + /// The default value is true. + internal JobManagerTask(string id, string displayName, string commandLine, TaskContainerSettings containerSettings, IList resourceFiles, IList outputFiles, IList environmentSettings, TaskConstraints constraints, int? requiredSlots, bool? killJobOnCompletion, UserIdentity userIdentity, bool? runExclusive, IList applicationPackageReferences, AuthenticationTokenSettings authenticationTokenSettings, bool? allowLowPriorityNode) + { + Id = id; + DisplayName = displayName; + CommandLine = commandLine; + ContainerSettings = containerSettings; + ResourceFiles = resourceFiles; + OutputFiles = outputFiles; + EnvironmentSettings = environmentSettings; + Constraints = constraints; + RequiredSlots = requiredSlots; + KillJobOnCompletion = killJobOnCompletion; + UserIdentity = userIdentity; + RunExclusive = runExclusive; + ApplicationPackageReferences = applicationPackageReferences; + AuthenticationTokenSettings = authenticationTokenSettings; + AllowLowPriorityNode = allowLowPriorityNode; + } + + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. + public string Id { get; set; } + /// It need not be unique and can contain any Unicode characters up to a maximum length of 1024. + public string DisplayName { get; set; } + /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + public string CommandLine { get; set; } + /// If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + public TaskContainerSettings ContainerSettings { get; set; } + /// Files listed under this element are located in the Task's working directory. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. + public IList ResourceFiles { get; } + /// For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. + public IList OutputFiles { get; } + /// A list of environment variable settings for the Job Manager Task. + public IList EnvironmentSettings { get; } + /// Execution constraints to apply to a Task. + public TaskConstraints Constraints { get; set; } + /// 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. + public int? RequiredSlots { get; set; } + /// If true, when the Job Manager Task completes, the Batch service marks the Job as complete. If any Tasks are still running at this time (other than Job Release), those Tasks are terminated. If false, the completion of the Job Manager Task does not affect the Job status. In this case, you should either use the onAllTasksComplete attribute to terminate the Job, or have a client or user terminate the Job explicitly. An example of this is if the Job Manager creates a set of Tasks but then takes no further role in their execution. The default value is true. If you are using the onAllTasksComplete and onTaskFailure attributes to control Job lifetime, and using the Job Manager Task only to create the Tasks for the Job (not to monitor progress), then it is important to set killJobOnCompletion to false. + public bool? KillJobOnCompletion { get; set; } + /// If omitted, the Task runs as a non-administrative user unique to the Task. + public UserIdentity UserIdentity { get; set; } + /// If true, no other Tasks will run on the same Node for as long as the Job Manager is running. If false, other Tasks can run simultaneously with the Job Manager on a Compute Node. The Job Manager Task counts normally against the Compute Node's concurrent Task limit, so this is only relevant if the Compute Node allows multiple concurrent Tasks. The default value is true. + public bool? RunExclusive { get; set; } + /// Application Packages are downloaded and deployed to a shared directory, not the Task working directory. Therefore, if a referenced Application Package is already on the Compute Node, and is up to date, then it is not re-downloaded; the existing copy on the Compute Node is used. If a referenced Application Package cannot be installed, for example because the package has been deleted or because download failed, the Task fails. + public IList ApplicationPackageReferences { get; } + /// If this property is set, the Batch service provides the Task with an authentication token which can be used to authenticate Batch service operations without requiring an Account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the Task can carry out using the token depend on the settings. For example, a Task can request Job permissions in order to add other Tasks to the Job, or check the status of the Job or of other Tasks under the Job. + public AuthenticationTokenSettings AuthenticationTokenSettings { get; set; } + /// The default value is true. + public bool? AllowLowPriorityNode { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobNetworkConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobNetworkConfiguration.Serialization.cs new file mode 100644 index 000000000000..42896aafeafa --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobNetworkConfiguration.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobNetworkConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + writer.WriteEndObject(); + } + + internal static JobNetworkConfiguration DeserializeJobNetworkConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subnetId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnetId"u8)) + { + subnetId = property.Value.GetString(); + continue; + } + } + return new JobNetworkConfiguration(subnetId); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobNetworkConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobNetworkConfiguration.cs new file mode 100644 index 000000000000..ab6c5080a05a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobNetworkConfiguration.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The network configuration for the Job. + public partial class JobNetworkConfiguration + { + /// Initializes a new instance of JobNetworkConfiguration. + /// The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes which will run Tasks from the Job. This can be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet so that Azure Batch service can schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is also required to be open for outbound connections for communications to Azure Storage. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// is null. + public JobNetworkConfiguration(string subnetId) + { + Argument.AssertNotNull(subnetId, nameof(subnetId)); + + SubnetId = subnetId; + } + + /// The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes which will run Tasks from the Job. This can be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet so that Azure Batch service can schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is also required to be open for outbound connections for communications to Azure Storage. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + public string SubnetId { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPatchOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPatchOptions.cs new file mode 100644 index 000000000000..cf6f20e63844 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPatchOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobPatchOptions + { + /// Initializes a new instance of JobPatchOptions. + public JobPatchOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPatchParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPatchParameter.Serialization.cs new file mode 100644 index 000000000000..70b15d7f8fdd --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPatchParameter.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobPatchParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Priority)) + { + writer.WritePropertyName("priority"u8); + writer.WriteNumberValue(Priority.Value); + } + if (Optional.IsDefined(MaxParallelTasks)) + { + writer.WritePropertyName("maxParallelTasks"u8); + writer.WriteNumberValue(MaxParallelTasks.Value); + } + if (Optional.IsDefined(AllowTaskPreemption)) + { + writer.WritePropertyName("allowTaskPreemption"u8); + writer.WriteBooleanValue(AllowTaskPreemption.Value); + } + if (Optional.IsDefined(OnAllTasksComplete)) + { + writer.WritePropertyName("onAllTasksComplete"u8); + writer.WriteStringValue(OnAllTasksComplete.Value.ToSerialString()); + } + if (Optional.IsDefined(Constraints)) + { + writer.WritePropertyName("constraints"u8); + writer.WriteObjectValue(Constraints); + } + if (Optional.IsDefined(PoolInfo)) + { + writer.WritePropertyName("poolInfo"u8); + writer.WriteObjectValue(PoolInfo); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPatchParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPatchParameter.cs new file mode 100644 index 000000000000..9a1655513198 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPatchParameter.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The set of changes to be made to a Job. + public partial class JobPatchParameter + { + /// Initializes a new instance of JobPatchParameter. + public JobPatchParameter() + { + Metadata = new ChangeTrackingList(); + } + + /// Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the Job is left unchanged. + public int? Priority { get; set; } + /// 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; set; } + /// If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. + public bool? AllowTaskPreemption { get; set; } + /// If omitted, the completion behavior is left unchanged. You may not change the value from terminatejob to noaction - that is, once you have engaged automatic Job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public OnAllTasksComplete? OnAllTasksComplete { get; set; } + /// If omitted, the existing execution constraints are left unchanged. + public JobConstraints Constraints { get; set; } + /// You may change the Pool for a Job only when the Job is disabled. The Patch Job call will fail if you include the poolInfo element and the Job is not disabled. If you specify an autoPoolSpecification in the poolInfo, only the keepAlive property of the autoPoolSpecification can be updated, and then only if the autoPoolSpecification has a poolLifetimeOption of Job (other job properties can be updated as normal). If omitted, the Job continues to run on its current Pool. + public PoolInformation PoolInfo { get; set; } + /// If omitted, the existing Job metadata is left unchanged. + public IList Metadata { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationAndReleaseTaskExecutionInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationAndReleaseTaskExecutionInformation.Serialization.cs new file mode 100644 index 000000000000..43fcea2cd8eb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationAndReleaseTaskExecutionInformation.Serialization.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobPreparationAndReleaseTaskExecutionInformation + { + internal static JobPreparationAndReleaseTaskExecutionInformation DeserializeJobPreparationAndReleaseTaskExecutionInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional poolId = default; + Optional nodeId = default; + Optional nodeUrl = default; + Optional jobPreparationTaskExecutionInfo = default; + Optional jobReleaseTaskExecutionInfo = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("poolId"u8)) + { + poolId = property.Value.GetString(); + continue; + } + if (property.NameEquals("nodeId"u8)) + { + nodeId = property.Value.GetString(); + continue; + } + if (property.NameEquals("nodeUrl"u8)) + { + nodeUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("jobPreparationTaskExecutionInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobPreparationTaskExecutionInfo = JobPreparationTaskExecutionInformation.DeserializeJobPreparationTaskExecutionInformation(property.Value); + continue; + } + if (property.NameEquals("jobReleaseTaskExecutionInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobReleaseTaskExecutionInfo = JobReleaseTaskExecutionInformation.DeserializeJobReleaseTaskExecutionInformation(property.Value); + continue; + } + } + return new JobPreparationAndReleaseTaskExecutionInformation(poolId.Value, nodeId.Value, nodeUrl.Value, jobPreparationTaskExecutionInfo.Value, jobReleaseTaskExecutionInfo.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationAndReleaseTaskExecutionInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationAndReleaseTaskExecutionInformation.cs new file mode 100644 index 000000000000..dc6fb5644eb5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationAndReleaseTaskExecutionInformation.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The status of the Job Preparation and Job Release Tasks on a Compute Node. + public partial class JobPreparationAndReleaseTaskExecutionInformation + { + /// Initializes a new instance of JobPreparationAndReleaseTaskExecutionInformation. + internal JobPreparationAndReleaseTaskExecutionInformation() + { + } + + /// Initializes a new instance of JobPreparationAndReleaseTaskExecutionInformation. + /// The ID of the Pool containing the Compute Node to which this entry refers. + /// The ID of the Compute Node to which this entry refers. + /// The URL of the Compute Node to which this entry refers. + /// Contains information about the execution of a Job Preparation Task on a Compute Node. + /// This property is set only if the Job Release Task has run on the Compute Node. + internal JobPreparationAndReleaseTaskExecutionInformation(string poolId, string nodeId, string nodeUrl, JobPreparationTaskExecutionInformation jobPreparationTaskExecutionInfo, JobReleaseTaskExecutionInformation jobReleaseTaskExecutionInfo) + { + PoolId = poolId; + NodeId = nodeId; + NodeUrl = nodeUrl; + JobPreparationTaskExecutionInfo = jobPreparationTaskExecutionInfo; + JobReleaseTaskExecutionInfo = jobReleaseTaskExecutionInfo; + } + + /// The ID of the Pool containing the Compute Node to which this entry refers. + public string PoolId { get; } + /// The ID of the Compute Node to which this entry refers. + public string NodeId { get; } + /// The URL of the Compute Node to which this entry refers. + public string NodeUrl { get; } + /// Contains information about the execution of a Job Preparation Task on a Compute Node. + public JobPreparationTaskExecutionInformation JobPreparationTaskExecutionInfo { get; } + /// This property is set only if the Job Release Task has run on the Compute Node. + public JobReleaseTaskExecutionInformation JobReleaseTaskExecutionInfo { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTask.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTask.Serialization.cs new file mode 100644 index 000000000000..d1b408eae3d4 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTask.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobPreparationTask : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + writer.WritePropertyName("commandLine"u8); + writer.WriteStringValue(CommandLine); + if (Optional.IsDefined(ContainerSettings)) + { + writer.WritePropertyName("containerSettings"u8); + writer.WriteObjectValue(ContainerSettings); + } + if (Optional.IsCollectionDefined(ResourceFiles)) + { + writer.WritePropertyName("resourceFiles"u8); + writer.WriteStartArray(); + foreach (var item in ResourceFiles) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(EnvironmentSettings)) + { + writer.WritePropertyName("environmentSettings"u8); + writer.WriteStartArray(); + foreach (var item in EnvironmentSettings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Constraints)) + { + writer.WritePropertyName("constraints"u8); + writer.WriteObjectValue(Constraints); + } + if (Optional.IsDefined(WaitForSuccess)) + { + writer.WritePropertyName("waitForSuccess"u8); + writer.WriteBooleanValue(WaitForSuccess.Value); + } + if (Optional.IsDefined(UserIdentity)) + { + writer.WritePropertyName("userIdentity"u8); + writer.WriteObjectValue(UserIdentity); + } + if (Optional.IsDefined(RerunOnNodeRebootAfterSuccess)) + { + writer.WritePropertyName("rerunOnNodeRebootAfterSuccess"u8); + writer.WriteBooleanValue(RerunOnNodeRebootAfterSuccess.Value); + } + writer.WriteEndObject(); + } + + internal static JobPreparationTask DeserializeJobPreparationTask(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + string commandLine = default; + Optional containerSettings = default; + Optional> resourceFiles = default; + Optional> environmentSettings = default; + Optional constraints = default; + Optional waitForSuccess = default; + Optional userIdentity = default; + Optional rerunOnNodeRebootAfterSuccess = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("commandLine"u8)) + { + commandLine = property.Value.GetString(); + continue; + } + if (property.NameEquals("containerSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerSettings = TaskContainerSettings.DeserializeTaskContainerSettings(property.Value); + continue; + } + if (property.NameEquals("resourceFiles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceFile.DeserializeResourceFile(item)); + } + resourceFiles = array; + continue; + } + if (property.NameEquals("environmentSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EnvironmentSetting.DeserializeEnvironmentSetting(item)); + } + environmentSettings = array; + continue; + } + if (property.NameEquals("constraints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + constraints = TaskConstraints.DeserializeTaskConstraints(property.Value); + continue; + } + if (property.NameEquals("waitForSuccess"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + waitForSuccess = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("userIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userIdentity = UserIdentity.DeserializeUserIdentity(property.Value); + continue; + } + if (property.NameEquals("rerunOnNodeRebootAfterSuccess"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rerunOnNodeRebootAfterSuccess = property.Value.GetBoolean(); + continue; + } + } + return new JobPreparationTask(id.Value, commandLine, containerSettings.Value, Optional.ToList(resourceFiles), Optional.ToList(environmentSettings), constraints.Value, Optional.ToNullable(waitForSuccess), userIdentity.Value, Optional.ToNullable(rerunOnNodeRebootAfterSuccess)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTask.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTask.cs new file mode 100644 index 000000000000..7b3c642eba07 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTask.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// You can use Job Preparation to prepare a Node to run Tasks for the Job. Activities commonly performed in Job Preparation include: Downloading common resource files used by all the Tasks in the Job. The Job Preparation Task can download these common resource files to the shared location on the Node. (AZ_BATCH_NODE_ROOT_DIR\shared), or starting a local service on the Node so that all Tasks of that Job can communicate with it. If the Job Preparation Task fails (that is, exhausts its retry count before exiting with exit code 0), Batch will not run Tasks of this Job on the Node. The Compute Node remains ineligible to run Tasks of this Job until it is reimaged. The Compute Node remains active and can be used for other Jobs. The Job Preparation Task can run multiple times on the same Node. Therefore, you should write the Job Preparation Task to handle re-execution. If the Node is rebooted, the Job Preparation Task is run again on the Compute Node before scheduling any other Task of the Job, if rerunOnNodeRebootAfterSuccess is true or if the Job Preparation Task did not previously complete. If the Node is reimaged, the Job Preparation Task is run again before scheduling any Task of the Job. Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. + public partial class JobPreparationTask + { + /// Initializes a new instance of JobPreparationTask. + /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// is null. + public JobPreparationTask(string commandLine) + { + Argument.AssertNotNull(commandLine, nameof(commandLine)); + + CommandLine = commandLine; + ResourceFiles = new ChangeTrackingList(); + EnvironmentSettings = new ChangeTrackingList(); + } + + /// Initializes a new instance of JobPreparationTask. + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other Task in the Job can have the same ID as the Job Preparation Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). + /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + /// Files listed under this element are located in the Task's working directory. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. + /// A list of environment variable settings for the Job Preparation Task. + /// Execution constraints to apply to a Task. + /// If true and the Job Preparation Task fails on a Node, the Batch service retries the Job Preparation Task up to its maximum retry count (as specified in the constraints element). If the Task has still not completed successfully after all retries, then the Batch service will not schedule Tasks of the Job to the Node. The Node remains active and eligible to run Tasks of other Jobs. If false, the Batch service will not wait for the Job Preparation Task to complete. In this case, other Tasks of the Job can start executing on the Compute Node while the Job Preparation Task is still running; and even if the Job Preparation Task fails, new Tasks will continue to be scheduled on the Compute Node. The default value is true. + /// If omitted, the Task runs as a non-administrative user unique to the Task on Windows Compute Nodes, or a non-administrative user unique to the Pool on Linux Compute Nodes. + /// The Job Preparation Task is always rerun if a Compute Node is reimaged, or if the Job Preparation Task did not complete (e.g. because the reboot occurred while the Task was running). Therefore, you should always write a Job Preparation Task to be idempotent and to behave correctly if run multiple times. The default value is true. + internal JobPreparationTask(string id, string commandLine, TaskContainerSettings containerSettings, IList resourceFiles, IList environmentSettings, TaskConstraints constraints, bool? waitForSuccess, UserIdentity userIdentity, bool? rerunOnNodeRebootAfterSuccess) + { + Id = id; + CommandLine = commandLine; + ContainerSettings = containerSettings; + ResourceFiles = resourceFiles; + EnvironmentSettings = environmentSettings; + Constraints = constraints; + WaitForSuccess = waitForSuccess; + UserIdentity = userIdentity; + RerunOnNodeRebootAfterSuccess = rerunOnNodeRebootAfterSuccess; + } + + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other Task in the Job can have the same ID as the Job Preparation Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). + public string Id { get; set; } + /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + public string CommandLine { get; set; } + /// When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + public TaskContainerSettings ContainerSettings { get; set; } + /// Files listed under this element are located in the Task's working directory. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. + public IList ResourceFiles { get; } + /// A list of environment variable settings for the Job Preparation Task. + public IList EnvironmentSettings { get; } + /// Execution constraints to apply to a Task. + public TaskConstraints Constraints { get; set; } + /// If true and the Job Preparation Task fails on a Node, the Batch service retries the Job Preparation Task up to its maximum retry count (as specified in the constraints element). If the Task has still not completed successfully after all retries, then the Batch service will not schedule Tasks of the Job to the Node. The Node remains active and eligible to run Tasks of other Jobs. If false, the Batch service will not wait for the Job Preparation Task to complete. In this case, other Tasks of the Job can start executing on the Compute Node while the Job Preparation Task is still running; and even if the Job Preparation Task fails, new Tasks will continue to be scheduled on the Compute Node. The default value is true. + public bool? WaitForSuccess { get; set; } + /// If omitted, the Task runs as a non-administrative user unique to the Task on Windows Compute Nodes, or a non-administrative user unique to the Pool on Linux Compute Nodes. + public UserIdentity UserIdentity { get; set; } + /// The Job Preparation Task is always rerun if a Compute Node is reimaged, or if the Job Preparation Task did not complete (e.g. because the reboot occurred while the Task was running). Therefore, you should always write a Job Preparation Task to be idempotent and to behave correctly if run multiple times. The default value is true. + public bool? RerunOnNodeRebootAfterSuccess { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTaskExecutionInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTaskExecutionInformation.Serialization.cs new file mode 100644 index 000000000000..53d064e51ebc --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTaskExecutionInformation.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobPreparationTaskExecutionInformation + { + internal static JobPreparationTaskExecutionInformation DeserializeJobPreparationTaskExecutionInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset startTime = default; + Optional endTime = default; + JobPreparationTaskState state = default; + Optional taskRootDirectory = default; + Optional taskRootDirectoryUrl = default; + Optional exitCode = default; + Optional containerInfo = default; + Optional failureInfo = default; + int retryCount = default; + Optional lastRetryTime = default; + Optional result = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString().ToJobPreparationTaskState(); + continue; + } + if (property.NameEquals("taskRootDirectory"u8)) + { + taskRootDirectory = property.Value.GetString(); + continue; + } + if (property.NameEquals("taskRootDirectoryUrl"u8)) + { + taskRootDirectoryUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("exitCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exitCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("containerInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerInfo = TaskContainerExecutionInformation.DeserializeTaskContainerExecutionInformation(property.Value); + continue; + } + if (property.NameEquals("failureInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failureInfo = TaskFailureInformation.DeserializeTaskFailureInformation(property.Value); + continue; + } + if (property.NameEquals("retryCount"u8)) + { + retryCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("lastRetryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastRetryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("result"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + result = property.Value.GetString().ToTaskExecutionResult(); + continue; + } + } + return new JobPreparationTaskExecutionInformation(startTime, Optional.ToNullable(endTime), state, taskRootDirectory.Value, taskRootDirectoryUrl.Value, Optional.ToNullable(exitCode), containerInfo.Value, failureInfo.Value, retryCount, Optional.ToNullable(lastRetryTime), Optional.ToNullable(result)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTaskExecutionInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTaskExecutionInformation.cs new file mode 100644 index 000000000000..33123c3ea6a6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTaskExecutionInformation.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Contains information about the execution of a Job Preparation Task on a Compute Node. + public partial class JobPreparationTaskExecutionInformation + { + /// Initializes a new instance of JobPreparationTaskExecutionInformation. + /// If the Task has been restarted or retried, this is the most recent time at which the Task started running. + /// The current state of the Job Preparation Task on the Compute Node. + /// Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. + internal JobPreparationTaskExecutionInformation(DateTimeOffset startTime, JobPreparationTaskState state, int retryCount) + { + StartTime = startTime; + State = state; + RetryCount = retryCount; + } + + /// Initializes a new instance of JobPreparationTaskExecutionInformation. + /// If the Task has been restarted or retried, this is the most recent time at which the Task started running. + /// This property is set only if the Task is in the Completed state. + /// The current state of the Job Preparation Task on the Compute Node. + /// The root directory of the Job Preparation Task on the Compute Node. You can use this path to retrieve files created by the Task, such as log files. + /// The URL to the root directory of the Job Preparation Task on the Compute Node. + /// This parameter is returned only if the Task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the Compute Node operating system, such as when a process is forcibly terminated. + /// This property is set only if the Task runs in a container context. + /// This property is set only if the Task is in the completed state and encountered a failure. + /// Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. + /// This property is set only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. + /// If the value is 'failed', then the details of the failure can be found in the failureInfo property. + internal JobPreparationTaskExecutionInformation(DateTimeOffset startTime, DateTimeOffset? endTime, JobPreparationTaskState state, string taskRootDirectory, string taskRootDirectoryUrl, int? exitCode, TaskContainerExecutionInformation containerInfo, TaskFailureInformation failureInfo, int retryCount, DateTimeOffset? lastRetryTime, TaskExecutionResult? result) + { + StartTime = startTime; + EndTime = endTime; + State = state; + TaskRootDirectory = taskRootDirectory; + TaskRootDirectoryUrl = taskRootDirectoryUrl; + ExitCode = exitCode; + ContainerInfo = containerInfo; + FailureInfo = failureInfo; + RetryCount = retryCount; + LastRetryTime = lastRetryTime; + Result = result; + } + + /// If the Task has been restarted or retried, this is the most recent time at which the Task started running. + public DateTimeOffset StartTime { get; } + /// This property is set only if the Task is in the Completed state. + public DateTimeOffset? EndTime { get; } + /// The current state of the Job Preparation Task on the Compute Node. + public JobPreparationTaskState State { get; } + /// The root directory of the Job Preparation Task on the Compute Node. You can use this path to retrieve files created by the Task, such as log files. + public string TaskRootDirectory { get; } + /// The URL to the root directory of the Job Preparation Task on the Compute Node. + public string TaskRootDirectoryUrl { get; } + /// This parameter is returned only if the Task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the Compute Node operating system, such as when a process is forcibly terminated. + public int? ExitCode { get; } + /// This property is set only if the Task runs in a container context. + public TaskContainerExecutionInformation ContainerInfo { get; } + /// This property is set only if the Task is in the completed state and encountered a failure. + public TaskFailureInformation FailureInfo { get; } + /// Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. + public int RetryCount { get; } + /// This property is set only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. + public DateTimeOffset? LastRetryTime { get; } + /// If the value is 'failed', then the details of the failure can be found in the failureInfo property. + public TaskExecutionResult? Result { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTaskState.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTaskState.Serialization.cs new file mode 100644 index 000000000000..e31d87fb4c4f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTaskState.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class JobPreparationTaskStateExtensions + { + public static string ToSerialString(this JobPreparationTaskState value) => value switch + { + JobPreparationTaskState.Running => "running", + JobPreparationTaskState.Completed => "completed", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown JobPreparationTaskState value.") + }; + + public static JobPreparationTaskState ToJobPreparationTaskState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "running")) return JobPreparationTaskState.Running; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "completed")) return JobPreparationTaskState.Completed; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown JobPreparationTaskState value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTaskState.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTaskState.cs new file mode 100644 index 000000000000..ca8ee994d5d9 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobPreparationTaskState.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The current state of the Job Preparation Task on the Compute Node. + public enum JobPreparationTaskState + { + /// The Task is currently running (including retrying). + Running, + /// The Task has exited with exit code 0, or the Task has exhausted its retry limit, or the Batch service was unable to start the Task due to Task preparation errors (such as resource file download failures). + Completed + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTask.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTask.Serialization.cs new file mode 100644 index 000000000000..de510b003084 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTask.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobReleaseTask : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + writer.WritePropertyName("commandLine"u8); + writer.WriteStringValue(CommandLine); + if (Optional.IsDefined(ContainerSettings)) + { + writer.WritePropertyName("containerSettings"u8); + writer.WriteObjectValue(ContainerSettings); + } + if (Optional.IsCollectionDefined(ResourceFiles)) + { + writer.WritePropertyName("resourceFiles"u8); + writer.WriteStartArray(); + foreach (var item in ResourceFiles) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(EnvironmentSettings)) + { + writer.WritePropertyName("environmentSettings"u8); + writer.WriteStartArray(); + foreach (var item in EnvironmentSettings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(MaxWallClockTime)) + { + writer.WritePropertyName("maxWallClockTime"u8); + writer.WriteStringValue(MaxWallClockTime.Value, "P"); + } + if (Optional.IsDefined(RetentionTime)) + { + writer.WritePropertyName("retentionTime"u8); + writer.WriteStringValue(RetentionTime.Value, "P"); + } + if (Optional.IsDefined(UserIdentity)) + { + writer.WritePropertyName("userIdentity"u8); + writer.WriteObjectValue(UserIdentity); + } + writer.WriteEndObject(); + } + + internal static JobReleaseTask DeserializeJobReleaseTask(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + string commandLine = default; + Optional containerSettings = default; + Optional> resourceFiles = default; + Optional> environmentSettings = default; + Optional maxWallClockTime = default; + Optional retentionTime = default; + Optional userIdentity = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("commandLine"u8)) + { + commandLine = property.Value.GetString(); + continue; + } + if (property.NameEquals("containerSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerSettings = TaskContainerSettings.DeserializeTaskContainerSettings(property.Value); + continue; + } + if (property.NameEquals("resourceFiles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceFile.DeserializeResourceFile(item)); + } + resourceFiles = array; + continue; + } + if (property.NameEquals("environmentSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EnvironmentSetting.DeserializeEnvironmentSetting(item)); + } + environmentSettings = array; + continue; + } + if (property.NameEquals("maxWallClockTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxWallClockTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("retentionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retentionTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("userIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userIdentity = UserIdentity.DeserializeUserIdentity(property.Value); + continue; + } + } + return new JobReleaseTask(id.Value, commandLine, containerSettings.Value, Optional.ToList(resourceFiles), Optional.ToList(environmentSettings), Optional.ToNullable(maxWallClockTime), Optional.ToNullable(retentionTime), userIdentity.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTask.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTask.cs new file mode 100644 index 000000000000..7a5e7ad38103 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTask.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The Job Release Task runs when the Job ends, because of one of the following: The user calls the Terminate Job API, or the Delete Job API while the Job is still active, the Job's maximum wall clock time constraint is reached, and the Job is still active, or the Job's Job Manager Task completed, and the Job is configured to terminate when the Job Manager completes. The Job Release Task runs on each Node where Tasks of the Job have run and the Job Preparation Task ran and completed. If you reimage a Node after it has run the Job Preparation Task, and the Job ends without any further Tasks of the Job running on that Node (and hence the Job Preparation Task does not re-run), then the Job Release Task does not run on that Compute Node. If a Node reboots while the Job Release Task is still running, the Job Release Task runs again when the Compute Node starts up. The Job is not marked as complete until all Job Release Tasks have completed. The Job Release Task runs in the background. It does not occupy a scheduling slot; that is, it does not count towards the taskSlotsPerNode limit specified on the Pool. + public partial class JobReleaseTask + { + /// Initializes a new instance of JobReleaseTask. + /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// is null. + public JobReleaseTask(string commandLine) + { + Argument.AssertNotNull(commandLine, nameof(commandLine)); + + CommandLine = commandLine; + ResourceFiles = new ChangeTrackingList(); + EnvironmentSettings = new ChangeTrackingList(); + } + + /// Initializes a new instance of JobReleaseTask. + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other Task in the Job can have the same ID as the Job Release Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). + /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + /// Files listed under this element are located in the Task's working directory. + /// A list of environment variable settings for the Job Release Task. + /// The maximum elapsed time that the Job Release Task may run on a given Compute Node, measured from the time the Task starts. If the Task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes. You may not specify a timeout longer than 15 minutes. If you do, the Batch service rejects it with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + /// The default is 7 days, i.e. the Task directory will be retained for 7 days unless the Compute Node is removed or the Job is deleted. + /// If omitted, the Task runs as a non-administrative user unique to the Task. + internal JobReleaseTask(string id, string commandLine, TaskContainerSettings containerSettings, IList resourceFiles, IList environmentSettings, TimeSpan? maxWallClockTime, TimeSpan? retentionTime, UserIdentity userIdentity) + { + Id = id; + CommandLine = commandLine; + ContainerSettings = containerSettings; + ResourceFiles = resourceFiles; + EnvironmentSettings = environmentSettings; + MaxWallClockTime = maxWallClockTime; + RetentionTime = retentionTime; + UserIdentity = userIdentity; + } + + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other Task in the Job can have the same ID as the Job Release Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). + public string Id { get; set; } + /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + public string CommandLine { get; set; } + /// When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + public TaskContainerSettings ContainerSettings { get; set; } + /// Files listed under this element are located in the Task's working directory. + public IList ResourceFiles { get; } + /// A list of environment variable settings for the Job Release Task. + public IList EnvironmentSettings { get; } + /// The maximum elapsed time that the Job Release Task may run on a given Compute Node, measured from the time the Task starts. If the Task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes. You may not specify a timeout longer than 15 minutes. If you do, the Batch service rejects it with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public TimeSpan? MaxWallClockTime { get; set; } + /// The default is 7 days, i.e. the Task directory will be retained for 7 days unless the Compute Node is removed or the Job is deleted. + public TimeSpan? RetentionTime { get; set; } + /// If omitted, the Task runs as a non-administrative user unique to the Task. + public UserIdentity UserIdentity { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTaskExecutionInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTaskExecutionInformation.Serialization.cs new file mode 100644 index 000000000000..e770573a3a78 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTaskExecutionInformation.Serialization.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobReleaseTaskExecutionInformation + { + internal static JobReleaseTaskExecutionInformation DeserializeJobReleaseTaskExecutionInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset startTime = default; + Optional endTime = default; + JobReleaseTaskState state = default; + Optional taskRootDirectory = default; + Optional taskRootDirectoryUrl = default; + Optional exitCode = default; + Optional containerInfo = default; + Optional failureInfo = default; + Optional result = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString().ToJobReleaseTaskState(); + continue; + } + if (property.NameEquals("taskRootDirectory"u8)) + { + taskRootDirectory = property.Value.GetString(); + continue; + } + if (property.NameEquals("taskRootDirectoryUrl"u8)) + { + taskRootDirectoryUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("exitCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exitCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("containerInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerInfo = TaskContainerExecutionInformation.DeserializeTaskContainerExecutionInformation(property.Value); + continue; + } + if (property.NameEquals("failureInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failureInfo = TaskFailureInformation.DeserializeTaskFailureInformation(property.Value); + continue; + } + if (property.NameEquals("result"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + result = property.Value.GetString().ToTaskExecutionResult(); + continue; + } + } + return new JobReleaseTaskExecutionInformation(startTime, Optional.ToNullable(endTime), state, taskRootDirectory.Value, taskRootDirectoryUrl.Value, Optional.ToNullable(exitCode), containerInfo.Value, failureInfo.Value, Optional.ToNullable(result)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTaskExecutionInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTaskExecutionInformation.cs new file mode 100644 index 000000000000..7793c854d180 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTaskExecutionInformation.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Contains information about the execution of a Job Release Task on a Compute Node. + public partial class JobReleaseTaskExecutionInformation + { + /// Initializes a new instance of JobReleaseTaskExecutionInformation. + /// If the Task has been restarted or retried, this is the most recent time at which the Task started running. + /// The current state of the Job Release Task on the Compute Node. + internal JobReleaseTaskExecutionInformation(DateTimeOffset startTime, JobReleaseTaskState state) + { + StartTime = startTime; + State = state; + } + + /// Initializes a new instance of JobReleaseTaskExecutionInformation. + /// If the Task has been restarted or retried, this is the most recent time at which the Task started running. + /// This property is set only if the Task is in the Completed state. + /// The current state of the Job Release Task on the Compute Node. + /// The root directory of the Job Release Task on the Compute Node. You can use this path to retrieve files created by the Task, such as log files. + /// The URL to the root directory of the Job Release Task on the Compute Node. + /// This parameter is returned only if the Task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the Compute Node operating system, such as when a process is forcibly terminated. + /// This property is set only if the Task runs in a container context. + /// This property is set only if the Task is in the completed state and encountered a failure. + /// If the value is 'failed', then the details of the failure can be found in the failureInfo property. + internal JobReleaseTaskExecutionInformation(DateTimeOffset startTime, DateTimeOffset? endTime, JobReleaseTaskState state, string taskRootDirectory, string taskRootDirectoryUrl, int? exitCode, TaskContainerExecutionInformation containerInfo, TaskFailureInformation failureInfo, TaskExecutionResult? result) + { + StartTime = startTime; + EndTime = endTime; + State = state; + TaskRootDirectory = taskRootDirectory; + TaskRootDirectoryUrl = taskRootDirectoryUrl; + ExitCode = exitCode; + ContainerInfo = containerInfo; + FailureInfo = failureInfo; + Result = result; + } + + /// If the Task has been restarted or retried, this is the most recent time at which the Task started running. + public DateTimeOffset StartTime { get; } + /// This property is set only if the Task is in the Completed state. + public DateTimeOffset? EndTime { get; } + /// The current state of the Job Release Task on the Compute Node. + public JobReleaseTaskState State { get; } + /// The root directory of the Job Release Task on the Compute Node. You can use this path to retrieve files created by the Task, such as log files. + public string TaskRootDirectory { get; } + /// The URL to the root directory of the Job Release Task on the Compute Node. + public string TaskRootDirectoryUrl { get; } + /// This parameter is returned only if the Task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the Compute Node operating system, such as when a process is forcibly terminated. + public int? ExitCode { get; } + /// This property is set only if the Task runs in a container context. + public TaskContainerExecutionInformation ContainerInfo { get; } + /// This property is set only if the Task is in the completed state and encountered a failure. + public TaskFailureInformation FailureInfo { get; } + /// If the value is 'failed', then the details of the failure can be found in the failureInfo property. + public TaskExecutionResult? Result { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTaskState.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTaskState.Serialization.cs new file mode 100644 index 000000000000..0f863fd04654 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTaskState.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class JobReleaseTaskStateExtensions + { + public static string ToSerialString(this JobReleaseTaskState value) => value switch + { + JobReleaseTaskState.Running => "running", + JobReleaseTaskState.Completed => "completed", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown JobReleaseTaskState value.") + }; + + public static JobReleaseTaskState ToJobReleaseTaskState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "running")) return JobReleaseTaskState.Running; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "completed")) return JobReleaseTaskState.Completed; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown JobReleaseTaskState value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTaskState.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTaskState.cs new file mode 100644 index 000000000000..7fd1850a24da --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobReleaseTaskState.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The current state of the Job Release Task on the Compute Node. + public enum JobReleaseTaskState + { + /// The Task is currently running (including retrying). + Running, + /// The Task has exited with exit code 0, or the Task has exhausted its retry limit, or the Batch service was unable to start the Task due to Task preparation errors (such as resource file download failures). + Completed + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleAddOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleAddOptions.cs new file mode 100644 index 000000000000..dfbb7a983837 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleAddOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobScheduleAddOptions + { + /// Initializes a new instance of JobScheduleAddOptions. + public JobScheduleAddOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleAddParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleAddParameter.Serialization.cs new file mode 100644 index 000000000000..0150da35c2bd --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleAddParameter.Serialization.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobScheduleAddParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + writer.WritePropertyName("schedule"u8); + writer.WriteObjectValue(Schedule); + writer.WritePropertyName("jobSpecification"u8); + writer.WriteObjectValue(JobSpecification); + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleAddParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleAddParameter.cs new file mode 100644 index 000000000000..bf66d479fb19 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleAddParameter.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A Job Schedule that allows recurring Jobs by specifying when to run Jobs and a specification used to create each Job. + public partial class JobScheduleAddParameter + { + /// Initializes a new instance of JobScheduleAddParameter. + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case). + /// All times are fixed respective to UTC and are not impacted by daylight saving time. + /// Specifies details of the Jobs to be created on a schedule. + /// , or is null. + public JobScheduleAddParameter(string id, Schedule schedule, JobSpecification jobSpecification) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(schedule, nameof(schedule)); + Argument.AssertNotNull(jobSpecification, nameof(jobSpecification)); + + Id = id; + Schedule = schedule; + JobSpecification = jobSpecification; + Metadata = new ChangeTrackingList(); + } + + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case). + public string Id { get; } + /// The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + public string DisplayName { get; set; } + /// All times are fixed respective to UTC and are not impacted by daylight saving time. + public Schedule Schedule { get; } + /// Specifies details of the Jobs to be created on a schedule. + public JobSpecification JobSpecification { get; } + /// The Batch service does not assign any meaning to metadata; it is solely for the use of user code. + public IList Metadata { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleDeleteOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleDeleteOptions.cs new file mode 100644 index 000000000000..23029cd74a41 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleDeleteOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobScheduleDeleteOptions + { + /// Initializes a new instance of JobScheduleDeleteOptions. + public JobScheduleDeleteOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleDisableOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleDisableOptions.cs new file mode 100644 index 000000000000..1eb899ef4b5d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleDisableOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobScheduleDisableOptions + { + /// Initializes a new instance of JobScheduleDisableOptions. + public JobScheduleDisableOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleEnableOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleEnableOptions.cs new file mode 100644 index 000000000000..4fa43f11ccdf --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleEnableOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobScheduleEnableOptions + { + /// Initializes a new instance of JobScheduleEnableOptions. + public JobScheduleEnableOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleExecutionInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleExecutionInformation.Serialization.cs new file mode 100644 index 000000000000..88822179d48c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleExecutionInformation.Serialization.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobScheduleExecutionInformation + { + internal static JobScheduleExecutionInformation DeserializeJobScheduleExecutionInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional nextRunTime = default; + Optional recentJob = default; + Optional endTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextRunTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextRunTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("recentJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recentJob = RecentJob.DeserializeRecentJob(property.Value); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new JobScheduleExecutionInformation(Optional.ToNullable(nextRunTime), recentJob.Value, Optional.ToNullable(endTime)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleExecutionInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleExecutionInformation.cs new file mode 100644 index 000000000000..9bf4ed4005b8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleExecutionInformation.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Contains information about Jobs that have been and will be run under a Job Schedule. + public partial class JobScheduleExecutionInformation + { + /// Initializes a new instance of JobScheduleExecutionInformation. + internal JobScheduleExecutionInformation() + { + } + + /// Initializes a new instance of JobScheduleExecutionInformation. + /// This property is meaningful only if the schedule is in the active state when the time comes around. For example, if the schedule is disabled, no Job will be created at nextRunTime unless the Job is enabled before then. + /// This property is present only if the at least one Job has run under the schedule. + /// This property is set only if the Job Schedule is in the completed state. + internal JobScheduleExecutionInformation(DateTimeOffset? nextRunTime, RecentJob recentJob, DateTimeOffset? endTime) + { + NextRunTime = nextRunTime; + RecentJob = recentJob; + EndTime = endTime; + } + + /// This property is meaningful only if the schedule is in the active state when the time comes around. For example, if the schedule is disabled, no Job will be created at nextRunTime unless the Job is enabled before then. + public DateTimeOffset? NextRunTime { get; } + /// This property is present only if the at least one Job has run under the schedule. + public RecentJob RecentJob { get; } + /// This property is set only if the Job Schedule is in the completed state. + public DateTimeOffset? EndTime { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleExistsOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleExistsOptions.cs new file mode 100644 index 000000000000..0e9bb9437bfb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleExistsOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobScheduleExistsOptions + { + /// Initializes a new instance of JobScheduleExistsOptions. + public JobScheduleExistsOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleGetOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleGetOptions.cs new file mode 100644 index 000000000000..2057ff8fa9a3 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleGetOptions.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobScheduleGetOptions + { + /// Initializes a new instance of JobScheduleGetOptions. + public JobScheduleGetOptions() + { + } + + /// An OData $select clause. + public string Select { get; set; } + /// An OData $expand clause. + public string Expand { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleListOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleListOptions.cs new file mode 100644 index 000000000000..4ebf2e7329b4 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleListOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobScheduleListOptions + { + /// Initializes a new instance of JobScheduleListOptions. + public JobScheduleListOptions() + { + } + + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. + public string Filter { get; set; } + /// An OData $select clause. + public string Select { get; set; } + /// An OData $expand clause. + public string Expand { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 Job Schedules can be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulePatchOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulePatchOptions.cs new file mode 100644 index 000000000000..e2bac7c3b0da --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulePatchOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobSchedulePatchOptions + { + /// Initializes a new instance of JobSchedulePatchOptions. + public JobSchedulePatchOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulePatchParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulePatchParameter.Serialization.cs new file mode 100644 index 000000000000..9946fb8de1b5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulePatchParameter.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobSchedulePatchParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Schedule)) + { + writer.WritePropertyName("schedule"u8); + writer.WriteObjectValue(Schedule); + } + if (Optional.IsDefined(JobSpecification)) + { + writer.WritePropertyName("jobSpecification"u8); + writer.WriteObjectValue(JobSpecification); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulePatchParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulePatchParameter.cs new file mode 100644 index 000000000000..33bc77a2e46d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulePatchParameter.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The set of changes to be made to a Job Schedule. + public partial class JobSchedulePatchParameter + { + /// Initializes a new instance of JobSchedulePatchParameter. + public JobSchedulePatchParameter() + { + Metadata = new ChangeTrackingList(); + } + + /// All times are fixed respective to UTC and are not impacted by daylight saving time. If you do not specify this element, the existing schedule is left unchanged. + public Schedule Schedule { get; set; } + /// Updates affect only Jobs that are started after the update has taken place. Any currently active Job continues with the older specification. + public JobSpecification JobSpecification { get; set; } + /// If you do not specify this element, existing metadata is left unchanged. + public IList Metadata { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleState.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleState.Serialization.cs new file mode 100644 index 000000000000..1ff6533e41c2 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleState.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class JobScheduleStateExtensions + { + public static string ToSerialString(this JobScheduleState value) => value switch + { + JobScheduleState.Active => "active", + JobScheduleState.Completed => "completed", + JobScheduleState.Disabled => "disabled", + JobScheduleState.Terminating => "terminating", + JobScheduleState.Deleting => "deleting", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown JobScheduleState value.") + }; + + public static JobScheduleState ToJobScheduleState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "active")) return JobScheduleState.Active; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "completed")) return JobScheduleState.Completed; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "disabled")) return JobScheduleState.Disabled; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "terminating")) return JobScheduleState.Terminating; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "deleting")) return JobScheduleState.Deleting; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown JobScheduleState value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleState.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleState.cs new file mode 100644 index 000000000000..5406dad6d994 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleState.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The state of the Job Schedule. + public enum JobScheduleState + { + /// The Job Schedule is active and will create Jobs as per its schedule. + Active, + /// The Job Schedule has terminated, either by reaching its end time or by the user terminating it explicitly. + Completed, + /// The user has disabled the Job Schedule. The scheduler will not initiate any new Jobs will on this schedule, but any existing active Job will continue to run. + Disabled, + /// The Job Schedule has no more work to do, or has been explicitly terminated by the user, but the termination operation is still in progress. The scheduler will not initiate any new Jobs for this Job Schedule, nor is any existing Job active. + Terminating, + /// The user has requested that the Job Schedule be deleted, but the delete operation is still in progress. The scheduler will not initiate any new Jobs for this Job Schedule, and will delete any existing Jobs and Tasks under the Job Schedule, including any active Job. The Job Schedule will be deleted when all Jobs and Tasks under the Job Schedule have been deleted. + Deleting + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleStatistics.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleStatistics.Serialization.cs new file mode 100644 index 000000000000..9b99b4e8dcd0 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleStatistics.Serialization.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobScheduleStatistics + { + internal static JobScheduleStatistics DeserializeJobScheduleStatistics(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + DateTimeOffset startTime = default; + DateTimeOffset lastUpdateTime = default; + TimeSpan userCPUTime = default; + TimeSpan kernelCPUTime = default; + TimeSpan wallClockTime = default; + long readIOps = default; + long writeIOps = default; + double readIOGiB = default; + double writeIOGiB = default; + long numSucceededTasks = default; + long numFailedTasks = default; + long numTaskRetries = default; + TimeSpan waitTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdateTime"u8)) + { + lastUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("userCPUTime"u8)) + { + userCPUTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("kernelCPUTime"u8)) + { + kernelCPUTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("wallClockTime"u8)) + { + wallClockTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("readIOps"u8)) + { + readIOps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("writeIOps"u8)) + { + writeIOps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("readIOGiB"u8)) + { + readIOGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("writeIOGiB"u8)) + { + writeIOGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numSucceededTasks"u8)) + { + numSucceededTasks = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("numFailedTasks"u8)) + { + numFailedTasks = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("numTaskRetries"u8)) + { + numTaskRetries = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("waitTime"u8)) + { + waitTime = property.Value.GetTimeSpan("P"); + continue; + } + } + return new JobScheduleStatistics(url, startTime, lastUpdateTime, userCPUTime, kernelCPUTime, wallClockTime, readIOps, writeIOps, readIOGiB, writeIOGiB, numSucceededTasks, numFailedTasks, numTaskRetries, waitTime); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleStatistics.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleStatistics.cs new file mode 100644 index 000000000000..4c1d7a968f2b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleStatistics.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Resource usage statistics for a Job Schedule. + public partial class JobScheduleStatistics + { + /// Initializes a new instance of JobScheduleStatistics. + /// The URL of the statistics. + /// The start time of the time range covered by the statistics. + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + /// The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in all Jobs created under the schedule. + /// The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in all Jobs created under the schedule. + /// The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If a Task was retried, this includes the wall clock time of all the Task retries. + /// The total number of disk read operations made by all Tasks in all Jobs created under the schedule. + /// The total number of disk write operations made by all Tasks in all Jobs created under the schedule. + /// The total gibibytes read from disk by all Tasks in all Jobs created under the schedule. + /// The total gibibytes written to disk by all Tasks in all Jobs created under the schedule. + /// The total number of Tasks successfully completed during the given time range in Jobs created under the schedule. A Task completes successfully if it returns exit code 0. + /// The total number of Tasks that failed during the given time range in Jobs created under the schedule. A Task fails if it exhausts its maximum retry count without returning exit code 0. + /// The total number of retries during the given time range on all Tasks in all Jobs created under the schedule. + /// This value is only reported in the Account lifetime statistics; it is not included in the Job statistics. + /// is null. + internal JobScheduleStatistics(string url, DateTimeOffset startTime, DateTimeOffset lastUpdateTime, TimeSpan userCPUTime, TimeSpan kernelCPUTime, TimeSpan wallClockTime, long readIOps, long writeIOps, double readIOGiB, double writeIOGiB, long numSucceededTasks, long numFailedTasks, long numTaskRetries, TimeSpan waitTime) + { + Argument.AssertNotNull(url, nameof(url)); + + Url = url; + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + UserCPUTime = userCPUTime; + KernelCPUTime = kernelCPUTime; + WallClockTime = wallClockTime; + ReadIOps = readIOps; + WriteIOps = writeIOps; + ReadIOGiB = readIOGiB; + WriteIOGiB = writeIOGiB; + NumSucceededTasks = numSucceededTasks; + NumFailedTasks = numFailedTasks; + NumTaskRetries = numTaskRetries; + WaitTime = waitTime; + } + + /// The URL of the statistics. + public string Url { get; } + /// The start time of the time range covered by the statistics. + public DateTimeOffset StartTime { get; } + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + public DateTimeOffset LastUpdateTime { get; } + /// The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in all Jobs created under the schedule. + public TimeSpan UserCPUTime { get; } + /// The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in all Jobs created under the schedule. + public TimeSpan KernelCPUTime { get; } + /// The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If a Task was retried, this includes the wall clock time of all the Task retries. + public TimeSpan WallClockTime { get; } + /// The total number of disk read operations made by all Tasks in all Jobs created under the schedule. + public long ReadIOps { get; } + /// The total number of disk write operations made by all Tasks in all Jobs created under the schedule. + public long WriteIOps { get; } + /// The total gibibytes read from disk by all Tasks in all Jobs created under the schedule. + public double ReadIOGiB { get; } + /// The total gibibytes written to disk by all Tasks in all Jobs created under the schedule. + public double WriteIOGiB { get; } + /// The total number of Tasks successfully completed during the given time range in Jobs created under the schedule. A Task completes successfully if it returns exit code 0. + public long NumSucceededTasks { get; } + /// The total number of Tasks that failed during the given time range in Jobs created under the schedule. A Task fails if it exhausts its maximum retry count without returning exit code 0. + public long NumFailedTasks { get; } + /// The total number of retries during the given time range on all Tasks in all Jobs created under the schedule. + public long NumTaskRetries { get; } + /// This value is only reported in the Account lifetime statistics; it is not included in the Job statistics. + public TimeSpan WaitTime { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleTerminateOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleTerminateOptions.cs new file mode 100644 index 000000000000..d31008fee3a5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleTerminateOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobScheduleTerminateOptions + { + /// Initializes a new instance of JobScheduleTerminateOptions. + public JobScheduleTerminateOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleUpdateOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleUpdateOptions.cs new file mode 100644 index 000000000000..7f471466afb7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleUpdateOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobScheduleUpdateOptions + { + /// Initializes a new instance of JobScheduleUpdateOptions. + public JobScheduleUpdateOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleUpdateParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleUpdateParameter.Serialization.cs new file mode 100644 index 000000000000..b1d4ba68b5bf --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleUpdateParameter.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobScheduleUpdateParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("schedule"u8); + writer.WriteObjectValue(Schedule); + writer.WritePropertyName("jobSpecification"u8); + writer.WriteObjectValue(JobSpecification); + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleUpdateParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleUpdateParameter.cs new file mode 100644 index 000000000000..cce58db52427 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobScheduleUpdateParameter.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The set of changes to be made to a Job Schedule. + public partial class JobScheduleUpdateParameter + { + /// Initializes a new instance of JobScheduleUpdateParameter. + /// All times are fixed respective to UTC and are not impacted by daylight saving time. If you do not specify this element, it is equivalent to passing the default schedule: that is, a single Job scheduled to run immediately. + /// Updates affect only Jobs that are started after the update has taken place. Any currently active Job continues with the older specification. + /// or is null. + public JobScheduleUpdateParameter(Schedule schedule, JobSpecification jobSpecification) + { + Argument.AssertNotNull(schedule, nameof(schedule)); + Argument.AssertNotNull(jobSpecification, nameof(jobSpecification)); + + Schedule = schedule; + JobSpecification = jobSpecification; + Metadata = new ChangeTrackingList(); + } + + /// All times are fixed respective to UTC and are not impacted by daylight saving time. If you do not specify this element, it is equivalent to passing the default schedule: that is, a single Job scheduled to run immediately. + public Schedule Schedule { get; } + /// Updates affect only Jobs that are started after the update has taken place. Any currently active Job continues with the older specification. + public JobSpecification JobSpecification { get; } + /// If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted. + public IList Metadata { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulingError.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulingError.Serialization.cs new file mode 100644 index 000000000000..53f129a448c1 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulingError.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobSchedulingError + { + internal static JobSchedulingError DeserializeJobSchedulingError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ErrorCategory category = default; + Optional code = default; + Optional message = default; + Optional> details = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString().ToErrorCategory(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePair.DeserializeNameValuePair(item)); + } + details = array; + continue; + } + } + return new JobSchedulingError(category, code.Value, message.Value, Optional.ToList(details)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulingError.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulingError.cs new file mode 100644 index 000000000000..c5fc4f8f490b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSchedulingError.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// An error encountered by the Batch service when scheduling a Job. + public partial class JobSchedulingError + { + /// Initializes a new instance of JobSchedulingError. + /// The category of the error. + internal JobSchedulingError(ErrorCategory category) + { + Category = category; + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of JobSchedulingError. + /// The category of the error. + /// An identifier for the Job scheduling error. Codes are invariant and are intended to be consumed programmatically. + /// A message describing the Job scheduling error, intended to be suitable for display in a user interface. + /// A list of additional error details related to the scheduling error. + internal JobSchedulingError(ErrorCategory category, string code, string message, IReadOnlyList details) + { + Category = category; + Code = code; + Message = message; + Details = details; + } + + /// The category of the error. + public ErrorCategory Category { get; } + /// An identifier for the Job scheduling error. Codes are invariant and are intended to be consumed programmatically. + public string Code { get; } + /// A message describing the Job scheduling error, intended to be suitable for display in a user interface. + public string Message { get; } + /// A list of additional error details related to the scheduling error. + public IReadOnlyList Details { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSpecification.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSpecification.Serialization.cs new file mode 100644 index 000000000000..05ea1a0fc022 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSpecification.Serialization.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobSpecification : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Priority)) + { + writer.WritePropertyName("priority"u8); + writer.WriteNumberValue(Priority.Value); + } + if (Optional.IsDefined(AllowTaskPreemption)) + { + writer.WritePropertyName("allowTaskPreemption"u8); + writer.WriteBooleanValue(AllowTaskPreemption.Value); + } + if (Optional.IsDefined(MaxParallelTasks)) + { + writer.WritePropertyName("maxParallelTasks"u8); + writer.WriteNumberValue(MaxParallelTasks.Value); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(UsesTaskDependencies)) + { + writer.WritePropertyName("usesTaskDependencies"u8); + writer.WriteBooleanValue(UsesTaskDependencies.Value); + } + if (Optional.IsDefined(OnAllTasksComplete)) + { + writer.WritePropertyName("onAllTasksComplete"u8); + writer.WriteStringValue(OnAllTasksComplete.Value.ToSerialString()); + } + if (Optional.IsDefined(OnTaskFailure)) + { + writer.WritePropertyName("onTaskFailure"u8); + writer.WriteStringValue(OnTaskFailure.Value.ToSerialString()); + } + if (Optional.IsDefined(NetworkConfiguration)) + { + writer.WritePropertyName("networkConfiguration"u8); + writer.WriteObjectValue(NetworkConfiguration); + } + if (Optional.IsDefined(Constraints)) + { + writer.WritePropertyName("constraints"u8); + writer.WriteObjectValue(Constraints); + } + if (Optional.IsDefined(JobManagerTask)) + { + writer.WritePropertyName("jobManagerTask"u8); + writer.WriteObjectValue(JobManagerTask); + } + if (Optional.IsDefined(JobPreparationTask)) + { + writer.WritePropertyName("jobPreparationTask"u8); + writer.WriteObjectValue(JobPreparationTask); + } + if (Optional.IsDefined(JobReleaseTask)) + { + writer.WritePropertyName("jobReleaseTask"u8); + writer.WriteObjectValue(JobReleaseTask); + } + if (Optional.IsCollectionDefined(CommonEnvironmentSettings)) + { + writer.WritePropertyName("commonEnvironmentSettings"u8); + writer.WriteStartArray(); + foreach (var item in CommonEnvironmentSettings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("poolInfo"u8); + writer.WriteObjectValue(PoolInfo); + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static JobSpecification DeserializeJobSpecification(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional priority = default; + Optional allowTaskPreemption = default; + Optional maxParallelTasks = default; + Optional displayName = default; + Optional usesTaskDependencies = default; + Optional onAllTasksComplete = default; + Optional onTaskFailure = default; + Optional networkConfiguration = default; + Optional constraints = default; + Optional jobManagerTask = default; + Optional jobPreparationTask = default; + Optional jobReleaseTask = default; + Optional> commonEnvironmentSettings = default; + PoolInformation poolInfo = default; + Optional> metadata = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("priority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("allowTaskPreemption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowTaskPreemption = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("maxParallelTasks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxParallelTasks = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("usesTaskDependencies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usesTaskDependencies = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("onAllTasksComplete"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + onAllTasksComplete = property.Value.GetString().ToOnAllTasksComplete(); + continue; + } + if (property.NameEquals("onTaskFailure"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + onTaskFailure = property.Value.GetString().ToOnTaskFailure(); + continue; + } + if (property.NameEquals("networkConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkConfiguration = JobNetworkConfiguration.DeserializeJobNetworkConfiguration(property.Value); + continue; + } + if (property.NameEquals("constraints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + constraints = JobConstraints.DeserializeJobConstraints(property.Value); + continue; + } + if (property.NameEquals("jobManagerTask"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobManagerTask = JobManagerTask.DeserializeJobManagerTask(property.Value); + continue; + } + if (property.NameEquals("jobPreparationTask"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobPreparationTask = JobPreparationTask.DeserializeJobPreparationTask(property.Value); + continue; + } + if (property.NameEquals("jobReleaseTask"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobReleaseTask = JobReleaseTask.DeserializeJobReleaseTask(property.Value); + continue; + } + if (property.NameEquals("commonEnvironmentSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EnvironmentSetting.DeserializeEnvironmentSetting(item)); + } + commonEnvironmentSettings = array; + continue; + } + if (property.NameEquals("poolInfo"u8)) + { + poolInfo = PoolInformation.DeserializePoolInformation(property.Value); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MetadataItem.DeserializeMetadataItem(item)); + } + metadata = array; + continue; + } + } + return new JobSpecification(Optional.ToNullable(priority), Optional.ToNullable(allowTaskPreemption), Optional.ToNullable(maxParallelTasks), displayName.Value, Optional.ToNullable(usesTaskDependencies), Optional.ToNullable(onAllTasksComplete), Optional.ToNullable(onTaskFailure), networkConfiguration.Value, constraints.Value, jobManagerTask.Value, jobPreparationTask.Value, jobReleaseTask.Value, Optional.ToList(commonEnvironmentSettings), poolInfo, Optional.ToList(metadata)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSpecification.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSpecification.cs new file mode 100644 index 000000000000..c8b01f5e7135 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobSpecification.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Specifies details of the Jobs to be created on a schedule. + public partial class JobSpecification + { + /// Initializes a new instance of JobSpecification. + /// Specifies how a Job should be assigned to a Pool. + /// is null. + public JobSpecification(PoolInformation poolInfo) + { + Argument.AssertNotNull(poolInfo, nameof(poolInfo)); + + CommonEnvironmentSettings = new ChangeTrackingList(); + PoolInfo = poolInfo; + Metadata = new ChangeTrackingList(); + } + + /// Initializes a new instance of JobSpecification. + /// Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. This priority is used as the default for all Jobs under the Job Schedule. You can update a Job's priority after it has been created using by using the update Job API. + /// If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. + /// 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. + /// The name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + /// Whether Tasks in the Job can define dependencies on each other. The default is false. + /// Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. + /// The default is noaction. + /// The network configuration for the Job. + /// The execution constraints for a Job. + /// If the Job does not specify a Job Manager Task, the user must explicitly add Tasks to the Job using the Task API. If the Job does specify a Job Manager Task, the Batch service creates the Job Manager Task when the Job is created, and will try to schedule the Job Manager Task before scheduling other Tasks in the Job. + /// If a Job has a Job Preparation Task, the Batch service will run the Job Preparation Task on a Node before starting any Tasks of that Job on that Compute Node. + /// The primary purpose of the Job Release Task is to undo changes to Nodes made by the Job Preparation Task. Example activities include deleting local files, or shutting down services that were started as part of Job preparation. A Job Release Task cannot be specified without also specifying a Job Preparation Task for the Job. The Batch service runs the Job Release Task on the Compute Nodes that have run the Job Preparation Task. + /// Individual Tasks can override an environment setting specified here by specifying the same setting name with a different value. + /// Specifies how a Job should be assigned to a Pool. + /// The Batch service does not assign any meaning to metadata; it is solely for the use of user code. + internal JobSpecification(int? priority, bool? allowTaskPreemption, int? maxParallelTasks, string displayName, bool? usesTaskDependencies, OnAllTasksComplete? onAllTasksComplete, OnTaskFailure? onTaskFailure, JobNetworkConfiguration networkConfiguration, JobConstraints constraints, JobManagerTask jobManagerTask, JobPreparationTask jobPreparationTask, JobReleaseTask jobReleaseTask, IList commonEnvironmentSettings, PoolInformation poolInfo, IList metadata) + { + Priority = priority; + AllowTaskPreemption = allowTaskPreemption; + MaxParallelTasks = maxParallelTasks; + DisplayName = displayName; + UsesTaskDependencies = usesTaskDependencies; + OnAllTasksComplete = onAllTasksComplete; + OnTaskFailure = onTaskFailure; + NetworkConfiguration = networkConfiguration; + Constraints = constraints; + JobManagerTask = jobManagerTask; + JobPreparationTask = jobPreparationTask; + JobReleaseTask = jobReleaseTask; + CommonEnvironmentSettings = commonEnvironmentSettings; + PoolInfo = poolInfo; + Metadata = metadata; + } + + /// Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. This priority is used as the default for all Jobs under the Job Schedule. You can update a Job's priority after it has been created using by using the update Job API. + public int? Priority { get; set; } + /// If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. + public bool? AllowTaskPreemption { get; set; } + /// 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; set; } + /// The name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + public string DisplayName { get; set; } + /// Whether Tasks in the Job can define dependencies on each other. The default is false. + public bool? UsesTaskDependencies { get; set; } + /// Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. + public OnAllTasksComplete? OnAllTasksComplete { get; set; } + /// The default is noaction. + public OnTaskFailure? OnTaskFailure { get; set; } + /// The network configuration for the Job. + public JobNetworkConfiguration NetworkConfiguration { get; set; } + /// The execution constraints for a Job. + public JobConstraints Constraints { get; set; } + /// If the Job does not specify a Job Manager Task, the user must explicitly add Tasks to the Job using the Task API. If the Job does specify a Job Manager Task, the Batch service creates the Job Manager Task when the Job is created, and will try to schedule the Job Manager Task before scheduling other Tasks in the Job. + public JobManagerTask JobManagerTask { get; set; } + /// If a Job has a Job Preparation Task, the Batch service will run the Job Preparation Task on a Node before starting any Tasks of that Job on that Compute Node. + public JobPreparationTask JobPreparationTask { get; set; } + /// The primary purpose of the Job Release Task is to undo changes to Nodes made by the Job Preparation Task. Example activities include deleting local files, or shutting down services that were started as part of Job preparation. A Job Release Task cannot be specified without also specifying a Job Preparation Task for the Job. The Batch service runs the Job Release Task on the Compute Nodes that have run the Job Preparation Task. + public JobReleaseTask JobReleaseTask { get; set; } + /// Individual Tasks can override an environment setting specified here by specifying the same setting name with a different value. + public IList CommonEnvironmentSettings { get; } + /// Specifies how a Job should be assigned to a Pool. + public PoolInformation PoolInfo { get; set; } + /// The Batch service does not assign any meaning to metadata; it is solely for the use of user code. + public IList Metadata { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobState.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobState.Serialization.cs new file mode 100644 index 000000000000..c9a8ca7cd5bb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobState.Serialization.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class JobStateExtensions + { + public static string ToSerialString(this JobState value) => value switch + { + JobState.Active => "active", + JobState.Disabling => "disabling", + JobState.Disabled => "disabled", + JobState.Enabling => "enabling", + JobState.Terminating => "terminating", + JobState.Completed => "completed", + JobState.Deleting => "deleting", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown JobState value.") + }; + + public static JobState ToJobState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "active")) return JobState.Active; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "disabling")) return JobState.Disabling; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "disabled")) return JobState.Disabled; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "enabling")) return JobState.Enabling; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "terminating")) return JobState.Terminating; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "completed")) return JobState.Completed; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "deleting")) return JobState.Deleting; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown JobState value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobState.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobState.cs new file mode 100644 index 000000000000..b35ea36f3d54 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobState.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The state of the Job. + public enum JobState + { + /// The Job is available to have Tasks scheduled. + Active, + /// A user has requested that the Job be disabled, but the disable operation is still in progress (for example, waiting for Tasks to terminate). + Disabling, + /// A user has disabled the Job. No Tasks are running, and no new Tasks will be scheduled. + Disabled, + /// A user has requested that the Job be enabled, but the enable operation is still in progress. + Enabling, + /// The Job is about to complete, either because a Job Manager Task has completed or because the user has terminated the Job, but the terminate operation is still in progress (for example, because Job Release Tasks are running). + Terminating, + /// All Tasks have terminated, and the system will not accept any more Tasks or any further changes to the Job. + Completed, + /// A user has requested that the Job be deleted, but the delete operation is still in progress (for example, because the system is still terminating running Tasks). + Deleting + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobStatistics.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobStatistics.Serialization.cs new file mode 100644 index 000000000000..e02e8f3183dd --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobStatistics.Serialization.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobStatistics + { + internal static JobStatistics DeserializeJobStatistics(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + DateTimeOffset startTime = default; + DateTimeOffset lastUpdateTime = default; + TimeSpan userCPUTime = default; + TimeSpan kernelCPUTime = default; + TimeSpan wallClockTime = default; + long readIOps = default; + long writeIOps = default; + double readIOGiB = default; + double writeIOGiB = default; + long numSucceededTasks = default; + long numFailedTasks = default; + long numTaskRetries = default; + TimeSpan waitTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdateTime"u8)) + { + lastUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("userCPUTime"u8)) + { + userCPUTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("kernelCPUTime"u8)) + { + kernelCPUTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("wallClockTime"u8)) + { + wallClockTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("readIOps"u8)) + { + readIOps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("writeIOps"u8)) + { + writeIOps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("readIOGiB"u8)) + { + readIOGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("writeIOGiB"u8)) + { + writeIOGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numSucceededTasks"u8)) + { + numSucceededTasks = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("numFailedTasks"u8)) + { + numFailedTasks = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("numTaskRetries"u8)) + { + numTaskRetries = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("waitTime"u8)) + { + waitTime = property.Value.GetTimeSpan("P"); + continue; + } + } + return new JobStatistics(url, startTime, lastUpdateTime, userCPUTime, kernelCPUTime, wallClockTime, readIOps, writeIOps, readIOGiB, writeIOGiB, numSucceededTasks, numFailedTasks, numTaskRetries, waitTime); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobStatistics.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobStatistics.cs new file mode 100644 index 000000000000..b63e8db9d9a0 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobStatistics.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Resource usage statistics for a Job. + public partial class JobStatistics + { + /// Initializes a new instance of JobStatistics. + /// The URL of the statistics. + /// The start time of the time range covered by the statistics. + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + /// The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in the Job. + /// The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in the Job. + /// The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If a Task was retried, this includes the wall clock time of all the Task retries. + /// The total number of disk read operations made by all Tasks in the Job. + /// The total number of disk write operations made by all Tasks in the Job. + /// The total amount of data in GiB read from disk by all Tasks in the Job. + /// The total amount of data in GiB written to disk by all Tasks in the Job. + /// A Task completes successfully if it returns exit code 0. + /// A Task fails if it exhausts its maximum retry count without returning exit code 0. + /// The total number of retries on all the Tasks in the Job during the given time range. + /// The wait time for a Task is defined as the elapsed time between the creation of the Task and the start of Task execution. (If the Task is retried due to failures, the wait time is the time to the most recent Task execution.) This value is only reported in the Account lifetime statistics; it is not included in the Job statistics. + /// is null. + internal JobStatistics(string url, DateTimeOffset startTime, DateTimeOffset lastUpdateTime, TimeSpan userCPUTime, TimeSpan kernelCPUTime, TimeSpan wallClockTime, long readIOps, long writeIOps, double readIOGiB, double writeIOGiB, long numSucceededTasks, long numFailedTasks, long numTaskRetries, TimeSpan waitTime) + { + Argument.AssertNotNull(url, nameof(url)); + + Url = url; + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + UserCPUTime = userCPUTime; + KernelCPUTime = kernelCPUTime; + WallClockTime = wallClockTime; + ReadIOps = readIOps; + WriteIOps = writeIOps; + ReadIOGiB = readIOGiB; + WriteIOGiB = writeIOGiB; + NumSucceededTasks = numSucceededTasks; + NumFailedTasks = numFailedTasks; + NumTaskRetries = numTaskRetries; + WaitTime = waitTime; + } + + /// The URL of the statistics. + public string Url { get; } + /// The start time of the time range covered by the statistics. + public DateTimeOffset StartTime { get; } + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + public DateTimeOffset LastUpdateTime { get; } + /// The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in the Job. + public TimeSpan UserCPUTime { get; } + /// The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in the Job. + public TimeSpan KernelCPUTime { get; } + /// The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If a Task was retried, this includes the wall clock time of all the Task retries. + public TimeSpan WallClockTime { get; } + /// The total number of disk read operations made by all Tasks in the Job. + public long ReadIOps { get; } + /// The total number of disk write operations made by all Tasks in the Job. + public long WriteIOps { get; } + /// The total amount of data in GiB read from disk by all Tasks in the Job. + public double ReadIOGiB { get; } + /// The total amount of data in GiB written to disk by all Tasks in the Job. + public double WriteIOGiB { get; } + /// A Task completes successfully if it returns exit code 0. + public long NumSucceededTasks { get; } + /// A Task fails if it exhausts its maximum retry count without returning exit code 0. + public long NumFailedTasks { get; } + /// The total number of retries on all the Tasks in the Job during the given time range. + public long NumTaskRetries { get; } + /// The wait time for a Task is defined as the elapsed time between the creation of the Task and the start of Task execution. (If the Task is retried due to failures, the wait time is the time to the most recent Task execution.) This value is only reported in the Account lifetime statistics; it is not included in the Job statistics. + public TimeSpan WaitTime { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobTerminateOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobTerminateOptions.cs new file mode 100644 index 000000000000..e327e74a8c6e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobTerminateOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobTerminateOptions + { + /// Initializes a new instance of JobTerminateOptions. + public JobTerminateOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobTerminateParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobTerminateParameter.Serialization.cs new file mode 100644 index 000000000000..6251b586860d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobTerminateParameter.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobTerminateParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(TerminateReason)) + { + writer.WritePropertyName("terminateReason"u8); + writer.WriteStringValue(TerminateReason); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobTerminateParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobTerminateParameter.cs new file mode 100644 index 000000000000..1b0114abcfdb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobTerminateParameter.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Options when terminating a Job. + public partial class JobTerminateParameter + { + /// Initializes a new instance of JobTerminateParameter. + public JobTerminateParameter() + { + } + + /// The text you want to appear as the Job's TerminateReason. The default is 'UserTerminate'. + public string TerminateReason { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobUpdateOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobUpdateOptions.cs new file mode 100644 index 000000000000..b35d76a3cbba --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobUpdateOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class JobUpdateOptions + { + /// Initializes a new instance of JobUpdateOptions. + public JobUpdateOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobUpdateParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobUpdateParameter.Serialization.cs new file mode 100644 index 000000000000..9056d7a04a33 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobUpdateParameter.Serialization.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class JobUpdateParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Priority)) + { + writer.WritePropertyName("priority"u8); + writer.WriteNumberValue(Priority.Value); + } + if (Optional.IsDefined(MaxParallelTasks)) + { + writer.WritePropertyName("maxParallelTasks"u8); + writer.WriteNumberValue(MaxParallelTasks.Value); + } + if (Optional.IsDefined(AllowTaskPreemption)) + { + writer.WritePropertyName("allowTaskPreemption"u8); + writer.WriteBooleanValue(AllowTaskPreemption.Value); + } + if (Optional.IsDefined(Constraints)) + { + writer.WritePropertyName("constraints"u8); + writer.WriteObjectValue(Constraints); + } + writer.WritePropertyName("poolInfo"u8); + writer.WriteObjectValue(PoolInfo); + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(OnAllTasksComplete)) + { + writer.WritePropertyName("onAllTasksComplete"u8); + writer.WriteStringValue(OnAllTasksComplete.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobUpdateParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobUpdateParameter.cs new file mode 100644 index 000000000000..f34a00b0a46f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/JobUpdateParameter.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The set of changes to be made to a Job. + public partial class JobUpdateParameter + { + /// Initializes a new instance of JobUpdateParameter. + /// You may change the Pool for a Job only when the Job is disabled. The Update Job call will fail if you include the poolInfo element and the Job is not disabled. If you specify an autoPoolSpecification in the poolInfo, only the keepAlive property of the autoPoolSpecification can be updated, and then only if the autoPoolSpecification has a poolLifetimeOption of Job (other job properties can be updated as normal). + /// is null. + public JobUpdateParameter(PoolInformation poolInfo) + { + Argument.AssertNotNull(poolInfo, nameof(poolInfo)); + + PoolInfo = poolInfo; + Metadata = new ChangeTrackingList(); + } + + /// Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, it is set to the default value 0. + public int? Priority { get; set; } + /// 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; set; } + /// If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. + public bool? AllowTaskPreemption { get; set; } + /// If omitted, the constraints are cleared. + public JobConstraints Constraints { get; set; } + /// You may change the Pool for a Job only when the Job is disabled. The Update Job call will fail if you include the poolInfo element and the Job is not disabled. If you specify an autoPoolSpecification in the poolInfo, only the keepAlive property of the autoPoolSpecification can be updated, and then only if the autoPoolSpecification has a poolLifetimeOption of Job (other job properties can be updated as normal). + public PoolInformation PoolInfo { get; } + /// If omitted, it takes the default value of an empty list; in effect, any existing metadata is deleted. + public IList Metadata { get; } + /// If omitted, the completion behavior is set to noaction. If the current value is terminatejob, this is an error because a Job's completion behavior may not be changed from terminatejob to noaction. You may not change the value from terminatejob to noaction - that is, once you have engaged automatic Job termination, you cannot turn it off again. If you try to do this, the request fails and Batch returns status code 400 (Bad Request) and an 'invalid property value' error response. If you do not specify this element in a PUT request, it is equivalent to passing noaction. This is an error if the current value is terminatejob. + public OnAllTasksComplete? OnAllTasksComplete { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/LinuxUserConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/LinuxUserConfiguration.Serialization.cs new file mode 100644 index 000000000000..6ef2968f19ad --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/LinuxUserConfiguration.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class LinuxUserConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Uid)) + { + writer.WritePropertyName("uid"u8); + writer.WriteNumberValue(Uid.Value); + } + if (Optional.IsDefined(Gid)) + { + writer.WritePropertyName("gid"u8); + writer.WriteNumberValue(Gid.Value); + } + if (Optional.IsDefined(SshPrivateKey)) + { + writer.WritePropertyName("sshPrivateKey"u8); + writer.WriteStringValue(SshPrivateKey); + } + writer.WriteEndObject(); + } + + internal static LinuxUserConfiguration DeserializeLinuxUserConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional uid = default; + Optional gid = default; + Optional sshPrivateKey = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uid = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("gid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gid = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sshPrivateKey"u8)) + { + sshPrivateKey = property.Value.GetString(); + continue; + } + } + return new LinuxUserConfiguration(Optional.ToNullable(uid), Optional.ToNullable(gid), sshPrivateKey.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/LinuxUserConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/LinuxUserConfiguration.cs new file mode 100644 index 000000000000..8f8ffaeff042 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/LinuxUserConfiguration.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Properties used to create a user Account on a Linux Compute Node. + public partial class LinuxUserConfiguration + { + /// Initializes a new instance of LinuxUserConfiguration. + public LinuxUserConfiguration() + { + } + + /// Initializes a new instance of LinuxUserConfiguration. + /// The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the uid. + /// The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the gid. + /// The private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between Compute Nodes in a Linux Pool when the Pool's enableInterNodeCommunication property is true (it is ignored if enableInterNodeCommunication is false). It does this by placing the key pair into the user's .ssh directory. If not specified, password-less SSH is not configured between Compute Nodes (no modification of the user's .ssh directory is done). + internal LinuxUserConfiguration(int? uid, int? gid, string sshPrivateKey) + { + Uid = uid; + Gid = gid; + SshPrivateKey = sshPrivateKey; + } + + /// The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the uid. + public int? Uid { get; set; } + /// The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the gid. + public int? Gid { get; set; } + /// The private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between Compute Nodes in a Linux Pool when the Pool's enableInterNodeCommunication property is true (it is ignored if enableInterNodeCommunication is false). It does this by placing the key pair into the user's .ssh directory. If not specified, password-less SSH is not configured between Compute Nodes (no modification of the user's .ssh directory is done). + public string SshPrivateKey { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/LoginMode.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/LoginMode.Serialization.cs new file mode 100644 index 000000000000..993a2f2f4eca --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/LoginMode.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class LoginModeExtensions + { + public static string ToSerialString(this LoginMode value) => value switch + { + LoginMode.Batch => "batch", + LoginMode.Interactive => "interactive", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown LoginMode value.") + }; + + public static LoginMode ToLoginMode(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "batch")) return LoginMode.Batch; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "interactive")) return LoginMode.Interactive; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown LoginMode value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/LoginMode.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/LoginMode.cs new file mode 100644 index 000000000000..07dd648f312d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/LoginMode.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The default value for VirtualMachineConfiguration Pools is 'batch' and for CloudServiceConfiguration Pools is 'interactive'. + public enum LoginMode + { + /// The LOGON32_LOGON_BATCH Win32 login mode. The batch login mode is recommended for long running parallel processes. + Batch, + /// The LOGON32_LOGON_INTERACTIVE Win32 login mode. UAC is enabled on Windows VirtualMachineConfiguration Pools. If this option is used with an elevated user identity in a Windows VirtualMachineConfiguration Pool, the user session will not be elevated unless the application executed by the Task command line is configured to always require administrative privilege or to always require maximum privilege. + Interactive + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MetadataItem.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MetadataItem.Serialization.cs new file mode 100644 index 000000000000..50a83764b44e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MetadataItem.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class MetadataItem : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + writer.WriteEndObject(); + } + + internal static MetadataItem DeserializeMetadataItem(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + } + return new MetadataItem(name, value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MetadataItem.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MetadataItem.cs new file mode 100644 index 000000000000..765d0db36bed --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MetadataItem.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The Batch service does not assign any meaning to this metadata; it is solely for the use of user code. + public partial class MetadataItem + { + /// Initializes a new instance of MetadataItem. + /// The name of the metadata item. + /// The value of the metadata item. + /// or is null. + public MetadataItem(string name, string value) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(value, nameof(value)); + + Name = name; + Value = value; + } + + /// The name of the metadata item. + public string Name { get; set; } + /// The value of the metadata item. + public string Value { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MountConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MountConfiguration.Serialization.cs new file mode 100644 index 000000000000..79ab5c14a71f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MountConfiguration.Serialization.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class MountConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(AzureBlobFileSystemConfiguration)) + { + writer.WritePropertyName("azureBlobFileSystemConfiguration"u8); + writer.WriteObjectValue(AzureBlobFileSystemConfiguration); + } + if (Optional.IsDefined(NfsMountConfiguration)) + { + writer.WritePropertyName("nfsMountConfiguration"u8); + writer.WriteObjectValue(NfsMountConfiguration); + } + if (Optional.IsDefined(CifsMountConfiguration)) + { + writer.WritePropertyName("cifsMountConfiguration"u8); + writer.WriteObjectValue(CifsMountConfiguration); + } + if (Optional.IsDefined(AzureFileShareConfiguration)) + { + writer.WritePropertyName("azureFileShareConfiguration"u8); + writer.WriteObjectValue(AzureFileShareConfiguration); + } + writer.WriteEndObject(); + } + + internal static MountConfiguration DeserializeMountConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional azureBlobFileSystemConfiguration = default; + Optional nfsMountConfiguration = default; + Optional cifsMountConfiguration = default; + Optional azureFileShareConfiguration = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureBlobFileSystemConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureBlobFileSystemConfiguration = AzureBlobFileSystemConfiguration.DeserializeAzureBlobFileSystemConfiguration(property.Value); + continue; + } + if (property.NameEquals("nfsMountConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nfsMountConfiguration = NFSMountConfiguration.DeserializeNFSMountConfiguration(property.Value); + continue; + } + if (property.NameEquals("cifsMountConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cifsMountConfiguration = CifsMountConfiguration.DeserializeCifsMountConfiguration(property.Value); + continue; + } + if (property.NameEquals("azureFileShareConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureFileShareConfiguration = AzureFileShareConfiguration.DeserializeAzureFileShareConfiguration(property.Value); + continue; + } + } + return new MountConfiguration(azureBlobFileSystemConfiguration.Value, nfsMountConfiguration.Value, cifsMountConfiguration.Value, azureFileShareConfiguration.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MountConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MountConfiguration.cs new file mode 100644 index 000000000000..5b1bbec203f6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MountConfiguration.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The file system to mount on each node. + public partial class MountConfiguration + { + /// Initializes a new instance of MountConfiguration. + public MountConfiguration() + { + } + + /// Initializes a new instance of MountConfiguration. + /// This property is mutually exclusive with all other properties. + /// This property is mutually exclusive with all other properties. + /// This property is mutually exclusive with all other properties. + /// This property is mutually exclusive with all other properties. + internal MountConfiguration(AzureBlobFileSystemConfiguration azureBlobFileSystemConfiguration, NFSMountConfiguration nfsMountConfiguration, CifsMountConfiguration cifsMountConfiguration, AzureFileShareConfiguration azureFileShareConfiguration) + { + AzureBlobFileSystemConfiguration = azureBlobFileSystemConfiguration; + NfsMountConfiguration = nfsMountConfiguration; + CifsMountConfiguration = cifsMountConfiguration; + AzureFileShareConfiguration = azureFileShareConfiguration; + } + + /// This property is mutually exclusive with all other properties. + public AzureBlobFileSystemConfiguration AzureBlobFileSystemConfiguration { get; set; } + /// This property is mutually exclusive with all other properties. + public NFSMountConfiguration NfsMountConfiguration { get; set; } + /// This property is mutually exclusive with all other properties. + public CifsMountConfiguration CifsMountConfiguration { get; set; } + /// This property is mutually exclusive with all other properties. + public AzureFileShareConfiguration AzureFileShareConfiguration { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MultiInstanceSettings.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MultiInstanceSettings.Serialization.cs new file mode 100644 index 000000000000..ff67ad0d8c23 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MultiInstanceSettings.Serialization.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class MultiInstanceSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(NumberOfInstances)) + { + writer.WritePropertyName("numberOfInstances"u8); + writer.WriteNumberValue(NumberOfInstances.Value); + } + writer.WritePropertyName("coordinationCommandLine"u8); + writer.WriteStringValue(CoordinationCommandLine); + if (Optional.IsCollectionDefined(CommonResourceFiles)) + { + writer.WritePropertyName("commonResourceFiles"u8); + writer.WriteStartArray(); + foreach (var item in CommonResourceFiles) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static MultiInstanceSettings DeserializeMultiInstanceSettings(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional numberOfInstances = default; + string coordinationCommandLine = default; + Optional> commonResourceFiles = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numberOfInstances"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfInstances = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("coordinationCommandLine"u8)) + { + coordinationCommandLine = property.Value.GetString(); + continue; + } + if (property.NameEquals("commonResourceFiles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceFile.DeserializeResourceFile(item)); + } + commonResourceFiles = array; + continue; + } + } + return new MultiInstanceSettings(Optional.ToNullable(numberOfInstances), coordinationCommandLine, Optional.ToList(commonResourceFiles)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MultiInstanceSettings.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MultiInstanceSettings.cs new file mode 100644 index 000000000000..3afb13fbb181 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/MultiInstanceSettings.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Multi-instance Tasks are commonly used to support MPI Tasks. In the MPI case, if any of the subtasks fail (for example due to exiting with a non-zero exit code) the entire multi-instance Task fails. The multi-instance Task is then terminated and retried, up to its retry limit. + public partial class MultiInstanceSettings + { + /// Initializes a new instance of MultiInstanceSettings. + /// A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages. + /// is null. + public MultiInstanceSettings(string coordinationCommandLine) + { + Argument.AssertNotNull(coordinationCommandLine, nameof(coordinationCommandLine)); + + CoordinationCommandLine = coordinationCommandLine; + CommonResourceFiles = new ChangeTrackingList(); + } + + /// Initializes a new instance of MultiInstanceSettings. + /// If omitted, the default is 1. + /// A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages. + /// The difference between common resource files and Task resource files is that common resource files are downloaded for all subtasks including the primary, whereas Task resource files are downloaded only for the primary. Also note that these resource files are not downloaded to the Task working directory, but instead are downloaded to the Task root directory (one directory above the working directory). There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. + internal MultiInstanceSettings(int? numberOfInstances, string coordinationCommandLine, IList commonResourceFiles) + { + NumberOfInstances = numberOfInstances; + CoordinationCommandLine = coordinationCommandLine; + CommonResourceFiles = commonResourceFiles; + } + + /// If omitted, the default is 1. + public int? NumberOfInstances { get; set; } + /// A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages. + public string CoordinationCommandLine { get; set; } + /// The difference between common resource files and Task resource files is that common resource files are downloaded for all subtasks including the primary, whereas Task resource files are downloaded only for the primary. Also note that these resource files are not downloaded to the Task working directory, but instead are downloaded to the Task root directory (one directory above the working directory). There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. + public IList CommonResourceFiles { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NFSMountConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NFSMountConfiguration.Serialization.cs new file mode 100644 index 000000000000..b7158efdf8d7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NFSMountConfiguration.Serialization.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NFSMountConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + writer.WritePropertyName("relativeMountPath"u8); + writer.WriteStringValue(RelativeMountPath); + if (Optional.IsDefined(MountOptions)) + { + writer.WritePropertyName("mountOptions"u8); + writer.WriteStringValue(MountOptions); + } + writer.WriteEndObject(); + } + + internal static NFSMountConfiguration DeserializeNFSMountConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string source = default; + string relativeMountPath = default; + Optional mountOptions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("relativeMountPath"u8)) + { + relativeMountPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("mountOptions"u8)) + { + mountOptions = property.Value.GetString(); + continue; + } + } + return new NFSMountConfiguration(source, relativeMountPath, mountOptions.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NFSMountConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NFSMountConfiguration.cs new file mode 100644 index 000000000000..ac168877a577 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NFSMountConfiguration.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Information used to connect to an NFS file system. + public partial class NFSMountConfiguration + { + /// Initializes a new instance of NFSMountConfiguration. + /// The URI of the file system to mount. + /// All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. + /// or is null. + public NFSMountConfiguration(string source, string relativeMountPath) + { + Argument.AssertNotNull(source, nameof(source)); + Argument.AssertNotNull(relativeMountPath, nameof(relativeMountPath)); + + Source = source; + RelativeMountPath = relativeMountPath; + } + + /// Initializes a new instance of NFSMountConfiguration. + /// The URI of the file system to mount. + /// All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. + /// These are 'net use' options in Windows and 'mount' options in Linux. + internal NFSMountConfiguration(string source, string relativeMountPath, string mountOptions) + { + Source = source; + RelativeMountPath = relativeMountPath; + MountOptions = mountOptions; + } + + /// The URI of the file system to mount. + public string Source { get; set; } + /// 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; set; } + /// These are 'net use' options in Windows and 'mount' options in Linux. + public string MountOptions { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NameValuePair.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NameValuePair.Serialization.cs new file mode 100644 index 000000000000..e1af683459e2 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NameValuePair.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NameValuePair + { + internal static NameValuePair DeserializeNameValuePair(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + } + return new NameValuePair(name.Value, value.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NameValuePair.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NameValuePair.cs new file mode 100644 index 000000000000..b9dbdae01ef9 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NameValuePair.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Represents a name-value pair. + public partial class NameValuePair + { + /// Initializes a new instance of NameValuePair. + internal NameValuePair() + { + } + + /// Initializes a new instance of NameValuePair. + /// The name in the name-value pair. + /// The value in the name-value pair. + internal NameValuePair(string name, string value) + { + Name = name; + Value = value; + } + + /// The name in the name-value pair. + public string Name { get; } + /// The value in the name-value pair. + public string Value { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkConfiguration.Serialization.cs new file mode 100644 index 000000000000..a439f8f806ab --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkConfiguration.Serialization.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NetworkConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(SubnetId)) + { + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + } + if (Optional.IsDefined(DynamicVNetAssignmentScope)) + { + writer.WritePropertyName("dynamicVNetAssignmentScope"u8); + writer.WriteStringValue(DynamicVNetAssignmentScope.Value.ToSerialString()); + } + if (Optional.IsDefined(EndpointConfiguration)) + { + writer.WritePropertyName("endpointConfiguration"u8); + writer.WriteObjectValue(EndpointConfiguration); + } + if (Optional.IsDefined(PublicIPAddressConfiguration)) + { + writer.WritePropertyName("publicIPAddressConfiguration"u8); + writer.WriteObjectValue(PublicIPAddressConfiguration); + } + if (Optional.IsDefined(EnableAcceleratedNetworking)) + { + writer.WritePropertyName("enableAcceleratedNetworking"u8); + writer.WriteBooleanValue(EnableAcceleratedNetworking.Value); + } + writer.WriteEndObject(); + } + + internal static NetworkConfiguration DeserializeNetworkConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional subnetId = default; + Optional dynamicVNetAssignmentScope = default; + Optional endpointConfiguration = default; + Optional publicIPAddressConfiguration = default; + Optional enableAcceleratedNetworking = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnetId"u8)) + { + subnetId = property.Value.GetString(); + continue; + } + if (property.NameEquals("dynamicVNetAssignmentScope"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicVNetAssignmentScope = property.Value.GetString().ToDynamicVNetAssignmentScope(); + continue; + } + if (property.NameEquals("endpointConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointConfiguration = PoolEndpointConfiguration.DeserializePoolEndpointConfiguration(property.Value); + continue; + } + if (property.NameEquals("publicIPAddressConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicIPAddressConfiguration = PublicIPAddressConfiguration.DeserializePublicIPAddressConfiguration(property.Value); + continue; + } + if (property.NameEquals("enableAcceleratedNetworking"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAcceleratedNetworking = property.Value.GetBoolean(); + continue; + } + } + return new NetworkConfiguration(subnetId.Value, Optional.ToNullable(dynamicVNetAssignmentScope), endpointConfiguration.Value, publicIPAddressConfiguration.Value, Optional.ToNullable(enableAcceleratedNetworking)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkConfiguration.cs new file mode 100644 index 000000000000..c7d4649c0064 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkConfiguration.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The network configuration for a Pool. + public partial class NetworkConfiguration + { + /// Initializes a new instance of NetworkConfiguration. + public NetworkConfiguration() + { + } + + /// Initializes a new instance of NetworkConfiguration. + /// The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes in the Pool. If the subnet doesn't have enough free IP addresses, the Pool will partially allocate Nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. For Pools created with virtualMachineConfiguration only ARM virtual networks ('Microsoft.Network/virtualNetworks') are supported, but for Pools created with cloudServiceConfiguration both ARM and classic virtual networks are supported. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For Pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. For Pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The scope of dynamic vnet assignment. + /// Pool endpoint configuration is only supported on Pools with the virtualMachineConfiguration property. + /// Public IP configuration property is only supported on Pools with the virtualMachineConfiguration property. + /// Accelerated networking enables single root I/O virtualization (SR-IOV) to a VM, which may lead to improved networking performance. For more details, see: https://learn.microsoft.com/azure/virtual-network/accelerated-networking-overview. + internal NetworkConfiguration(string subnetId, DynamicVNetAssignmentScope? dynamicVNetAssignmentScope, PoolEndpointConfiguration endpointConfiguration, PublicIPAddressConfiguration publicIPAddressConfiguration, bool? enableAcceleratedNetworking) + { + SubnetId = subnetId; + DynamicVNetAssignmentScope = dynamicVNetAssignmentScope; + EndpointConfiguration = endpointConfiguration; + PublicIPAddressConfiguration = publicIPAddressConfiguration; + EnableAcceleratedNetworking = enableAcceleratedNetworking; + } + + /// The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes in the Pool. If the subnet doesn't have enough free IP addresses, the Pool will partially allocate Nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. For Pools created with virtualMachineConfiguration only ARM virtual networks ('Microsoft.Network/virtualNetworks') are supported, but for Pools created with cloudServiceConfiguration both ARM and classic virtual networks are supported. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For Pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. For Pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + public string SubnetId { get; set; } + /// The scope of dynamic vnet assignment. + public DynamicVNetAssignmentScope? DynamicVNetAssignmentScope { get; set; } + /// Pool endpoint configuration is only supported on Pools with the virtualMachineConfiguration property. + public PoolEndpointConfiguration EndpointConfiguration { get; set; } + /// Public IP configuration property is only supported on Pools with the virtualMachineConfiguration property. + public PublicIPAddressConfiguration PublicIPAddressConfiguration { get; set; } + /// Accelerated networking enables single root I/O virtualization (SR-IOV) to a VM, which may lead to improved networking performance. For more details, see: https://learn.microsoft.com/azure/virtual-network/accelerated-networking-overview. + public bool? EnableAcceleratedNetworking { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkSecurityGroupRule.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkSecurityGroupRule.Serialization.cs new file mode 100644 index 000000000000..259df79ab51e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkSecurityGroupRule.Serialization.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NetworkSecurityGroupRule : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("priority"u8); + writer.WriteNumberValue(Priority); + writer.WritePropertyName("access"u8); + writer.WriteStringValue(Access.ToSerialString()); + writer.WritePropertyName("sourceAddressPrefix"u8); + writer.WriteStringValue(SourceAddressPrefix); + if (Optional.IsCollectionDefined(SourcePortRanges)) + { + writer.WritePropertyName("sourcePortRanges"u8); + writer.WriteStartArray(); + foreach (var item in SourcePortRanges) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static NetworkSecurityGroupRule DeserializeNetworkSecurityGroupRule(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int priority = default; + NetworkSecurityGroupRuleAccess access = default; + string sourceAddressPrefix = default; + Optional> sourcePortRanges = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("priority"u8)) + { + priority = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("access"u8)) + { + access = property.Value.GetString().ToNetworkSecurityGroupRuleAccess(); + continue; + } + if (property.NameEquals("sourceAddressPrefix"u8)) + { + sourceAddressPrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourcePortRanges"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sourcePortRanges = array; + continue; + } + } + return new NetworkSecurityGroupRule(priority, access, sourceAddressPrefix, Optional.ToList(sourcePortRanges)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkSecurityGroupRule.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkSecurityGroupRule.cs new file mode 100644 index 000000000000..d918b1ea37eb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkSecurityGroupRule.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A network security group rule to apply to an inbound endpoint. + public partial class NetworkSecurityGroupRule + { + /// Initializes a new instance of NetworkSecurityGroupRule. + /// Priorities within a Pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 4096. If any reserved or duplicate values are provided the request fails with HTTP status code 400. + /// The action that should be taken for a specified IP address, subnet range or tag. + /// Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400. + /// is null. + public NetworkSecurityGroupRule(int priority, NetworkSecurityGroupRuleAccess access, string sourceAddressPrefix) + { + Argument.AssertNotNull(sourceAddressPrefix, nameof(sourceAddressPrefix)); + + Priority = priority; + Access = access; + SourceAddressPrefix = sourceAddressPrefix; + SourcePortRanges = new ChangeTrackingList(); + } + + /// Initializes a new instance of NetworkSecurityGroupRule. + /// Priorities within a Pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 4096. If any reserved or duplicate values are provided the request fails with HTTP status code 400. + /// The action that should be taken for a specified IP address, subnet range or tag. + /// Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400. + /// Valid values are '*' (for all ports 0 - 65535), a specific port (i.e. 22), or a port range (i.e. 100-200). The ports must be in the range of 0 to 65535. Each entry in this collection must not overlap any other entry (either a range or an individual port). If any other values are provided the request fails with HTTP status code 400. The default value is '*'. + internal NetworkSecurityGroupRule(int priority, NetworkSecurityGroupRuleAccess access, string sourceAddressPrefix, IList sourcePortRanges) + { + Priority = priority; + Access = access; + SourceAddressPrefix = sourceAddressPrefix; + SourcePortRanges = sourcePortRanges; + } + + /// Priorities within a Pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 4096. If any reserved or duplicate values are provided the request fails with HTTP status code 400. + public int Priority { get; set; } + /// The action that should be taken for a specified IP address, subnet range or tag. + public NetworkSecurityGroupRuleAccess Access { get; set; } + /// Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400. + public string SourceAddressPrefix { get; set; } + /// Valid values are '*' (for all ports 0 - 65535), a specific port (i.e. 22), or a port range (i.e. 100-200). The ports must be in the range of 0 to 65535. Each entry in this collection must not overlap any other entry (either a range or an individual port). If any other values are provided the request fails with HTTP status code 400. The default value is '*'. + public IList SourcePortRanges { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkSecurityGroupRuleAccess.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkSecurityGroupRuleAccess.Serialization.cs new file mode 100644 index 000000000000..ac3cb25b85e5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkSecurityGroupRuleAccess.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class NetworkSecurityGroupRuleAccessExtensions + { + public static string ToSerialString(this NetworkSecurityGroupRuleAccess value) => value switch + { + NetworkSecurityGroupRuleAccess.Allow => "allow", + NetworkSecurityGroupRuleAccess.Deny => "deny", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NetworkSecurityGroupRuleAccess value.") + }; + + public static NetworkSecurityGroupRuleAccess ToNetworkSecurityGroupRuleAccess(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "allow")) return NetworkSecurityGroupRuleAccess.Allow; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "deny")) return NetworkSecurityGroupRuleAccess.Deny; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NetworkSecurityGroupRuleAccess value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkSecurityGroupRuleAccess.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkSecurityGroupRuleAccess.cs new file mode 100644 index 000000000000..c1a2794533ee --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NetworkSecurityGroupRuleAccess.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The action that should be taken for a specified IP address, subnet range or tag. + public enum NetworkSecurityGroupRuleAccess + { + /// Allow access. + Allow, + /// Deny access. + Deny + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeAgentInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeAgentInformation.Serialization.cs new file mode 100644 index 000000000000..7d0a28a6a16e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeAgentInformation.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NodeAgentInformation + { + internal static NodeAgentInformation DeserializeNodeAgentInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string version = default; + DateTimeOffset lastUpdateTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastUpdateTime"u8)) + { + lastUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new NodeAgentInformation(version, lastUpdateTime); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeAgentInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeAgentInformation.cs new file mode 100644 index 000000000000..a4fe242e93e8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeAgentInformation.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The Batch Compute Node agent is a program that runs on each Compute Node in the Pool and provides Batch capability on the Compute Node. + public partial class NodeAgentInformation + { + /// Initializes a new instance of NodeAgentInformation. + /// This version number can be checked against the Compute Node agent release notes located at https://github.com/Azure/Batch/blob/master/changelogs/nodeagent/CHANGELOG.md. + /// This is the most recent time that the Compute Node agent was updated to a new version. + /// is null. + internal NodeAgentInformation(string version, DateTimeOffset lastUpdateTime) + { + Argument.AssertNotNull(version, nameof(version)); + + Version = version; + LastUpdateTime = lastUpdateTime; + } + + /// This version number can be checked against the Compute Node agent release notes located at https://github.com/Azure/Batch/blob/master/changelogs/nodeagent/CHANGELOG.md. + public string Version { get; } + /// This is the most recent time that the Compute Node agent was updated to a new version. + public DateTimeOffset LastUpdateTime { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeCommunicationMode.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeCommunicationMode.Serialization.cs new file mode 100644 index 000000000000..1e2a1610439e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeCommunicationMode.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class NodeCommunicationModeExtensions + { + public static string ToSerialString(this NodeCommunicationMode value) => value switch + { + NodeCommunicationMode.Default => "default", + NodeCommunicationMode.Classic => "classic", + NodeCommunicationMode.Simplified => "simplified", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NodeCommunicationMode value.") + }; + + public static NodeCommunicationMode ToNodeCommunicationMode(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "default")) return NodeCommunicationMode.Default; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "classic")) return NodeCommunicationMode.Classic; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "simplified")) return NodeCommunicationMode.Simplified; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NodeCommunicationMode value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeCommunicationMode.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeCommunicationMode.cs new file mode 100644 index 000000000000..0f3b58c21432 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeCommunicationMode.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Determines how a pool communicates with the Batch service. + public enum NodeCommunicationMode + { + /// The node communication mode is automatically set by the Batch service. + Default, + /// Nodes using the classic communication mode require inbound TCP communication on ports 29876 and 29877 from the "BatchNodeManagement.{region}" service tag and outbound TCP communication on port 443 to the "Storage.region" and "BatchNodeManagement.{region}" service tags. + Classic, + /// Nodes using the simplified communication mode require outbound TCP communication on port 443 to the "BatchNodeManagement.{region}" service tag. No open inbound ports are required. + Simplified + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeCounts.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeCounts.Serialization.cs new file mode 100644 index 000000000000..842104639472 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeCounts.Serialization.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NodeCounts + { + internal static NodeCounts DeserializeNodeCounts(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int creating = default; + int idle = default; + int offline = default; + int preempted = default; + int rebooting = default; + int reimaging = default; + int running = default; + int starting = default; + int startTaskFailed = default; + int leavingPool = default; + int unknown = default; + int unusable = default; + int waitingForStartTask = default; + int total = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("creating"u8)) + { + creating = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("idle"u8)) + { + idle = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("offline"u8)) + { + offline = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("preempted"u8)) + { + preempted = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("rebooting"u8)) + { + rebooting = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("reimaging"u8)) + { + reimaging = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("running"u8)) + { + running = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("starting"u8)) + { + starting = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("startTaskFailed"u8)) + { + startTaskFailed = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("leavingPool"u8)) + { + leavingPool = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("unknown"u8)) + { + unknown = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("unusable"u8)) + { + unusable = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("waitingForStartTask"u8)) + { + waitingForStartTask = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("total"u8)) + { + total = property.Value.GetInt32(); + continue; + } + } + return new NodeCounts(creating, idle, offline, preempted, rebooting, reimaging, running, starting, startTaskFailed, leavingPool, unknown, unusable, waitingForStartTask, total); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeCounts.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeCounts.cs new file mode 100644 index 000000000000..3f3e5a88a968 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeCounts.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The number of Compute Nodes in each Compute Node state. + public partial class NodeCounts + { + /// Initializes a new instance of NodeCounts. + /// The number of Compute Nodes in the creating state. + /// The number of Compute Nodes in the idle state. + /// The number of Compute Nodes in the offline state. + /// The number of Compute Nodes in the preempted state. + /// The count of Compute Nodes in the rebooting state. + /// The number of Compute Nodes in the reimaging state. + /// The number of Compute Nodes in the running state. + /// The number of Compute Nodes in the starting state. + /// The number of Compute Nodes in the startTaskFailed state. + /// The number of Compute Nodes in the leavingPool state. + /// The number of Compute Nodes in the unknown state. + /// The number of Compute Nodes in the unusable state. + /// The number of Compute Nodes in the waitingForStartTask state. + /// The total number of Compute Nodes. + internal NodeCounts(int creating, int idle, int offline, int preempted, int rebooting, int reimaging, int running, int starting, int startTaskFailed, int leavingPool, int unknown, int unusable, int waitingForStartTask, int total) + { + Creating = creating; + Idle = idle; + Offline = offline; + Preempted = preempted; + Rebooting = rebooting; + Reimaging = reimaging; + Running = running; + Starting = starting; + StartTaskFailed = startTaskFailed; + LeavingPool = leavingPool; + Unknown = unknown; + Unusable = unusable; + WaitingForStartTask = waitingForStartTask; + Total = total; + } + + /// The number of Compute Nodes in the creating state. + public int Creating { get; } + /// The number of Compute Nodes in the idle state. + public int Idle { get; } + /// The number of Compute Nodes in the offline state. + public int Offline { get; } + /// The number of Compute Nodes in the preempted state. + public int Preempted { get; } + /// The count of Compute Nodes in the rebooting state. + public int Rebooting { get; } + /// The number of Compute Nodes in the reimaging state. + public int Reimaging { get; } + /// The number of Compute Nodes in the running state. + public int Running { get; } + /// The number of Compute Nodes in the starting state. + public int Starting { get; } + /// The number of Compute Nodes in the startTaskFailed state. + public int StartTaskFailed { get; } + /// The number of Compute Nodes in the leavingPool state. + public int LeavingPool { get; } + /// The number of Compute Nodes in the unknown state. + public int Unknown { get; } + /// The number of Compute Nodes in the unusable state. + public int Unusable { get; } + /// The number of Compute Nodes in the waitingForStartTask state. + public int WaitingForStartTask { get; } + /// The total number of Compute Nodes. + public int Total { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeDisableSchedulingParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeDisableSchedulingParameter.Serialization.cs new file mode 100644 index 000000000000..8827f6326e13 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeDisableSchedulingParameter.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NodeDisableSchedulingParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(NodeDisableSchedulingOption)) + { + writer.WritePropertyName("nodeDisableSchedulingOption"u8); + writer.WriteStringValue(NodeDisableSchedulingOption.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeDisableSchedulingParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeDisableSchedulingParameter.cs new file mode 100644 index 000000000000..26572a9ddbd6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeDisableSchedulingParameter.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Options for disabling scheduling on a Compute Node. + public partial class NodeDisableSchedulingParameter + { + /// Initializes a new instance of NodeDisableSchedulingParameter. + public NodeDisableSchedulingParameter() + { + } + + /// The default value is requeue. + public DisableComputeNodeSchedulingOption? NodeDisableSchedulingOption { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeFile.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeFile.Serialization.cs new file mode 100644 index 000000000000..c1d1d16730a7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeFile.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NodeFile + { + internal static NodeFile DeserializeNodeFile(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional url = default; + Optional isDirectory = default; + Optional properties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDirectory"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDirectory = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = FileProperties.DeserializeFileProperties(property.Value); + continue; + } + } + return new NodeFile(name.Value, url.Value, Optional.ToNullable(isDirectory), properties.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeFile.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeFile.cs new file mode 100644 index 000000000000..8714e920f290 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeFile.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Information about a file or directory on a Compute Node. + public partial class NodeFile + { + /// Initializes a new instance of NodeFile. + internal NodeFile() + { + } + + /// Initializes a new instance of NodeFile. + /// The file path. + /// The URL of the file. + /// Whether the object represents a directory. + /// The properties of a file on a Compute Node. + internal NodeFile(string name, string url, bool? isDirectory, FileProperties properties) + { + Name = name; + Url = url; + IsDirectory = isDirectory; + Properties = properties; + } + + /// The file path. + public string Name { get; } + /// The URL of the file. + public string Url { get; } + /// Whether the object represents a directory. + public bool? IsDirectory { get; } + /// The properties of a file on a Compute Node. + public FileProperties Properties { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeFileListResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeFileListResult.Serialization.cs new file mode 100644 index 000000000000..e8becabce0da --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeFileListResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class NodeFileListResult + { + internal static NodeFileListResult DeserializeNodeFileListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NodeFile.DeserializeNodeFile(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new NodeFileListResult(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeFileListResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeFileListResult.cs new file mode 100644 index 000000000000..4dab37496e81 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeFileListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the files on a Compute Node, or the files associated with a Task on a Compute Node. + internal partial class NodeFileListResult + { + /// Initializes a new instance of NodeFileListResult. + internal NodeFileListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of NodeFileListResult. + /// The list of files. + /// The URL to get the next set of results. + internal NodeFileListResult(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// The list of files. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodePlacementConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodePlacementConfiguration.Serialization.cs new file mode 100644 index 000000000000..251fa2fe274e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodePlacementConfiguration.Serialization.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NodePlacementConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Policy)) + { + writer.WritePropertyName("policy"u8); + writer.WriteStringValue(Policy.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + internal static NodePlacementConfiguration DeserializeNodePlacementConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional policy = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("policy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + policy = property.Value.GetString().ToNodePlacementPolicyType(); + continue; + } + } + return new NodePlacementConfiguration(Optional.ToNullable(policy)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodePlacementConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodePlacementConfiguration.cs new file mode 100644 index 000000000000..9c967677bf92 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodePlacementConfiguration.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// 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 NodePlacementConfiguration. + public NodePlacementConfiguration() + { + } + + /// Initializes a new instance of NodePlacementConfiguration. + /// Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional policy. + internal NodePlacementConfiguration(NodePlacementPolicyType? policy) + { + Policy = policy; + } + + /// Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional policy. + public NodePlacementPolicyType? Policy { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodePlacementPolicyType.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodePlacementPolicyType.Serialization.cs new file mode 100644 index 000000000000..6e4281f3bf87 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodePlacementPolicyType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class NodePlacementPolicyTypeExtensions + { + public static string ToSerialString(this NodePlacementPolicyType value) => value switch + { + NodePlacementPolicyType.Regional => "regional", + NodePlacementPolicyType.Zonal => "zonal", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NodePlacementPolicyType value.") + }; + + public static NodePlacementPolicyType ToNodePlacementPolicyType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "regional")) return NodePlacementPolicyType.Regional; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "zonal")) return NodePlacementPolicyType.Zonal; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NodePlacementPolicyType value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodePlacementPolicyType.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodePlacementPolicyType.cs new file mode 100644 index 000000000000..282e27e3aa52 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodePlacementPolicyType.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// 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/Azure.Temp.Batch/src/Generated/Models/NodeRebootParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeRebootParameter.Serialization.cs new file mode 100644 index 000000000000..db9b8c47cf34 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeRebootParameter.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NodeRebootParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(NodeRebootOption)) + { + writer.WritePropertyName("nodeRebootOption"u8); + writer.WriteStringValue(NodeRebootOption.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeRebootParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeRebootParameter.cs new file mode 100644 index 000000000000..ce7012413d24 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeRebootParameter.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Options for rebooting a Compute Node. + public partial class NodeRebootParameter + { + /// Initializes a new instance of NodeRebootParameter. + public NodeRebootParameter() + { + } + + /// The default value is requeue. + public ComputeNodeRebootOption? NodeRebootOption { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeReimageParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeReimageParameter.Serialization.cs new file mode 100644 index 000000000000..17941e61c29f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeReimageParameter.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NodeReimageParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(NodeReimageOption)) + { + writer.WritePropertyName("nodeReimageOption"u8); + writer.WriteStringValue(NodeReimageOption.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeReimageParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeReimageParameter.cs new file mode 100644 index 000000000000..d116baa5d53b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeReimageParameter.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Options for reimaging a Compute Node. + public partial class NodeReimageParameter + { + /// Initializes a new instance of NodeReimageParameter. + public NodeReimageParameter() + { + } + + /// The default value is requeue. + public ComputeNodeReimageOption? NodeReimageOption { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeRemoveParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeRemoveParameter.Serialization.cs new file mode 100644 index 000000000000..b587addd055b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeRemoveParameter.Serialization.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NodeRemoveParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("nodeList"u8); + writer.WriteStartArray(); + foreach (var item in NodeList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(ResizeTimeout)) + { + writer.WritePropertyName("resizeTimeout"u8); + writer.WriteStringValue(ResizeTimeout.Value, "P"); + } + if (Optional.IsDefined(NodeDeallocationOption)) + { + writer.WritePropertyName("nodeDeallocationOption"u8); + writer.WriteStringValue(NodeDeallocationOption.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeRemoveParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeRemoveParameter.cs new file mode 100644 index 000000000000..3bb0d459a159 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeRemoveParameter.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Options for removing Compute Nodes from a Pool. + public partial class NodeRemoveParameter + { + /// Initializes a new instance of NodeRemoveParameter. + /// A maximum of 100 nodes may be removed per request. + /// is null. + public NodeRemoveParameter(IEnumerable nodeList) + { + Argument.AssertNotNull(nodeList, nameof(nodeList)); + + NodeList = nodeList.ToList(); + } + + /// A maximum of 100 nodes may be removed per request. + public IList NodeList { get; } + /// The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public TimeSpan? ResizeTimeout { get; set; } + /// The default value is requeue. + public ComputeNodeDeallocationOption? NodeDeallocationOption { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeUpdateUserParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeUpdateUserParameter.Serialization.cs new file mode 100644 index 000000000000..c74e8494c8ee --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeUpdateUserParameter.Serialization.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NodeUpdateUserParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + if (Optional.IsDefined(ExpiryTime)) + { + writer.WritePropertyName("expiryTime"u8); + writer.WriteStringValue(ExpiryTime.Value, "O"); + } + if (Optional.IsDefined(SshPublicKey)) + { + writer.WritePropertyName("sshPublicKey"u8); + writer.WriteStringValue(SshPublicKey); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeUpdateUserParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeUpdateUserParameter.cs new file mode 100644 index 000000000000..4f086d00dee0 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeUpdateUserParameter.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// The set of changes to be made to a user Account on a Compute Node. + public partial class NodeUpdateUserParameter + { + /// Initializes a new instance of NodeUpdateUserParameter. + public NodeUpdateUserParameter() + { + } + + /// The password is required for Windows Compute Nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows Image reference). For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed. + public string Password { get; set; } + /// If omitted, the default is 1 day from the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. + public DateTimeOffset? ExpiryTime { get; set; } + /// The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux Compute Nodes. If this is specified for a Windows Compute Node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If omitted, any existing SSH public key is removed. + public string SshPublicKey { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeVMExtension.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeVMExtension.Serialization.cs new file mode 100644 index 000000000000..7aaff49861e8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeVMExtension.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class NodeVMExtension + { + internal static NodeVMExtension DeserializeNodeVMExtension(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional provisioningState = default; + Optional vmExtension = default; + Optional instanceView = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + provisioningState = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmExtension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vmExtension = VMExtension.DeserializeVMExtension(property.Value); + continue; + } + if (property.NameEquals("instanceView"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + instanceView = VMExtensionInstanceView.DeserializeVMExtensionInstanceView(property.Value); + continue; + } + } + return new NodeVMExtension(provisioningState.Value, vmExtension.Value, instanceView.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeVMExtension.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeVMExtension.cs new file mode 100644 index 000000000000..e29acb6d80df --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeVMExtension.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The configuration for virtual machine extension instance view. + public partial class NodeVMExtension + { + /// Initializes a new instance of NodeVMExtension. + internal NodeVMExtension() + { + } + + /// Initializes a new instance of NodeVMExtension. + /// The provisioning state of the virtual machine extension. + /// The configuration for virtual machine extensions. + /// The vm extension instance view. + internal NodeVMExtension(string provisioningState, VMExtension vmExtension, VMExtensionInstanceView instanceView) + { + ProvisioningState = provisioningState; + VmExtension = vmExtension; + InstanceView = instanceView; + } + + /// The provisioning state of the virtual machine extension. + public string ProvisioningState { get; } + /// The configuration for virtual machine extensions. + public VMExtension VmExtension { get; } + /// The vm extension instance view. + public VMExtensionInstanceView InstanceView { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeVMExtensionList.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeVMExtensionList.Serialization.cs new file mode 100644 index 000000000000..d382ce509b96 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeVMExtensionList.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class NodeVMExtensionList + { + internal static NodeVMExtensionList DeserializeNodeVMExtensionList(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NodeVMExtension.DeserializeNodeVMExtension(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new NodeVMExtensionList(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeVMExtensionList.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeVMExtensionList.cs new file mode 100644 index 000000000000..de6a0a4872ce --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/NodeVMExtensionList.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the Compute Node extensions in a Node. + internal partial class NodeVMExtensionList + { + /// Initializes a new instance of NodeVMExtensionList. + internal NodeVMExtensionList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of NodeVMExtensionList. + /// The list of Compute Node extensions. + /// The URL to get the next set of results. + internal NodeVMExtensionList(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// The list of Compute Node extensions. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OSDisk.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OSDisk.Serialization.cs new file mode 100644 index 000000000000..398c84e8fdb6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OSDisk.Serialization.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class OSDisk : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(EphemeralOSDiskSettings)) + { + writer.WritePropertyName("ephemeralOSDiskSettings"u8); + writer.WriteObjectValue(EphemeralOSDiskSettings); + } + writer.WriteEndObject(); + } + + internal static OSDisk DeserializeOSDisk(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional ephemeralOSDiskSettings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ephemeralOSDiskSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ephemeralOSDiskSettings = DiffDiskSettings.DeserializeDiffDiskSettings(property.Value); + continue; + } + } + return new OSDisk(ephemeralOSDiskSettings.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OSDisk.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OSDisk.cs new file mode 100644 index 000000000000..94b4b81d7221 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OSDisk.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Settings for the operating system disk of the compute node (VM). + public partial class OSDisk + { + /// Initializes a new instance of OSDisk. + public OSDisk() + { + } + + /// Initializes a new instance of OSDisk. + /// Specifies the ephemeral Disk Settings for the operating system disk used by the compute node (VM). + internal OSDisk(DiffDiskSettings ephemeralOSDiskSettings) + { + EphemeralOSDiskSettings = ephemeralOSDiskSettings; + } + + /// Specifies the ephemeral Disk Settings for the operating system disk used by the compute node (VM). + public DiffDiskSettings EphemeralOSDiskSettings { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OSType.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OSType.Serialization.cs new file mode 100644 index 000000000000..39ae684f19f2 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OSType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class OSTypeExtensions + { + public static string ToSerialString(this OSType value) => value switch + { + OSType.Linux => "linux", + OSType.Windows => "windows", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OSType value.") + }; + + public static OSType ToOSType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "linux")) return OSType.Linux; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "windows")) return OSType.Windows; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OSType value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OSType.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OSType.cs new file mode 100644 index 000000000000..f0263c9a31b9 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OSType.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The type of operating system (e.g. Windows or Linux) of the Image. + public enum OSType + { + /// The Linux operating system. + Linux, + /// The Windows operating system. + Windows + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OnAllTasksComplete.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OnAllTasksComplete.Serialization.cs new file mode 100644 index 000000000000..1f400182e1a9 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OnAllTasksComplete.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class OnAllTasksCompleteExtensions + { + public static string ToSerialString(this OnAllTasksComplete value) => value switch + { + OnAllTasksComplete.NoAction => "noaction", + OnAllTasksComplete.TerminateJob => "terminatejob", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OnAllTasksComplete value.") + }; + + public static OnAllTasksComplete ToOnAllTasksComplete(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "noaction")) return OnAllTasksComplete.NoAction; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "terminatejob")) return OnAllTasksComplete.TerminateJob; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OnAllTasksComplete value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OnAllTasksComplete.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OnAllTasksComplete.cs new file mode 100644 index 000000000000..058583e231cb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OnAllTasksComplete.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The action the Batch service should take when all Tasks in the Job are in the completed state. + public enum OnAllTasksComplete + { + /// Do nothing. The Job remains active unless terminated or disabled by some other means. + NoAction, + /// Terminate the Job. The Job's terminateReason is set to 'AllTasksComplete'. + TerminateJob + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OnTaskFailure.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OnTaskFailure.Serialization.cs new file mode 100644 index 000000000000..d02803c75bb7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OnTaskFailure.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class OnTaskFailureExtensions + { + public static string ToSerialString(this OnTaskFailure value) => value switch + { + OnTaskFailure.NoAction => "noaction", + OnTaskFailure.PerformExitOptionsJobAction => "performexitoptionsjobaction", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OnTaskFailure value.") + }; + + public static OnTaskFailure ToOnTaskFailure(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "noaction")) return OnTaskFailure.NoAction; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "performexitoptionsjobaction")) return OnTaskFailure.PerformExitOptionsJobAction; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OnTaskFailure value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OnTaskFailure.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OnTaskFailure.cs new file mode 100644 index 000000000000..56b2514947bf --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OnTaskFailure.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// A Task is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. + public enum OnTaskFailure + { + /// Do nothing. The Job remains active unless terminated or disabled by some other means. + NoAction, + /// Take the action associated with the Task exit condition in the Task's exitConditions collection. (This may still result in no action being taken, if that is what the Task specifies.). + PerformExitOptionsJobAction + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFile.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFile.Serialization.cs new file mode 100644 index 000000000000..53a8aa7b6aa0 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFile.Serialization.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class OutputFile : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("filePattern"u8); + writer.WriteStringValue(FilePattern); + writer.WritePropertyName("destination"u8); + writer.WriteObjectValue(Destination); + writer.WritePropertyName("uploadOptions"u8); + writer.WriteObjectValue(UploadOptions); + writer.WriteEndObject(); + } + + internal static OutputFile DeserializeOutputFile(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string filePattern = default; + OutputFileDestination destination = default; + OutputFileUploadOptions uploadOptions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("filePattern"u8)) + { + filePattern = property.Value.GetString(); + continue; + } + if (property.NameEquals("destination"u8)) + { + destination = OutputFileDestination.DeserializeOutputFileDestination(property.Value); + continue; + } + if (property.NameEquals("uploadOptions"u8)) + { + uploadOptions = OutputFileUploadOptions.DeserializeOutputFileUploadOptions(property.Value); + continue; + } + } + return new OutputFile(filePattern, destination, uploadOptions); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFile.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFile.cs new file mode 100644 index 000000000000..e3fdee43d033 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFile.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// 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 + { + /// Initializes a new instance of OutputFile. + /// Both relative and absolute paths are supported. Relative paths are relative to the Task working directory. The following wildcards are supported: * matches 0 or more characters (for example pattern abc* would match abc or abcdef), ** matches any directory, ? matches any single character, [abc] matches one character in the brackets, and [a-c] matches one character in the range. Brackets can include a negation to match any character not specified (for example [!abc] matches any character but a, b, or c). If a file name starts with "." it is ignored by default but may be matched by specifying it explicitly (for example *.gif will not match .a.gif, but .*.gif will). A simple example: **\*.txt matches any file that does not start in '.' and ends with .txt in the Task working directory or any subdirectory. If the filename contains a wildcard character it can be escaped using brackets (for example abc[*] would match a file named abc*). Note that both \ and / are treated as directory separators on Windows, but only / is on Linux. Environment variables (%var% on Windows or $var on Linux) are expanded prior to the pattern being applied. + /// The destination to which a file should be uploaded. + /// Details about an output file upload operation, including under what conditions to perform the upload. + /// , or is null. + public OutputFile(string filePattern, OutputFileDestination destination, OutputFileUploadOptions uploadOptions) + { + Argument.AssertNotNull(filePattern, nameof(filePattern)); + Argument.AssertNotNull(destination, nameof(destination)); + Argument.AssertNotNull(uploadOptions, nameof(uploadOptions)); + + FilePattern = filePattern; + Destination = destination; + UploadOptions = uploadOptions; + } + + /// Both relative and absolute paths are supported. Relative paths are relative to the Task working directory. The following wildcards are supported: * matches 0 or more characters (for example pattern abc* would match abc or abcdef), ** matches any directory, ? matches any single character, [abc] matches one character in the brackets, and [a-c] matches one character in the range. Brackets can include a negation to match any character not specified (for example [!abc] matches any character but a, b, or c). If a file name starts with "." it is ignored by default but may be matched by specifying it explicitly (for example *.gif will not match .a.gif, but .*.gif will). A simple example: **\*.txt matches any file that does not start in '.' and ends with .txt in the Task working directory or any subdirectory. If the filename contains a wildcard character it can be escaped using brackets (for example abc[*] would match a file named abc*). Note that both \ and / are treated as directory separators on Windows, but only / is on Linux. Environment variables (%var% on Windows or $var on Linux) are expanded prior to the pattern being applied. + public string FilePattern { get; set; } + /// The destination to which a file should be uploaded. + public OutputFileDestination Destination { get; set; } + /// Details about an output file upload operation, including under what conditions to perform the upload. + public OutputFileUploadOptions UploadOptions { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileBlobContainerDestination.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileBlobContainerDestination.Serialization.cs new file mode 100644 index 000000000000..03860994c262 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileBlobContainerDestination.Serialization.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class OutputFileBlobContainerDestination : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + writer.WritePropertyName("containerUrl"u8); + writer.WriteStringValue(ContainerUrl); + if (Optional.IsDefined(IdentityReference)) + { + writer.WritePropertyName("identityReference"u8); + writer.WriteObjectValue(IdentityReference); + } + if (Optional.IsCollectionDefined(UploadHeaders)) + { + writer.WritePropertyName("uploadHeaders"u8); + writer.WriteStartArray(); + foreach (var item in UploadHeaders) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static OutputFileBlobContainerDestination DeserializeOutputFileBlobContainerDestination(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional path = default; + string containerUrl = default; + Optional identityReference = default; + Optional> uploadHeaders = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("containerUrl"u8)) + { + containerUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("identityReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityReference = ComputeNodeIdentityReference.DeserializeComputeNodeIdentityReference(property.Value); + continue; + } + if (property.NameEquals("uploadHeaders"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HttpHeader.DeserializeHttpHeader(item)); + } + uploadHeaders = array; + continue; + } + } + return new OutputFileBlobContainerDestination(path.Value, containerUrl, identityReference.Value, Optional.ToList(uploadHeaders)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileBlobContainerDestination.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileBlobContainerDestination.cs new file mode 100644 index 000000000000..36dc9c9da419 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileBlobContainerDestination.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Specifies a file upload destination within an Azure blob storage container. + public partial class OutputFileBlobContainerDestination + { + /// Initializes a new instance of OutputFileBlobContainerDestination. + /// If not using a managed identity, the URL must include a Shared Access Signature (SAS) granting write permissions to the container. + /// is null. + public OutputFileBlobContainerDestination(string containerUrl) + { + Argument.AssertNotNull(containerUrl, nameof(containerUrl)); + + ContainerUrl = containerUrl; + UploadHeaders = new ChangeTrackingList(); + } + + /// Initializes a new instance of OutputFileBlobContainerDestination. + /// If filePattern refers to a specific file (i.e. contains no wildcards), then path is the name of the blob to which to upload that file. If filePattern contains one or more wildcards (and therefore may match multiple files), then path is the name of the blob virtual 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. + /// If not using a managed identity, the URL must include a Shared Access Signature (SAS) granting write permissions to the container. + /// The identity must have write access to the Azure Blob Storage container. + /// These headers will be specified when uploading files to Azure Storage. Official document on allowed headers when uploading blobs: https://docs.microsoft.com/en-us/rest/api/storageservices/put-blob#request-headers-all-blob-types. + internal OutputFileBlobContainerDestination(string path, string containerUrl, ComputeNodeIdentityReference identityReference, IList uploadHeaders) + { + Path = path; + ContainerUrl = containerUrl; + IdentityReference = identityReference; + UploadHeaders = uploadHeaders; + } + + /// If filePattern refers to a specific file (i.e. contains no wildcards), then path is the name of the blob to which to upload that file. If filePattern contains one or more wildcards (and therefore may match multiple files), then path is the name of the blob virtual 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; set; } + /// If not using a managed identity, the URL must include a Shared Access Signature (SAS) granting write permissions to the container. + public string ContainerUrl { get; set; } + /// The identity must have write access to the Azure Blob Storage container. + public ComputeNodeIdentityReference IdentityReference { get; set; } + /// These headers will be specified when uploading files to Azure Storage. Official document on allowed headers when uploading blobs: https://docs.microsoft.com/en-us/rest/api/storageservices/put-blob#request-headers-all-blob-types. + public IList UploadHeaders { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileDestination.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileDestination.Serialization.cs new file mode 100644 index 000000000000..21e9590bc35a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileDestination.Serialization.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class OutputFileDestination : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Container)) + { + writer.WritePropertyName("container"u8); + writer.WriteObjectValue(Container); + } + writer.WriteEndObject(); + } + + internal static OutputFileDestination DeserializeOutputFileDestination(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional container = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("container"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + container = OutputFileBlobContainerDestination.DeserializeOutputFileBlobContainerDestination(property.Value); + continue; + } + } + return new OutputFileDestination(container.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileDestination.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileDestination.cs new file mode 100644 index 000000000000..a361d2310248 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileDestination.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The destination to which a file should be uploaded. + public partial class OutputFileDestination + { + /// Initializes a new instance of OutputFileDestination. + public OutputFileDestination() + { + } + + /// Initializes a new instance of OutputFileDestination. + /// Specifies a file upload destination within an Azure blob storage container. + internal OutputFileDestination(OutputFileBlobContainerDestination container) + { + Container = container; + } + + /// Specifies a file upload destination within an Azure blob storage container. + public OutputFileBlobContainerDestination Container { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileUploadCondition.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileUploadCondition.Serialization.cs new file mode 100644 index 000000000000..51957834411c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileUploadCondition.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class OutputFileUploadConditionExtensions + { + public static string ToSerialString(this OutputFileUploadCondition value) => value switch + { + OutputFileUploadCondition.TaskSuccess => "tasksuccess", + OutputFileUploadCondition.TaskFailure => "taskfailure", + OutputFileUploadCondition.TaskCompletion => "taskcompletion", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OutputFileUploadCondition value.") + }; + + public static OutputFileUploadCondition ToOutputFileUploadCondition(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "tasksuccess")) return OutputFileUploadCondition.TaskSuccess; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "taskfailure")) return OutputFileUploadCondition.TaskFailure; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "taskcompletion")) return OutputFileUploadCondition.TaskCompletion; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OutputFileUploadCondition value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileUploadCondition.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileUploadCondition.cs new file mode 100644 index 000000000000..108ae586b4c2 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileUploadCondition.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The conditions under which a Task output file or set of files should be uploaded. + public enum OutputFileUploadCondition + { + /// Upload the file(s) only after the Task process exits with an exit code of 0. + TaskSuccess, + /// Upload the file(s) only after the Task process exits with a nonzero exit code. + TaskFailure, + /// Upload the file(s) after the Task process exits, no matter what the exit code was. + TaskCompletion + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileUploadOptions.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileUploadOptions.Serialization.cs new file mode 100644 index 000000000000..0dfd154ccbf4 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileUploadOptions.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class OutputFileUploadOptions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("uploadCondition"u8); + writer.WriteStringValue(UploadCondition.ToSerialString()); + writer.WriteEndObject(); + } + + internal static OutputFileUploadOptions DeserializeOutputFileUploadOptions(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OutputFileUploadCondition uploadCondition = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uploadCondition"u8)) + { + uploadCondition = property.Value.GetString().ToOutputFileUploadCondition(); + continue; + } + } + return new OutputFileUploadOptions(uploadCondition); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileUploadOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileUploadOptions.cs new file mode 100644 index 000000000000..b5b9e03bf22b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/OutputFileUploadOptions.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Details about an output file upload operation, including under what conditions to perform the upload. + public partial class OutputFileUploadOptions + { + /// Initializes a new instance of OutputFileUploadOptions. + /// The default is taskcompletion. + public OutputFileUploadOptions(OutputFileUploadCondition uploadCondition) + { + UploadCondition = uploadCondition; + } + + /// The default is taskcompletion. + public OutputFileUploadCondition UploadCondition { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolAddOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolAddOptions.cs new file mode 100644 index 000000000000..d8e7e4724dcb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolAddOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolAddOptions + { + /// Initializes a new instance of PoolAddOptions. + public PoolAddOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolAddParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolAddParameter.Serialization.cs new file mode 100644 index 000000000000..cd822ac09c32 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolAddParameter.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PoolAddParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + writer.WritePropertyName("vmSize"u8); + writer.WriteStringValue(VmSize); + if (Optional.IsDefined(CloudServiceConfiguration)) + { + writer.WritePropertyName("cloudServiceConfiguration"u8); + writer.WriteObjectValue(CloudServiceConfiguration); + } + if (Optional.IsDefined(VirtualMachineConfiguration)) + { + writer.WritePropertyName("virtualMachineConfiguration"u8); + writer.WriteObjectValue(VirtualMachineConfiguration); + } + if (Optional.IsDefined(ResizeTimeout)) + { + writer.WritePropertyName("resizeTimeout"u8); + writer.WriteStringValue(ResizeTimeout.Value, "P"); + } + if (Optional.IsDefined(TargetDedicatedNodes)) + { + writer.WritePropertyName("targetDedicatedNodes"u8); + writer.WriteNumberValue(TargetDedicatedNodes.Value); + } + if (Optional.IsDefined(TargetLowPriorityNodes)) + { + writer.WritePropertyName("targetLowPriorityNodes"u8); + writer.WriteNumberValue(TargetLowPriorityNodes.Value); + } + if (Optional.IsDefined(EnableAutoScale)) + { + writer.WritePropertyName("enableAutoScale"u8); + writer.WriteBooleanValue(EnableAutoScale.Value); + } + if (Optional.IsDefined(AutoScaleFormula)) + { + writer.WritePropertyName("autoScaleFormula"u8); + writer.WriteStringValue(AutoScaleFormula); + } + if (Optional.IsDefined(AutoScaleEvaluationInterval)) + { + writer.WritePropertyName("autoScaleEvaluationInterval"u8); + writer.WriteStringValue(AutoScaleEvaluationInterval.Value, "P"); + } + if (Optional.IsDefined(EnableInterNodeCommunication)) + { + writer.WritePropertyName("enableInterNodeCommunication"u8); + writer.WriteBooleanValue(EnableInterNodeCommunication.Value); + } + if (Optional.IsDefined(NetworkConfiguration)) + { + writer.WritePropertyName("networkConfiguration"u8); + writer.WriteObjectValue(NetworkConfiguration); + } + if (Optional.IsDefined(StartTask)) + { + writer.WritePropertyName("startTask"u8); + writer.WriteObjectValue(StartTask); + } + if (Optional.IsCollectionDefined(CertificateReferences)) + { + writer.WritePropertyName("certificateReferences"u8); + writer.WriteStartArray(); + foreach (var item in CertificateReferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ApplicationPackageReferences)) + { + writer.WritePropertyName("applicationPackageReferences"u8); + writer.WriteStartArray(); + foreach (var item in ApplicationPackageReferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ApplicationLicenses)) + { + writer.WritePropertyName("applicationLicenses"u8); + writer.WriteStartArray(); + foreach (var item in ApplicationLicenses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(TaskSlotsPerNode)) + { + writer.WritePropertyName("taskSlotsPerNode"u8); + writer.WriteNumberValue(TaskSlotsPerNode.Value); + } + if (Optional.IsDefined(TaskSchedulingPolicy)) + { + writer.WritePropertyName("taskSchedulingPolicy"u8); + writer.WriteObjectValue(TaskSchedulingPolicy); + } + if (Optional.IsCollectionDefined(UserAccounts)) + { + writer.WritePropertyName("userAccounts"u8); + writer.WriteStartArray(); + foreach (var item in UserAccounts) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(MountConfiguration)) + { + writer.WritePropertyName("mountConfiguration"u8); + writer.WriteStartArray(); + foreach (var item in MountConfiguration) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(TargetNodeCommunicationMode)) + { + writer.WritePropertyName("targetNodeCommunicationMode"u8); + writer.WriteStringValue(TargetNodeCommunicationMode.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolAddParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolAddParameter.cs new file mode 100644 index 000000000000..dfb435b3dba3 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolAddParameter.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A Pool in the Azure Batch service to add. + public partial class PoolAddParameter + { + /// Initializes a new instance of PoolAddParameter. + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two Pool IDs within an Account that differ only by case). + /// For information about available sizes of virtual machines for Cloud Services Pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (https://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for Pools using Images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + /// or is null. + public PoolAddParameter(string id, string vmSize) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(vmSize, nameof(vmSize)); + + Id = id; + VmSize = vmSize; + CertificateReferences = new ChangeTrackingList(); + ApplicationPackageReferences = new ChangeTrackingList(); + ApplicationLicenses = new ChangeTrackingList(); + UserAccounts = new ChangeTrackingList(); + Metadata = new ChangeTrackingList(); + MountConfiguration = new ChangeTrackingList(); + } + + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two Pool IDs within an Account that differ only by case). + public string Id { get; } + /// The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + public string DisplayName { get; set; } + /// For information about available sizes of virtual machines for Cloud Services Pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (https://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for Pools using Images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + public string VmSize { get; } + /// This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch Account was created with its poolAllocationMode property set to 'UserSubscription'. + public CloudServiceConfiguration CloudServiceConfiguration { get; set; } + /// This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. + public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } + /// This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public TimeSpan? ResizeTimeout { get; set; } + /// This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. + public int? TargetDedicatedNodes { get; set; } + /// This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. + public int? TargetLowPriorityNodes { get; set; } + /// 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. + public bool? EnableAutoScale { get; set; } + /// This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale Compute Nodes in an Azure Batch Pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/). + public string AutoScaleFormula { get; set; } + /// The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public TimeSpan? AutoScaleEvaluationInterval { get; set; } + /// Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is false. + public bool? EnableInterNodeCommunication { get; set; } + /// The network configuration for a Pool. + public NetworkConfiguration NetworkConfiguration { get; set; } + /// The Task runs when the Compute Node is added to the Pool or when the Compute Node is restarted. + public StartTask StartTask { get; set; } + /// + /// For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + /// + /// Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + public IList CertificateReferences { get; } + /// When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Package references on any given Pool. + public IList ApplicationPackageReferences { get; } + /// The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, Pool creation will fail. + public IList ApplicationLicenses { get; } + /// The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. + public int? TaskSlotsPerNode { get; set; } + /// If not specified, the default is spread. + public TaskSchedulingPolicy TaskSchedulingPolicy { get; set; } + /// The list of user Accounts to be created on each Compute Node in the Pool. + public IList UserAccounts { get; } + /// The Batch service does not assign any meaning to metadata; it is solely for the use of user code. + public IList Metadata { get; } + /// Mount the storage using Azure fileshare, NFS, CIFS or Blobfuse based file system. + public IList MountConfiguration { get; } + /// If omitted, the default value is Default. + public NodeCommunicationMode? TargetNodeCommunicationMode { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolDeleteOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolDeleteOptions.cs new file mode 100644 index 000000000000..05362d87bd99 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolDeleteOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolDeleteOptions + { + /// Initializes a new instance of PoolDeleteOptions. + public PoolDeleteOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolDisableAutoScaleOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolDisableAutoScaleOptions.cs new file mode 100644 index 000000000000..de5564084f51 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolDisableAutoScaleOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolDisableAutoScaleOptions + { + /// Initializes a new instance of PoolDisableAutoScaleOptions. + public PoolDisableAutoScaleOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEnableAutoScaleOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEnableAutoScaleOptions.cs new file mode 100644 index 000000000000..ea49ed4c2366 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEnableAutoScaleOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolEnableAutoScaleOptions + { + /// Initializes a new instance of PoolEnableAutoScaleOptions. + public PoolEnableAutoScaleOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEnableAutoScaleParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEnableAutoScaleParameter.Serialization.cs new file mode 100644 index 000000000000..9ad0fa06b974 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEnableAutoScaleParameter.Serialization.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PoolEnableAutoScaleParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(AutoScaleFormula)) + { + writer.WritePropertyName("autoScaleFormula"u8); + writer.WriteStringValue(AutoScaleFormula); + } + if (Optional.IsDefined(AutoScaleEvaluationInterval)) + { + writer.WritePropertyName("autoScaleEvaluationInterval"u8); + writer.WriteStringValue(AutoScaleEvaluationInterval.Value, "P"); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEnableAutoScaleParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEnableAutoScaleParameter.cs new file mode 100644 index 000000000000..cbccffd13fa5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEnableAutoScaleParameter.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Options for enabling automatic scaling on a Pool. + public partial class PoolEnableAutoScaleParameter + { + /// Initializes a new instance of PoolEnableAutoScaleParameter. + public PoolEnableAutoScaleParameter() + { + } + + /// The formula is checked for validity before it is applied to the Pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). + public string AutoScaleFormula { get; set; } + /// The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued. + public TimeSpan? AutoScaleEvaluationInterval { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEndpointConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEndpointConfiguration.Serialization.cs new file mode 100644 index 000000000000..0b8a401acd81 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEndpointConfiguration.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PoolEndpointConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("inboundNATPools"u8); + writer.WriteStartArray(); + foreach (var item in InboundNATPools) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WriteEndObject(); + } + + internal static PoolEndpointConfiguration DeserializePoolEndpointConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList inboundNATPools = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("inboundNATPools"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InboundNATPool.DeserializeInboundNATPool(item)); + } + inboundNATPools = array; + continue; + } + } + return new PoolEndpointConfiguration(inboundNATPools); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEndpointConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEndpointConfiguration.cs new file mode 100644 index 000000000000..e8f9ff62dcdf --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEndpointConfiguration.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The endpoint configuration for a Pool. + public partial class PoolEndpointConfiguration + { + /// Initializes a new instance of PoolEndpointConfiguration. + /// The maximum number of inbound NAT Pools per Batch Pool is 5. If the maximum number of inbound NAT Pools is exceeded the request fails with HTTP status code 400. This cannot be specified if the IPAddressProvisioningType is NoPublicIPAddresses. + /// is null. + public PoolEndpointConfiguration(IEnumerable inboundNATPools) + { + Argument.AssertNotNull(inboundNATPools, nameof(inboundNATPools)); + + InboundNATPools = inboundNATPools.ToList(); + } + + /// Initializes a new instance of PoolEndpointConfiguration. + /// The maximum number of inbound NAT Pools per Batch Pool is 5. If the maximum number of inbound NAT Pools is exceeded the request fails with HTTP status code 400. This cannot be specified if the IPAddressProvisioningType is NoPublicIPAddresses. + internal PoolEndpointConfiguration(IList inboundNATPools) + { + InboundNATPools = inboundNATPools; + } + + /// The maximum number of inbound NAT Pools per Batch Pool is 5. If the maximum number of inbound NAT Pools is exceeded the request fails with HTTP status code 400. This cannot be specified if the IPAddressProvisioningType is NoPublicIPAddresses. + public IList InboundNATPools { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEvaluateAutoScaleOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEvaluateAutoScaleOptions.cs new file mode 100644 index 000000000000..70a8fbb50e57 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEvaluateAutoScaleOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolEvaluateAutoScaleOptions + { + /// Initializes a new instance of PoolEvaluateAutoScaleOptions. + public PoolEvaluateAutoScaleOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEvaluateAutoScaleParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEvaluateAutoScaleParameter.Serialization.cs new file mode 100644 index 000000000000..fb07ae004470 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEvaluateAutoScaleParameter.Serialization.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PoolEvaluateAutoScaleParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("autoScaleFormula"u8); + writer.WriteStringValue(AutoScaleFormula); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEvaluateAutoScaleParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEvaluateAutoScaleParameter.cs new file mode 100644 index 000000000000..23e558dd2f40 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolEvaluateAutoScaleParameter.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Options for evaluating an automatic scaling formula on a Pool. + public partial class PoolEvaluateAutoScaleParameter + { + /// Initializes a new instance of PoolEvaluateAutoScaleParameter. + /// The formula is validated and its results calculated, but it is not applied to the Pool. To apply the formula to the Pool, 'Enable automatic scaling on a Pool'. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). + /// is null. + public PoolEvaluateAutoScaleParameter(string autoScaleFormula) + { + Argument.AssertNotNull(autoScaleFormula, nameof(autoScaleFormula)); + + AutoScaleFormula = autoScaleFormula; + } + + /// The formula is validated and its results calculated, but it is not applied to the Pool. To apply the formula to the Pool, 'Enable automatic scaling on a Pool'. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). + public string AutoScaleFormula { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolExistsOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolExistsOptions.cs new file mode 100644 index 000000000000..f937da40faa8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolExistsOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolExistsOptions + { + /// Initializes a new instance of PoolExistsOptions. + public PoolExistsOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolGetOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolGetOptions.cs new file mode 100644 index 000000000000..bf8eb48943ac --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolGetOptions.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolGetOptions + { + /// Initializes a new instance of PoolGetOptions. + public PoolGetOptions() + { + } + + /// An OData $select clause. + public string Select { get; set; } + /// An OData $expand clause. + public string Expand { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolIdentityType.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolIdentityType.Serialization.cs new file mode 100644 index 000000000000..d97bc8f0f5fe --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolIdentityType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class PoolIdentityTypeExtensions + { + public static string ToSerialString(this PoolIdentityType value) => value switch + { + PoolIdentityType.UserAssigned => "UserAssigned", + PoolIdentityType.None => "None", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PoolIdentityType value.") + }; + + public static PoolIdentityType ToPoolIdentityType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "UserAssigned")) return PoolIdentityType.UserAssigned; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "None")) return PoolIdentityType.None; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PoolIdentityType value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolIdentityType.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolIdentityType.cs new file mode 100644 index 000000000000..df8e8300cd55 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolIdentityType.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// 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 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/Azure.Temp.Batch/src/Generated/Models/PoolInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolInformation.Serialization.cs new file mode 100644 index 000000000000..c761cde4f8fb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolInformation.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PoolInformation : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(PoolId)) + { + writer.WritePropertyName("poolId"u8); + writer.WriteStringValue(PoolId); + } + if (Optional.IsDefined(AutoPoolSpecification)) + { + writer.WritePropertyName("autoPoolSpecification"u8); + writer.WriteObjectValue(AutoPoolSpecification); + } + writer.WriteEndObject(); + } + + internal static PoolInformation DeserializePoolInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional poolId = default; + Optional autoPoolSpecification = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("poolId"u8)) + { + poolId = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoPoolSpecification"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoPoolSpecification = AutoPoolSpecification.DeserializeAutoPoolSpecification(property.Value); + continue; + } + } + return new PoolInformation(poolId.Value, autoPoolSpecification.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolInformation.cs new file mode 100644 index 000000000000..0a52d7d71086 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolInformation.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Specifies how a Job should be assigned to a Pool. + public partial class PoolInformation + { + /// Initializes a new instance of PoolInformation. + public PoolInformation() + { + } + + /// Initializes a new instance of PoolInformation. + /// You must ensure that the Pool referenced by this property exists. If the Pool does not exist at the time the Batch service tries to schedule a Job, no Tasks for the Job will run until you create a Pool with that id. Note that the Batch service will not reject the Job request; it will simply not run Tasks until the Pool exists. You must specify either the Pool ID or the auto Pool specification, but not both. + /// If auto Pool creation fails, the Batch service moves the Job to a completed state, and the Pool creation error is set in the Job's scheduling error property. The Batch service manages the lifetime (both creation and, unless keepAlive is specified, deletion) of the auto Pool. Any user actions that affect the lifetime of the auto Pool while the Job is active will result in unexpected behavior. You must specify either the Pool ID or the auto Pool specification, but not both. + internal PoolInformation(string poolId, AutoPoolSpecification autoPoolSpecification) + { + PoolId = poolId; + AutoPoolSpecification = autoPoolSpecification; + } + + /// You must ensure that the Pool referenced by this property exists. If the Pool does not exist at the time the Batch service tries to schedule a Job, no Tasks for the Job will run until you create a Pool with that id. Note that the Batch service will not reject the Job request; it will simply not run Tasks until the Pool exists. You must specify either the Pool ID or the auto Pool specification, but not both. + public string PoolId { get; set; } + /// If auto Pool creation fails, the Batch service moves the Job to a completed state, and the Pool creation error is set in the Job's scheduling error property. The Batch service manages the lifetime (both creation and, unless keepAlive is specified, deletion) of the auto Pool. Any user actions that affect the lifetime of the auto Pool while the Job is active will result in unexpected behavior. You must specify either the Pool ID or the auto Pool specification, but not both. + public AutoPoolSpecification AutoPoolSpecification { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolLifetimeOption.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolLifetimeOption.Serialization.cs new file mode 100644 index 000000000000..edf664517f37 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolLifetimeOption.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class PoolLifetimeOptionExtensions + { + public static string ToSerialString(this PoolLifetimeOption value) => value switch + { + PoolLifetimeOption.JobSchedule => "jobschedule", + PoolLifetimeOption.Job => "job", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PoolLifetimeOption value.") + }; + + public static PoolLifetimeOption ToPoolLifetimeOption(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "jobschedule")) return PoolLifetimeOption.JobSchedule; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "job")) return PoolLifetimeOption.Job; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PoolLifetimeOption value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolLifetimeOption.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolLifetimeOption.cs new file mode 100644 index 000000000000..73461157081b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolLifetimeOption.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The minimum lifetime of created auto Pools, and how multiple Jobs on a schedule are assigned to Pools. + public enum PoolLifetimeOption + { + /// The Pool exists for the lifetime of the Job Schedule. The Batch Service creates the Pool when it creates the first Job on the schedule. You may apply this option only to Job Schedules, not to Jobs. + JobSchedule, + /// The Pool exists for the lifetime of the Job to which it is dedicated. The Batch service creates the Pool when it creates the Job. If the 'job' option is applied to a Job Schedule, the Batch service creates a new auto Pool for every Job created on the schedule. + Job + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolListOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolListOptions.cs new file mode 100644 index 000000000000..a3b3ea4993b7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolListOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolListOptions + { + /// Initializes a new instance of PoolListOptions. + public PoolListOptions() + { + } + + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools. + public string Filter { get; set; } + /// An OData $select clause. + public string Select { get; set; } + /// An OData $expand clause. + public string Expand { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 Pools can be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolListUsageMetricsOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolListUsageMetricsOptions.cs new file mode 100644 index 000000000000..8870bf2f1a50 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolListUsageMetricsOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolListUsageMetricsOptions + { + /// Initializes a new instance of PoolListUsageMetricsOptions. + public PoolListUsageMetricsOptions() + { + } + + /// The earliest time from which to include metrics. This must be at least two and a half hours before the current time. If not specified this defaults to the start time of the last aggregation interval currently available. + public DateTimeOffset? StartTime { get; set; } + /// The latest time from which to include metrics. This must be at least two hours before the current time. If not specified this defaults to the end time of the last aggregation interval currently available. + public DateTimeOffset? EndTime { get; set; } + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. + public string Filter { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 results will be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolListUsageMetricsResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolListUsageMetricsResult.Serialization.cs new file mode 100644 index 000000000000..fbf7ebe61940 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolListUsageMetricsResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class PoolListUsageMetricsResult + { + internal static PoolListUsageMetricsResult DeserializePoolListUsageMetricsResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PoolUsageMetrics.DeserializePoolUsageMetrics(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new PoolListUsageMetricsResult(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolListUsageMetricsResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolListUsageMetricsResult.cs new file mode 100644 index 000000000000..08c267b7a369 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolListUsageMetricsResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of a listing the usage metrics for an Account. + internal partial class PoolListUsageMetricsResult + { + /// Initializes a new instance of PoolListUsageMetricsResult. + internal PoolListUsageMetricsResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of PoolListUsageMetricsResult. + /// The Pool usage metrics data. + /// The URL to get the next set of results. + internal PoolListUsageMetricsResult(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// The Pool usage metrics data. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolNodeCounts.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolNodeCounts.Serialization.cs new file mode 100644 index 000000000000..18ff3fd81db6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolNodeCounts.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PoolNodeCounts + { + internal static PoolNodeCounts DeserializePoolNodeCounts(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string poolId = default; + Optional dedicated = default; + Optional lowPriority = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("poolId"u8)) + { + poolId = property.Value.GetString(); + continue; + } + if (property.NameEquals("dedicated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dedicated = NodeCounts.DeserializeNodeCounts(property.Value); + continue; + } + if (property.NameEquals("lowPriority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lowPriority = NodeCounts.DeserializeNodeCounts(property.Value); + continue; + } + } + return new PoolNodeCounts(poolId, dedicated.Value, lowPriority.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolNodeCounts.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolNodeCounts.cs new file mode 100644 index 000000000000..8a8dd7a39260 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolNodeCounts.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The number of Compute Nodes in each state for a Pool. + public partial class PoolNodeCounts + { + /// Initializes a new instance of PoolNodeCounts. + /// The ID of the Pool. + /// is null. + internal PoolNodeCounts(string poolId) + { + Argument.AssertNotNull(poolId, nameof(poolId)); + + PoolId = poolId; + } + + /// Initializes a new instance of PoolNodeCounts. + /// The ID of the Pool. + /// The number of Compute Nodes in each Compute Node state. + /// The number of Compute Nodes in each Compute Node state. + internal PoolNodeCounts(string poolId, NodeCounts dedicated, NodeCounts lowPriority) + { + PoolId = poolId; + Dedicated = dedicated; + LowPriority = lowPriority; + } + + /// The ID of the Pool. + public string PoolId { get; } + /// The number of Compute Nodes in each Compute Node state. + public NodeCounts Dedicated { get; } + /// The number of Compute Nodes in each Compute Node state. + public NodeCounts LowPriority { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolNodeCountsListResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolNodeCountsListResult.Serialization.cs new file mode 100644 index 000000000000..4ebd3ac04c6d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolNodeCountsListResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + internal partial class PoolNodeCountsListResult + { + internal static PoolNodeCountsListResult DeserializePoolNodeCountsListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional odataNextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PoolNodeCounts.DeserializePoolNodeCounts(item)); + } + value = array; + continue; + } + if (property.NameEquals("odata.nextLink"u8)) + { + odataNextLink = property.Value.GetString(); + continue; + } + } + return new PoolNodeCountsListResult(Optional.ToList(value), odataNextLink.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolNodeCountsListResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolNodeCountsListResult.cs new file mode 100644 index 000000000000..33c5a54ad22d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolNodeCountsListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of listing the Compute Node counts in the Account. + internal partial class PoolNodeCountsListResult + { + /// Initializes a new instance of PoolNodeCountsListResult. + internal PoolNodeCountsListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of PoolNodeCountsListResult. + /// A list of Compute Node counts by Pool. + /// The URL to get the next set of results. + internal PoolNodeCountsListResult(IReadOnlyList value, string odataNextLink) + { + Value = value; + OdataNextLink = odataNextLink; + } + + /// A list of Compute Node counts by Pool. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string OdataNextLink { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolPatchOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolPatchOptions.cs new file mode 100644 index 000000000000..a0ffd26c1f8c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolPatchOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolPatchOptions + { + /// Initializes a new instance of PoolPatchOptions. + public PoolPatchOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolPatchParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolPatchParameter.Serialization.cs new file mode 100644 index 000000000000..f5b8ca2c211c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolPatchParameter.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PoolPatchParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(StartTask)) + { + writer.WritePropertyName("startTask"u8); + writer.WriteObjectValue(StartTask); + } + if (Optional.IsCollectionDefined(CertificateReferences)) + { + writer.WritePropertyName("certificateReferences"u8); + writer.WriteStartArray(); + foreach (var item in CertificateReferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ApplicationPackageReferences)) + { + writer.WritePropertyName("applicationPackageReferences"u8); + writer.WriteStartArray(); + foreach (var item in ApplicationPackageReferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(TargetNodeCommunicationMode)) + { + writer.WritePropertyName("targetNodeCommunicationMode"u8); + writer.WriteStringValue(TargetNodeCommunicationMode.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolPatchParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolPatchParameter.cs new file mode 100644 index 000000000000..189351627810 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolPatchParameter.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The set of changes to be made to a Pool. + public partial class PoolPatchParameter + { + /// Initializes a new instance of PoolPatchParameter. + public PoolPatchParameter() + { + CertificateReferences = new ChangeTrackingList(); + ApplicationPackageReferences = new ChangeTrackingList(); + Metadata = new ChangeTrackingList(); + } + + /// If this element is present, it overwrites any existing StartTask. If omitted, any existing StartTask is left unchanged. + public StartTask StartTask { get; set; } + /// + /// If this element is present, it replaces any existing Certificate references configured on the Pool. If omitted, any existing Certificate references are left unchanged. For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + /// + /// Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + public IList CertificateReferences { get; } + /// Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. If this element is present, it replaces any existing Package references. If you specify an empty collection, then all Package references are removed from the Pool. If omitted, any existing Package references are left unchanged. + public IList ApplicationPackageReferences { get; } + /// If this element is present, it replaces any existing metadata configured on the Pool. If you specify an empty collection, any metadata is removed from the Pool. If omitted, any existing metadata is left unchanged. + public IList Metadata { get; } + /// If this element is present, it replaces the existing targetNodeCommunicationMode configured on the Pool. If omitted, any existing metadata is left unchanged. + public NodeCommunicationMode? TargetNodeCommunicationMode { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolRemoveNodesOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolRemoveNodesOptions.cs new file mode 100644 index 000000000000..ee9357814ead --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolRemoveNodesOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolRemoveNodesOptions + { + /// Initializes a new instance of PoolRemoveNodesOptions. + public PoolRemoveNodesOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolResizeOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolResizeOptions.cs new file mode 100644 index 000000000000..612d628c06b6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolResizeOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolResizeOptions + { + /// Initializes a new instance of PoolResizeOptions. + public PoolResizeOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolResizeParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolResizeParameter.Serialization.cs new file mode 100644 index 000000000000..cdc7b64e3f29 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolResizeParameter.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PoolResizeParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(TargetDedicatedNodes)) + { + writer.WritePropertyName("targetDedicatedNodes"u8); + writer.WriteNumberValue(TargetDedicatedNodes.Value); + } + if (Optional.IsDefined(TargetLowPriorityNodes)) + { + writer.WritePropertyName("targetLowPriorityNodes"u8); + writer.WriteNumberValue(TargetLowPriorityNodes.Value); + } + if (Optional.IsDefined(ResizeTimeout)) + { + writer.WritePropertyName("resizeTimeout"u8); + writer.WriteStringValue(ResizeTimeout.Value, "P"); + } + if (Optional.IsDefined(NodeDeallocationOption)) + { + writer.WritePropertyName("nodeDeallocationOption"u8); + writer.WriteStringValue(NodeDeallocationOption.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolResizeParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolResizeParameter.cs new file mode 100644 index 000000000000..389e33843c22 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolResizeParameter.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Options for changing the size of a Pool. + public partial class PoolResizeParameter + { + /// Initializes a new instance of PoolResizeParameter. + public PoolResizeParameter() + { + } + + /// The desired number of dedicated Compute Nodes in the Pool. + public int? TargetDedicatedNodes { get; set; } + /// The desired number of Spot/Low-priority Compute Nodes in the Pool. + public int? TargetLowPriorityNodes { get; set; } + /// The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public TimeSpan? ResizeTimeout { get; set; } + /// The default value is requeue. + public ComputeNodeDeallocationOption? NodeDeallocationOption { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolSpecification.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolSpecification.Serialization.cs new file mode 100644 index 000000000000..1def019bf1f8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolSpecification.Serialization.cs @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PoolSpecification : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + writer.WritePropertyName("vmSize"u8); + writer.WriteStringValue(VmSize); + if (Optional.IsDefined(CloudServiceConfiguration)) + { + writer.WritePropertyName("cloudServiceConfiguration"u8); + writer.WriteObjectValue(CloudServiceConfiguration); + } + if (Optional.IsDefined(VirtualMachineConfiguration)) + { + writer.WritePropertyName("virtualMachineConfiguration"u8); + writer.WriteObjectValue(VirtualMachineConfiguration); + } + if (Optional.IsDefined(TaskSlotsPerNode)) + { + writer.WritePropertyName("taskSlotsPerNode"u8); + writer.WriteNumberValue(TaskSlotsPerNode.Value); + } + if (Optional.IsDefined(TaskSchedulingPolicy)) + { + writer.WritePropertyName("taskSchedulingPolicy"u8); + writer.WriteObjectValue(TaskSchedulingPolicy); + } + if (Optional.IsDefined(ResizeTimeout)) + { + writer.WritePropertyName("resizeTimeout"u8); + writer.WriteStringValue(ResizeTimeout.Value, "P"); + } + if (Optional.IsDefined(TargetDedicatedNodes)) + { + writer.WritePropertyName("targetDedicatedNodes"u8); + writer.WriteNumberValue(TargetDedicatedNodes.Value); + } + if (Optional.IsDefined(TargetLowPriorityNodes)) + { + writer.WritePropertyName("targetLowPriorityNodes"u8); + writer.WriteNumberValue(TargetLowPriorityNodes.Value); + } + if (Optional.IsDefined(EnableAutoScale)) + { + writer.WritePropertyName("enableAutoScale"u8); + writer.WriteBooleanValue(EnableAutoScale.Value); + } + if (Optional.IsDefined(AutoScaleFormula)) + { + writer.WritePropertyName("autoScaleFormula"u8); + writer.WriteStringValue(AutoScaleFormula); + } + if (Optional.IsDefined(AutoScaleEvaluationInterval)) + { + writer.WritePropertyName("autoScaleEvaluationInterval"u8); + writer.WriteStringValue(AutoScaleEvaluationInterval.Value, "P"); + } + if (Optional.IsDefined(EnableInterNodeCommunication)) + { + writer.WritePropertyName("enableInterNodeCommunication"u8); + writer.WriteBooleanValue(EnableInterNodeCommunication.Value); + } + if (Optional.IsDefined(NetworkConfiguration)) + { + writer.WritePropertyName("networkConfiguration"u8); + writer.WriteObjectValue(NetworkConfiguration); + } + if (Optional.IsDefined(StartTask)) + { + writer.WritePropertyName("startTask"u8); + writer.WriteObjectValue(StartTask); + } + if (Optional.IsCollectionDefined(CertificateReferences)) + { + writer.WritePropertyName("certificateReferences"u8); + writer.WriteStartArray(); + foreach (var item in CertificateReferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ApplicationPackageReferences)) + { + writer.WritePropertyName("applicationPackageReferences"u8); + writer.WriteStartArray(); + foreach (var item in ApplicationPackageReferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ApplicationLicenses)) + { + writer.WritePropertyName("applicationLicenses"u8); + writer.WriteStartArray(); + foreach (var item in ApplicationLicenses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(UserAccounts)) + { + writer.WritePropertyName("userAccounts"u8); + writer.WriteStartArray(); + foreach (var item in UserAccounts) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(MountConfiguration)) + { + writer.WritePropertyName("mountConfiguration"u8); + writer.WriteStartArray(); + foreach (var item in MountConfiguration) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(TargetNodeCommunicationMode)) + { + writer.WritePropertyName("targetNodeCommunicationMode"u8); + writer.WriteStringValue(TargetNodeCommunicationMode.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + internal static PoolSpecification DeserializePoolSpecification(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional displayName = default; + string vmSize = default; + Optional cloudServiceConfiguration = default; + Optional virtualMachineConfiguration = default; + Optional taskSlotsPerNode = default; + Optional taskSchedulingPolicy = default; + Optional resizeTimeout = default; + Optional targetDedicatedNodes = default; + Optional targetLowPriorityNodes = default; + Optional enableAutoScale = default; + Optional autoScaleFormula = default; + Optional autoScaleEvaluationInterval = default; + Optional enableInterNodeCommunication = default; + Optional networkConfiguration = default; + Optional startTask = default; + Optional> certificateReferences = default; + Optional> applicationPackageReferences = default; + Optional> applicationLicenses = default; + Optional> userAccounts = default; + Optional> metadata = default; + Optional> mountConfiguration = default; + Optional targetNodeCommunicationMode = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmSize"u8)) + { + vmSize = property.Value.GetString(); + continue; + } + if (property.NameEquals("cloudServiceConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cloudServiceConfiguration = CloudServiceConfiguration.DeserializeCloudServiceConfiguration(property.Value); + continue; + } + if (property.NameEquals("virtualMachineConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value); + continue; + } + if (property.NameEquals("taskSlotsPerNode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + taskSlotsPerNode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("taskSchedulingPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + taskSchedulingPolicy = TaskSchedulingPolicy.DeserializeTaskSchedulingPolicy(property.Value); + continue; + } + if (property.NameEquals("resizeTimeout"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resizeTimeout = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("targetDedicatedNodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetDedicatedNodes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("targetLowPriorityNodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetLowPriorityNodes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("enableAutoScale"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutoScale = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("autoScaleFormula"u8)) + { + autoScaleFormula = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoScaleEvaluationInterval"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoScaleEvaluationInterval = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("enableInterNodeCommunication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableInterNodeCommunication = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("networkConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkConfiguration = NetworkConfiguration.DeserializeNetworkConfiguration(property.Value); + continue; + } + if (property.NameEquals("startTask"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTask = StartTask.DeserializeStartTask(property.Value); + continue; + } + if (property.NameEquals("certificateReferences"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CertificateReference.DeserializeCertificateReference(item)); + } + certificateReferences = array; + continue; + } + if (property.NameEquals("applicationPackageReferences"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ApplicationPackageReference.DeserializeApplicationPackageReference(item)); + } + applicationPackageReferences = array; + continue; + } + if (property.NameEquals("applicationLicenses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + applicationLicenses = array; + continue; + } + if (property.NameEquals("userAccounts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserAccount.DeserializeUserAccount(item)); + } + userAccounts = array; + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MetadataItem.DeserializeMetadataItem(item)); + } + metadata = array; + continue; + } + if (property.NameEquals("mountConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.MountConfiguration.DeserializeMountConfiguration(item)); + } + mountConfiguration = array; + continue; + } + if (property.NameEquals("targetNodeCommunicationMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetNodeCommunicationMode = property.Value.GetString().ToNodeCommunicationMode(); + continue; + } + } + return new PoolSpecification(displayName.Value, vmSize, cloudServiceConfiguration.Value, virtualMachineConfiguration.Value, Optional.ToNullable(taskSlotsPerNode), taskSchedulingPolicy.Value, Optional.ToNullable(resizeTimeout), Optional.ToNullable(targetDedicatedNodes), Optional.ToNullable(targetLowPriorityNodes), Optional.ToNullable(enableAutoScale), autoScaleFormula.Value, Optional.ToNullable(autoScaleEvaluationInterval), Optional.ToNullable(enableInterNodeCommunication), networkConfiguration.Value, startTask.Value, Optional.ToList(certificateReferences), Optional.ToList(applicationPackageReferences), Optional.ToList(applicationLicenses), Optional.ToList(userAccounts), Optional.ToList(metadata), Optional.ToList(mountConfiguration), Optional.ToNullable(targetNodeCommunicationMode)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolSpecification.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolSpecification.cs new file mode 100644 index 000000000000..ff737bc1e7a4 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolSpecification.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Specification for creating a new Pool. + public partial class PoolSpecification + { + /// Initializes a new instance of PoolSpecification. + /// For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// is null. + public PoolSpecification(string vmSize) + { + Argument.AssertNotNull(vmSize, nameof(vmSize)); + + VmSize = vmSize; + CertificateReferences = new ChangeTrackingList(); + ApplicationPackageReferences = new ChangeTrackingList(); + ApplicationLicenses = new ChangeTrackingList(); + UserAccounts = new ChangeTrackingList(); + Metadata = new ChangeTrackingList(); + MountConfiguration = new ChangeTrackingList(); + } + + /// Initializes a new instance of PoolSpecification. + /// The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + /// For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// This property must be specified if the Pool needs to be created with Azure PaaS VMs. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). This property cannot be specified if the Batch Account was created with its poolAllocationMode property set to 'UserSubscription'. + /// This property must be specified if the Pool needs to be created with Azure IaaS VMs. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + /// The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. + /// If not specified, the default is spread. + /// This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + /// This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. + /// This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. + /// 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. + /// This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. + /// The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + /// Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is false. + /// The network configuration for a Pool. + /// Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. In some cases the StartTask may be re-run even though the Compute Node was not rebooted. Special care should be taken to avoid StartTasks which create breakaway process or install/launch services from the StartTask working directory, as this will block Batch from being able to re-run the StartTask. + /// + /// For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + /// + /// Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + /// When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Package references on any given Pool. + /// The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, Pool creation will fail. The permitted licenses available on the Pool are 'maya', 'vray', '3dsmax', 'arnold'. An additional charge applies for each application license added to the Pool. + /// The list of user Accounts to be created on each Compute Node in the Pool. + /// The Batch service does not assign any meaning to metadata; it is solely for the use of user code. + /// This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. + /// If omitted, the default value is Default. + internal PoolSpecification(string displayName, string vmSize, CloudServiceConfiguration cloudServiceConfiguration, VirtualMachineConfiguration virtualMachineConfiguration, int? taskSlotsPerNode, TaskSchedulingPolicy taskSchedulingPolicy, TimeSpan? resizeTimeout, int? targetDedicatedNodes, int? targetLowPriorityNodes, bool? enableAutoScale, string autoScaleFormula, TimeSpan? autoScaleEvaluationInterval, bool? enableInterNodeCommunication, NetworkConfiguration networkConfiguration, StartTask startTask, IList certificateReferences, IList applicationPackageReferences, IList applicationLicenses, IList userAccounts, IList metadata, IList mountConfiguration, NodeCommunicationMode? targetNodeCommunicationMode) + { + DisplayName = displayName; + VmSize = vmSize; + CloudServiceConfiguration = cloudServiceConfiguration; + VirtualMachineConfiguration = virtualMachineConfiguration; + TaskSlotsPerNode = taskSlotsPerNode; + TaskSchedulingPolicy = taskSchedulingPolicy; + ResizeTimeout = resizeTimeout; + TargetDedicatedNodes = targetDedicatedNodes; + TargetLowPriorityNodes = targetLowPriorityNodes; + EnableAutoScale = enableAutoScale; + AutoScaleFormula = autoScaleFormula; + AutoScaleEvaluationInterval = autoScaleEvaluationInterval; + EnableInterNodeCommunication = enableInterNodeCommunication; + NetworkConfiguration = networkConfiguration; + StartTask = startTask; + CertificateReferences = certificateReferences; + ApplicationPackageReferences = applicationPackageReferences; + ApplicationLicenses = applicationLicenses; + UserAccounts = userAccounts; + Metadata = metadata; + MountConfiguration = mountConfiguration; + TargetNodeCommunicationMode = targetNodeCommunicationMode; + } + + /// The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + public string DisplayName { get; set; } + /// For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + public string VmSize { get; set; } + /// This property must be specified if the Pool needs to be created with Azure PaaS VMs. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). This property cannot be specified if the Batch Account was created with its poolAllocationMode property set to 'UserSubscription'. + public CloudServiceConfiguration CloudServiceConfiguration { get; set; } + /// This property must be specified if the Pool needs to be created with Azure IaaS VMs. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } + /// The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. + public int? TaskSlotsPerNode { get; set; } + /// If not specified, the default is spread. + public TaskSchedulingPolicy TaskSchedulingPolicy { get; set; } + /// This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public TimeSpan? ResizeTimeout { get; set; } + /// This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. + public int? TargetDedicatedNodes { get; set; } + /// This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. + public int? TargetLowPriorityNodes { get; set; } + /// 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. + public bool? EnableAutoScale { get; set; } + /// This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. + public string AutoScaleFormula { get; set; } + /// The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public TimeSpan? AutoScaleEvaluationInterval { get; set; } + /// Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is false. + public bool? EnableInterNodeCommunication { get; set; } + /// The network configuration for a Pool. + public NetworkConfiguration NetworkConfiguration { get; set; } + /// Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. In some cases the StartTask may be re-run even though the Compute Node was not rebooted. Special care should be taken to avoid StartTasks which create breakaway process or install/launch services from the StartTask working directory, as this will block Batch from being able to re-run the StartTask. + public StartTask StartTask { get; set; } + /// + /// For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + /// + /// Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + public IList CertificateReferences { get; } + /// When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Package references on any given Pool. + public IList ApplicationPackageReferences { get; } + /// The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, Pool creation will fail. The permitted licenses available on the Pool are 'maya', 'vray', '3dsmax', 'arnold'. An additional charge applies for each application license added to the Pool. + public IList ApplicationLicenses { get; } + /// The list of user Accounts to be created on each Compute Node in the Pool. + public IList UserAccounts { get; } + /// The Batch service does not assign any meaning to metadata; it is solely for the use of user code. + public IList Metadata { get; } + /// This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. + public IList MountConfiguration { get; } + /// If omitted, the default value is Default. + public NodeCommunicationMode? TargetNodeCommunicationMode { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolState.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolState.Serialization.cs new file mode 100644 index 000000000000..60c33b5514ee --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolState.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class PoolStateExtensions + { + public static string ToSerialString(this PoolState value) => value switch + { + PoolState.Active => "active", + PoolState.Deleting => "deleting", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PoolState value.") + }; + + public static PoolState ToPoolState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "active")) return PoolState.Active; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "deleting")) return PoolState.Deleting; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PoolState value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolState.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolState.cs new file mode 100644 index 000000000000..f48242acac7b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolState.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The current state of the Pool. + public enum PoolState + { + /// The Pool is available to run Tasks subject to the availability of Compute Nodes. + Active, + /// The user has requested that the Pool be deleted, but the delete operation has not yet completed. + Deleting + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolStatistics.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolStatistics.Serialization.cs new file mode 100644 index 000000000000..5bd8273fb070 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolStatistics.Serialization.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PoolStatistics + { + internal static PoolStatistics DeserializePoolStatistics(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + DateTimeOffset startTime = default; + DateTimeOffset lastUpdateTime = default; + Optional usageStats = default; + Optional resourceStats = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdateTime"u8)) + { + lastUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("usageStats"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usageStats = UsageStatistics.DeserializeUsageStatistics(property.Value); + continue; + } + if (property.NameEquals("resourceStats"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceStats = ResourceStatistics.DeserializeResourceStatistics(property.Value); + continue; + } + } + return new PoolStatistics(url, startTime, lastUpdateTime, usageStats.Value, resourceStats.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolStatistics.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolStatistics.cs new file mode 100644 index 000000000000..e9a09846a5c8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolStatistics.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Contains utilization and resource usage statistics for the lifetime of a Pool. + public partial class PoolStatistics + { + /// Initializes a new instance of PoolStatistics. + /// The URL for the statistics. + /// The start time of the time range covered by the statistics. + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + /// is null. + internal PoolStatistics(string url, DateTimeOffset startTime, DateTimeOffset lastUpdateTime) + { + Argument.AssertNotNull(url, nameof(url)); + + Url = url; + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + } + + /// Initializes a new instance of PoolStatistics. + /// The URL for the statistics. + /// The start time of the time range covered by the statistics. + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + /// Statistics related to Pool usage information. + /// Statistics related to resource consumption by Compute Nodes in a Pool. + internal PoolStatistics(string url, DateTimeOffset startTime, DateTimeOffset lastUpdateTime, UsageStatistics usageStats, ResourceStatistics resourceStats) + { + Url = url; + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + UsageStats = usageStats; + ResourceStats = resourceStats; + } + + /// The URL for the statistics. + public string Url { get; } + /// The start time of the time range covered by the statistics. + public DateTimeOffset StartTime { get; } + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + public DateTimeOffset LastUpdateTime { get; } + /// Statistics related to Pool usage information. + public UsageStatistics UsageStats { get; } + /// Statistics related to resource consumption by Compute Nodes in a Pool. + public ResourceStatistics ResourceStats { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolStopResizeOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolStopResizeOptions.cs new file mode 100644 index 000000000000..07de98a55c48 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolStopResizeOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolStopResizeOptions + { + /// Initializes a new instance of PoolStopResizeOptions. + public PoolStopResizeOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUpdatePropertiesOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUpdatePropertiesOptions.cs new file mode 100644 index 000000000000..b123187f3a0e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUpdatePropertiesOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class PoolUpdatePropertiesOptions + { + /// Initializes a new instance of PoolUpdatePropertiesOptions. + public PoolUpdatePropertiesOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUpdatePropertiesParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUpdatePropertiesParameter.Serialization.cs new file mode 100644 index 000000000000..a190009c878f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUpdatePropertiesParameter.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PoolUpdatePropertiesParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(StartTask)) + { + writer.WritePropertyName("startTask"u8); + writer.WriteObjectValue(StartTask); + } + writer.WritePropertyName("certificateReferences"u8); + writer.WriteStartArray(); + foreach (var item in CertificateReferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("applicationPackageReferences"u8); + writer.WriteStartArray(); + foreach (var item in ApplicationPackageReferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(TargetNodeCommunicationMode)) + { + writer.WritePropertyName("targetNodeCommunicationMode"u8); + writer.WriteStringValue(TargetNodeCommunicationMode.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUpdatePropertiesParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUpdatePropertiesParameter.cs new file mode 100644 index 000000000000..138142aa64ba --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUpdatePropertiesParameter.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The set of changes to be made to a Pool. + public partial class PoolUpdatePropertiesParameter + { + /// Initializes a new instance of PoolUpdatePropertiesParameter. + /// + /// This list replaces any existing Certificate references configured on the Pool. If you specify an empty collection, any existing Certificate references are removed from the Pool. For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + /// + /// Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + /// The list replaces any existing Application Package references on the Pool. Changes to Application Package references affect all new Compute Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Application Package references on any given Pool. If omitted, or if you specify an empty collection, any existing Application Packages references are removed from the Pool. A maximum of 10 references may be specified on a given Pool. + /// This list replaces any existing metadata configured on the Pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the Pool. + /// , or is null. + public PoolUpdatePropertiesParameter(IEnumerable certificateReferences, IEnumerable applicationPackageReferences, IEnumerable metadata) + { + Argument.AssertNotNull(certificateReferences, nameof(certificateReferences)); + Argument.AssertNotNull(applicationPackageReferences, nameof(applicationPackageReferences)); + Argument.AssertNotNull(metadata, nameof(metadata)); + + CertificateReferences = certificateReferences.ToList(); + ApplicationPackageReferences = applicationPackageReferences.ToList(); + Metadata = metadata.ToList(); + } + + /// If this element is present, it overwrites any existing StartTask. If omitted, any existing StartTask is removed from the Pool. + public StartTask StartTask { get; set; } + /// + /// This list replaces any existing Certificate references configured on the Pool. If you specify an empty collection, any existing Certificate references are removed from the Pool. For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + /// + /// Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + public IList CertificateReferences { get; } + /// The list replaces any existing Application Package references on the Pool. Changes to Application Package references affect all new Compute Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Application Package references on any given Pool. If omitted, or if you specify an empty collection, any existing Application Packages references are removed from the Pool. A maximum of 10 references may be specified on a given Pool. + public IList ApplicationPackageReferences { get; } + /// This list replaces any existing metadata configured on the Pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the Pool. + public IList Metadata { get; } + /// This setting replaces any existing targetNodeCommunication setting on the Pool. If omitted, the existing setting is default. + public NodeCommunicationMode? TargetNodeCommunicationMode { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUsageMetrics.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUsageMetrics.Serialization.cs new file mode 100644 index 000000000000..b32c6718e9dc --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUsageMetrics.Serialization.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PoolUsageMetrics + { + internal static PoolUsageMetrics DeserializePoolUsageMetrics(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string poolId = default; + DateTimeOffset startTime = default; + DateTimeOffset endTime = default; + string vmSize = default; + double totalCoreHours = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("poolId"u8)) + { + poolId = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("vmSize"u8)) + { + vmSize = property.Value.GetString(); + continue; + } + if (property.NameEquals("totalCoreHours"u8)) + { + totalCoreHours = property.Value.GetDouble(); + continue; + } + } + return new PoolUsageMetrics(poolId, startTime, endTime, vmSize, totalCoreHours); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUsageMetrics.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUsageMetrics.cs new file mode 100644 index 000000000000..873ab66667ef --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PoolUsageMetrics.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Usage metrics for a Pool across an aggregation interval. + public partial class PoolUsageMetrics + { + /// Initializes a new instance of PoolUsageMetrics. + /// The ID of the Pool whose metrics are aggregated in this entry. + /// The start time of the aggregation interval covered by this entry. + /// The end time of the aggregation interval covered by this entry. + /// For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The total core hours used in the Pool during this aggregation interval. + /// or is null. + internal PoolUsageMetrics(string poolId, DateTimeOffset startTime, DateTimeOffset endTime, string vmSize, double totalCoreHours) + { + Argument.AssertNotNull(poolId, nameof(poolId)); + Argument.AssertNotNull(vmSize, nameof(vmSize)); + + PoolId = poolId; + StartTime = startTime; + EndTime = endTime; + VmSize = vmSize; + TotalCoreHours = totalCoreHours; + } + + /// The ID of the Pool whose metrics are aggregated in this entry. + public string PoolId { get; } + /// The start time of the aggregation interval covered by this entry. + public DateTimeOffset StartTime { get; } + /// The end time of the aggregation interval covered by this entry. + public DateTimeOffset EndTime { get; } + /// For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + public string VmSize { get; } + /// The total core hours used in the Pool during this aggregation interval. + public double TotalCoreHours { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PublicIPAddressConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PublicIPAddressConfiguration.Serialization.cs new file mode 100644 index 000000000000..8d654c79be33 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PublicIPAddressConfiguration.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class PublicIPAddressConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Provision)) + { + writer.WritePropertyName("provision"u8); + writer.WriteStringValue(Provision.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(IpAddressIds)) + { + writer.WritePropertyName("ipAddressIds"u8); + writer.WriteStartArray(); + foreach (var item in IpAddressIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static PublicIPAddressConfiguration DeserializePublicIPAddressConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional provision = default; + Optional> ipAddressIds = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provision"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provision = property.Value.GetString().ToIPAddressProvisioningType(); + continue; + } + if (property.NameEquals("ipAddressIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAddressIds = array; + continue; + } + } + return new PublicIPAddressConfiguration(Optional.ToNullable(provision), Optional.ToList(ipAddressIds)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PublicIPAddressConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PublicIPAddressConfiguration.cs new file mode 100644 index 000000000000..35fd8dce78ec --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/PublicIPAddressConfiguration.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The public IP Address configuration of the networking configuration of a Pool. + public partial class PublicIPAddressConfiguration + { + /// Initializes a new instance of PublicIPAddressConfiguration. + public PublicIPAddressConfiguration() + { + IpAddressIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of PublicIPAddressConfiguration. + /// The default value is BatchManaged. + /// The number of IPs specified here limits the maximum size of the Pool - 100 dedicated nodes or 100 Spot/Low-priority nodes can be allocated for each public IP. For example, a pool needing 250 dedicated VMs would need at least 3 public IPs specified. Each element of this collection is of the form: /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. + internal PublicIPAddressConfiguration(IPAddressProvisioningType? provision, IList ipAddressIds) + { + Provision = provision; + IpAddressIds = ipAddressIds; + } + + /// The default value is BatchManaged. + public IPAddressProvisioningType? Provision { get; set; } + /// The number of IPs specified here limits the maximum size of the Pool - 100 dedicated nodes or 100 Spot/Low-priority nodes can be allocated for each public IP. For example, a pool needing 250 dedicated VMs would need at least 3 public IPs specified. Each element of this collection is of the form: /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. + public IList IpAddressIds { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/RecentJob.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/RecentJob.Serialization.cs new file mode 100644 index 000000000000..407dcb70f704 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/RecentJob.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class RecentJob + { + internal static RecentJob DeserializeRecentJob(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional url = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + } + return new RecentJob(id.Value, url.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/RecentJob.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/RecentJob.cs new file mode 100644 index 000000000000..c2eab0be91f1 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/RecentJob.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Information about the most recent Job to run under the Job Schedule. + public partial class RecentJob + { + /// Initializes a new instance of RecentJob. + internal RecentJob() + { + } + + /// Initializes a new instance of RecentJob. + /// The ID of the Job. + /// The URL of the Job. + internal RecentJob(string id, string url) + { + Id = id; + Url = url; + } + + /// The ID of the Job. + public string Id { get; } + /// The URL of the Job. + public string Url { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResizeError.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResizeError.Serialization.cs new file mode 100644 index 000000000000..4a8ab079d546 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResizeError.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ResizeError + { + internal static ResizeError DeserializeResizeError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional message = default; + Optional> values = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("values"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePair.DeserializeNameValuePair(item)); + } + values = array; + continue; + } + } + return new ResizeError(code.Value, message.Value, Optional.ToList(values)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResizeError.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResizeError.cs new file mode 100644 index 000000000000..e5ee43b7bf61 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResizeError.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// An error that occurred when resizing a Pool. + public partial class ResizeError + { + /// Initializes a new instance of ResizeError. + internal ResizeError() + { + Values = new ChangeTrackingList(); + } + + /// Initializes a new instance of ResizeError. + /// An identifier for the Pool resize error. Codes are invariant and are intended to be consumed programmatically. + /// A message describing the Pool resize error, intended to be suitable for display in a user interface. + /// A list of additional error details related to the Pool resize error. + internal ResizeError(string code, string message, IReadOnlyList values) + { + Code = code; + Message = message; + Values = values; + } + + /// An identifier for the Pool resize error. Codes are invariant and are intended to be consumed programmatically. + public string Code { get; } + /// A message describing the Pool resize error, intended to be suitable for display in a user interface. + public string Message { get; } + /// A list of additional error details related to the Pool resize error. + public IReadOnlyList Values { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResourceFile.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResourceFile.Serialization.cs new file mode 100644 index 000000000000..d772eec6c900 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResourceFile.Serialization.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ResourceFile : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(AutoStorageContainerName)) + { + writer.WritePropertyName("autoStorageContainerName"u8); + writer.WriteStringValue(AutoStorageContainerName); + } + if (Optional.IsDefined(StorageContainerUrl)) + { + writer.WritePropertyName("storageContainerUrl"u8); + writer.WriteStringValue(StorageContainerUrl); + } + if (Optional.IsDefined(HttpUrl)) + { + writer.WritePropertyName("httpUrl"u8); + writer.WriteStringValue(HttpUrl); + } + if (Optional.IsDefined(BlobPrefix)) + { + writer.WritePropertyName("blobPrefix"u8); + writer.WriteStringValue(BlobPrefix); + } + if (Optional.IsDefined(FilePath)) + { + writer.WritePropertyName("filePath"u8); + writer.WriteStringValue(FilePath); + } + if (Optional.IsDefined(FileMode)) + { + writer.WritePropertyName("fileMode"u8); + writer.WriteStringValue(FileMode); + } + if (Optional.IsDefined(IdentityReference)) + { + writer.WritePropertyName("identityReference"u8); + writer.WriteObjectValue(IdentityReference); + } + writer.WriteEndObject(); + } + + internal static ResourceFile DeserializeResourceFile(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional autoStorageContainerName = default; + Optional storageContainerUrl = default; + Optional httpUrl = default; + Optional blobPrefix = default; + Optional filePath = default; + Optional fileMode = default; + Optional identityReference = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("autoStorageContainerName"u8)) + { + autoStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerUrl"u8)) + { + storageContainerUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("httpUrl"u8)) + { + httpUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("blobPrefix"u8)) + { + blobPrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("filePath"u8)) + { + filePath = property.Value.GetString(); + continue; + } + if (property.NameEquals("fileMode"u8)) + { + fileMode = property.Value.GetString(); + continue; + } + if (property.NameEquals("identityReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityReference = ComputeNodeIdentityReference.DeserializeComputeNodeIdentityReference(property.Value); + continue; + } + } + return new ResourceFile(autoStorageContainerName.Value, storageContainerUrl.Value, httpUrl.Value, blobPrefix.Value, filePath.Value, fileMode.Value, identityReference.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResourceFile.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResourceFile.cs new file mode 100644 index 000000000000..04e9cdcdfb77 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResourceFile.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// A single file or multiple files to be downloaded to a Compute Node. + public partial class ResourceFile + { + /// Initializes a new instance of ResourceFile. + public ResourceFile() + { + } + + /// Initializes a new instance of ResourceFile. + /// The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. + /// The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be 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. + /// 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 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. + /// The property is valid only when autoStorageContainerName or storageContainerUrl is used. This prefix can be a partial filename or a subdirectory. If a prefix is not specified, all the files in the container will be downloaded. + /// If the httpUrl property is specified, the filePath is required and describes the path which the file will be downloaded to, including the filename. Otherwise, if the autoStorageContainerName or storageContainerUrl property is specified, filePath is optional and is the directory to download the files to. In the case where filePath is used as a directory, any directory structure already associated with the input data will be retained in full and appended to the specified filePath directory. The specified relative path cannot break out of the Task's working directory (for example by using '..'). + /// This property applies only to files being downloaded to Linux Compute Nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows Compute Node. If this property is not specified for a Linux Compute Node, then a default value of 0770 is applied to the file. + /// The reference to a user assigned identity associated with the Batch pool which a compute node will use. + internal ResourceFile(string autoStorageContainerName, string storageContainerUrl, string httpUrl, string blobPrefix, string filePath, string fileMode, ComputeNodeIdentityReference identityReference) + { + AutoStorageContainerName = autoStorageContainerName; + StorageContainerUrl = storageContainerUrl; + HttpUrl = httpUrl; + BlobPrefix = blobPrefix; + FilePath = filePath; + FileMode = fileMode; + IdentityReference = identityReference; + } + + /// The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. + public string AutoStorageContainerName { get; set; } + /// The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be 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. + public string StorageContainerUrl { get; set; } + /// 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 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. + public string HttpUrl { get; set; } + /// The property is valid only when autoStorageContainerName or storageContainerUrl is used. This prefix can be a partial filename or a subdirectory. If a prefix is not specified, all the files in the container will be downloaded. + public string BlobPrefix { get; set; } + /// If the httpUrl property is specified, the filePath is required and describes the path which the file will be downloaded to, including the filename. Otherwise, if the autoStorageContainerName or storageContainerUrl property is specified, filePath is optional and is the directory to download the files to. In the case where filePath is used as a directory, any directory structure already associated with the input data will be retained in full and appended to the specified filePath directory. The specified relative path cannot break out of the Task's working directory (for example by using '..'). + public string FilePath { get; set; } + /// This property applies only to files being downloaded to Linux Compute Nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows Compute Node. If this property is not specified for a Linux Compute Node, then a default value of 0770 is applied to the file. + public string FileMode { get; set; } + /// The reference to a user assigned identity associated with the Batch pool which a compute node will use. + public ComputeNodeIdentityReference IdentityReference { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResourceStatistics.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResourceStatistics.Serialization.cs new file mode 100644 index 000000000000..40e0031ca74e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResourceStatistics.Serialization.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class ResourceStatistics + { + internal static ResourceStatistics DeserializeResourceStatistics(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset startTime = default; + DateTimeOffset lastUpdateTime = default; + double avgCPUPercentage = default; + double avgMemoryGiB = default; + double peakMemoryGiB = default; + double avgDiskGiB = default; + double peakDiskGiB = default; + long diskReadIOps = default; + long diskWriteIOps = default; + double diskReadGiB = default; + double diskWriteGiB = default; + double networkReadGiB = default; + double networkWriteGiB = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdateTime"u8)) + { + lastUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("avgCPUPercentage"u8)) + { + avgCPUPercentage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("avgMemoryGiB"u8)) + { + avgMemoryGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("peakMemoryGiB"u8)) + { + peakMemoryGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("avgDiskGiB"u8)) + { + avgDiskGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("peakDiskGiB"u8)) + { + peakDiskGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("diskReadIOps"u8)) + { + diskReadIOps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskWriteIOps"u8)) + { + diskWriteIOps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskReadGiB"u8)) + { + diskReadGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("diskWriteGiB"u8)) + { + diskWriteGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("networkReadGiB"u8)) + { + networkReadGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("networkWriteGiB"u8)) + { + networkWriteGiB = property.Value.GetDouble(); + continue; + } + } + return new ResourceStatistics(startTime, lastUpdateTime, avgCPUPercentage, avgMemoryGiB, peakMemoryGiB, avgDiskGiB, peakDiskGiB, diskReadIOps, diskWriteIOps, diskReadGiB, diskWriteGiB, networkReadGiB, networkWriteGiB); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResourceStatistics.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResourceStatistics.cs new file mode 100644 index 000000000000..b9a37259d6bd --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/ResourceStatistics.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Statistics related to resource consumption by Compute Nodes in a Pool. + public partial class ResourceStatistics + { + /// Initializes a new instance of ResourceStatistics. + /// The start time of the time range covered by the statistics. + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + /// The average CPU usage across all Compute Nodes in the Pool (percentage per node). + /// The average memory usage in GiB across all Compute Nodes in the Pool. + /// The peak memory usage in GiB across all Compute Nodes in the Pool. + /// The average used disk space in GiB across all Compute Nodes in the Pool. + /// The peak used disk space in GiB across all Compute Nodes in the Pool. + /// The total number of disk read operations across all Compute Nodes in the Pool. + /// The total number of disk write operations across all Compute Nodes in the Pool. + /// The total amount of data in GiB of disk reads across all Compute Nodes in the Pool. + /// The total amount of data in GiB of disk writes across all Compute Nodes in the Pool. + /// The total amount of data in GiB of network reads across all Compute Nodes in the Pool. + /// The total amount of data in GiB of network writes across all Compute Nodes in the Pool. + internal ResourceStatistics(DateTimeOffset startTime, DateTimeOffset lastUpdateTime, double avgCPUPercentage, double avgMemoryGiB, double peakMemoryGiB, double avgDiskGiB, double peakDiskGiB, long diskReadIOps, long diskWriteIOps, double diskReadGiB, double diskWriteGiB, double networkReadGiB, double networkWriteGiB) + { + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + AvgCPUPercentage = avgCPUPercentage; + AvgMemoryGiB = avgMemoryGiB; + PeakMemoryGiB = peakMemoryGiB; + AvgDiskGiB = avgDiskGiB; + PeakDiskGiB = peakDiskGiB; + DiskReadIOps = diskReadIOps; + DiskWriteIOps = diskWriteIOps; + DiskReadGiB = diskReadGiB; + DiskWriteGiB = diskWriteGiB; + NetworkReadGiB = networkReadGiB; + NetworkWriteGiB = networkWriteGiB; + } + + /// The start time of the time range covered by the statistics. + public DateTimeOffset StartTime { get; } + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + public DateTimeOffset LastUpdateTime { get; } + /// The average CPU usage across all Compute Nodes in the Pool (percentage per node). + public double AvgCPUPercentage { get; } + /// The average memory usage in GiB across all Compute Nodes in the Pool. + public double AvgMemoryGiB { get; } + /// The peak memory usage in GiB across all Compute Nodes in the Pool. + public double PeakMemoryGiB { get; } + /// The average used disk space in GiB across all Compute Nodes in the Pool. + public double AvgDiskGiB { get; } + /// The peak used disk space in GiB across all Compute Nodes in the Pool. + public double PeakDiskGiB { get; } + /// The total number of disk read operations across all Compute Nodes in the Pool. + public long DiskReadIOps { get; } + /// The total number of disk write operations across all Compute Nodes in the Pool. + public long DiskWriteIOps { get; } + /// The total amount of data in GiB of disk reads across all Compute Nodes in the Pool. + public double DiskReadGiB { get; } + /// The total amount of data in GiB of disk writes across all Compute Nodes in the Pool. + public double DiskWriteGiB { get; } + /// The total amount of data in GiB of network reads across all Compute Nodes in the Pool. + public double NetworkReadGiB { get; } + /// The total amount of data in GiB of network writes across all Compute Nodes in the Pool. + public double NetworkWriteGiB { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/Schedule.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/Schedule.Serialization.cs new file mode 100644 index 000000000000..2befb91c9129 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/Schedule.Serialization.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class Schedule : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(DoNotRunUntil)) + { + writer.WritePropertyName("doNotRunUntil"u8); + writer.WriteStringValue(DoNotRunUntil.Value, "O"); + } + if (Optional.IsDefined(DoNotRunAfter)) + { + writer.WritePropertyName("doNotRunAfter"u8); + writer.WriteStringValue(DoNotRunAfter.Value, "O"); + } + if (Optional.IsDefined(StartWindow)) + { + writer.WritePropertyName("startWindow"u8); + writer.WriteStringValue(StartWindow.Value, "P"); + } + if (Optional.IsDefined(RecurrenceInterval)) + { + writer.WritePropertyName("recurrenceInterval"u8); + writer.WriteStringValue(RecurrenceInterval.Value, "P"); + } + writer.WriteEndObject(); + } + + internal static Schedule DeserializeSchedule(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional doNotRunUntil = default; + Optional doNotRunAfter = default; + Optional startWindow = default; + Optional recurrenceInterval = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("doNotRunUntil"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + doNotRunUntil = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("doNotRunAfter"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + doNotRunAfter = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("startWindow"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startWindow = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("recurrenceInterval"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recurrenceInterval = property.Value.GetTimeSpan("P"); + continue; + } + } + return new Schedule(Optional.ToNullable(doNotRunUntil), Optional.ToNullable(doNotRunAfter), Optional.ToNullable(startWindow), Optional.ToNullable(recurrenceInterval)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/Schedule.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/Schedule.cs new file mode 100644 index 000000000000..12668a0fcc94 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/Schedule.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// The schedule according to which Jobs will be created. All times are fixed respective to UTC and are not impacted by daylight saving time. + public partial class Schedule + { + /// Initializes a new instance of Schedule. + public Schedule() + { + } + + /// Initializes a new instance of Schedule. + /// If you do not specify a doNotRunUntil time, the schedule becomes ready to create Jobs immediately. + /// If you do not specify a doNotRunAfter time, and you are creating a recurring Job Schedule, the Job Schedule will remain active until you explicitly terminate it. + /// If a Job is not created within the startWindow interval, then the 'opportunity' is lost; no Job will be created until the next recurrence of the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence interval, then this is equivalent to an infinite startWindow, because the Job that is 'due' in one recurrenceInterval is not carried forward into the next recurrence interval. The default is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + /// Because a Job Schedule can have at most one active Job under it at any given time, if it is time to create a new Job under a Job Schedule, but the previous Job is still running, the Batch service will not create the new Job until the previous Job finishes. If the previous Job does not finish within the startWindow period of the new recurrenceInterval, then no new Job will be scheduled for that interval. For recurring Jobs, you should normally specify a jobManagerTask in the jobSpecification. If you do not use jobManagerTask, you will need an external process to monitor when Jobs are created, add Tasks to the Jobs and terminate the Jobs ready for the next recurrence. The default is that the schedule does not recur: one Job is created, within the startWindow after the doNotRunUntil time, and the schedule is complete as soon as that Job finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + internal Schedule(DateTimeOffset? doNotRunUntil, DateTimeOffset? doNotRunAfter, TimeSpan? startWindow, TimeSpan? recurrenceInterval) + { + DoNotRunUntil = doNotRunUntil; + DoNotRunAfter = doNotRunAfter; + StartWindow = startWindow; + RecurrenceInterval = recurrenceInterval; + } + + /// If you do not specify a doNotRunUntil time, the schedule becomes ready to create Jobs immediately. + public DateTimeOffset? DoNotRunUntil { get; set; } + /// If you do not specify a doNotRunAfter time, and you are creating a recurring Job Schedule, the Job Schedule will remain active until you explicitly terminate it. + public DateTimeOffset? DoNotRunAfter { get; set; } + /// If a Job is not created within the startWindow interval, then the 'opportunity' is lost; no Job will be created until the next recurrence of the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence interval, then this is equivalent to an infinite startWindow, because the Job that is 'due' in one recurrenceInterval is not carried forward into the next recurrence interval. The default is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public TimeSpan? StartWindow { get; set; } + /// Because a Job Schedule can have at most one active Job under it at any given time, if it is time to create a new Job under a Job Schedule, but the previous Job is still running, the Batch service will not create the new Job until the previous Job finishes. If the previous Job does not finish within the startWindow period of the new recurrenceInterval, then no new Job will be scheduled for that interval. For recurring Jobs, you should normally specify a jobManagerTask in the jobSpecification. If you do not use jobManagerTask, you will need an external process to monitor when Jobs are created, add Tasks to the Jobs and terminate the Jobs ready for the next recurrence. The default is that the schedule does not recur: one Job is created, within the startWindow after the doNotRunUntil time, and the schedule is complete as soon as that Job finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + public TimeSpan? RecurrenceInterval { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SchedulingState.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SchedulingState.Serialization.cs new file mode 100644 index 000000000000..297d99b0631f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SchedulingState.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class SchedulingStateExtensions + { + public static string ToSerialString(this SchedulingState value) => value switch + { + SchedulingState.Enabled => "enabled", + SchedulingState.Disabled => "disabled", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SchedulingState value.") + }; + + public static SchedulingState ToSchedulingState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "enabled")) return SchedulingState.Enabled; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "disabled")) return SchedulingState.Disabled; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SchedulingState value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SchedulingState.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SchedulingState.cs new file mode 100644 index 000000000000..a020b2124472 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SchedulingState.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Whether the Compute Node is available for Task scheduling. + public enum SchedulingState + { + /// Tasks can be scheduled on the Compute Node. + Enabled, + /// No new Tasks will be scheduled on the Compute Node. Tasks already running on the Compute Node may still run to completion. All Compute Nodes start with scheduling enabled. + Disabled + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTask.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTask.Serialization.cs new file mode 100644 index 000000000000..85e74c4552bb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTask.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class StartTask : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("commandLine"u8); + writer.WriteStringValue(CommandLine); + if (Optional.IsDefined(ContainerSettings)) + { + writer.WritePropertyName("containerSettings"u8); + writer.WriteObjectValue(ContainerSettings); + } + if (Optional.IsCollectionDefined(ResourceFiles)) + { + writer.WritePropertyName("resourceFiles"u8); + writer.WriteStartArray(); + foreach (var item in ResourceFiles) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(EnvironmentSettings)) + { + writer.WritePropertyName("environmentSettings"u8); + writer.WriteStartArray(); + foreach (var item in EnvironmentSettings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(UserIdentity)) + { + writer.WritePropertyName("userIdentity"u8); + writer.WriteObjectValue(UserIdentity); + } + if (Optional.IsDefined(MaxTaskRetryCount)) + { + writer.WritePropertyName("maxTaskRetryCount"u8); + writer.WriteNumberValue(MaxTaskRetryCount.Value); + } + if (Optional.IsDefined(WaitForSuccess)) + { + writer.WritePropertyName("waitForSuccess"u8); + writer.WriteBooleanValue(WaitForSuccess.Value); + } + writer.WriteEndObject(); + } + + internal static StartTask DeserializeStartTask(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string commandLine = default; + Optional containerSettings = default; + Optional> resourceFiles = default; + Optional> environmentSettings = default; + Optional userIdentity = default; + Optional maxTaskRetryCount = default; + Optional waitForSuccess = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("commandLine"u8)) + { + commandLine = property.Value.GetString(); + continue; + } + if (property.NameEquals("containerSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerSettings = TaskContainerSettings.DeserializeTaskContainerSettings(property.Value); + continue; + } + if (property.NameEquals("resourceFiles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceFile.DeserializeResourceFile(item)); + } + resourceFiles = array; + continue; + } + if (property.NameEquals("environmentSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EnvironmentSetting.DeserializeEnvironmentSetting(item)); + } + environmentSettings = array; + continue; + } + if (property.NameEquals("userIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userIdentity = UserIdentity.DeserializeUserIdentity(property.Value); + continue; + } + if (property.NameEquals("maxTaskRetryCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTaskRetryCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("waitForSuccess"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + waitForSuccess = property.Value.GetBoolean(); + continue; + } + } + return new StartTask(commandLine, containerSettings.Value, Optional.ToList(resourceFiles), Optional.ToList(environmentSettings), userIdentity.Value, Optional.ToNullable(maxTaskRetryCount), Optional.ToNullable(waitForSuccess)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTask.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTask.cs new file mode 100644 index 000000000000..8c8d98dbd492 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTask.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. In some cases the StartTask may be re-run even though the Compute Node was not rebooted. Special care should be taken to avoid StartTasks which create breakaway process or install/launch services from the StartTask working directory, as this will block Batch from being able to re-run the StartTask. + public partial class StartTask + { + /// Initializes a new instance of StartTask. + /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// is null. + public StartTask(string commandLine) + { + Argument.AssertNotNull(commandLine, nameof(commandLine)); + + CommandLine = commandLine; + ResourceFiles = new ChangeTrackingList(); + EnvironmentSettings = new ChangeTrackingList(); + } + + /// Initializes a new instance of StartTask. + /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + /// Files listed under this element are located in the Task's working directory. + /// A list of environment variable settings for the StartTask. + /// If omitted, the Task runs as a non-administrative user unique to the Task. + /// The Batch service retries a Task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the Task. If the maximum retry count is -1, the Batch service retries the Task without limit, however this is not recommended for a start task or any task. The default value is 0 (no retries). + /// If true and the StartTask fails on a Node, the Batch service retries the StartTask up to its maximum retry count (maxTaskRetryCount). If the Task has still not completed successfully after all retries, then the Batch service marks the Node unusable, and will not schedule Tasks to it. This condition can be detected via the Compute Node state and failure info details. If false, the Batch service will not wait for the StartTask to complete. In this case, other Tasks can start executing on the Compute Node while the StartTask is still running; and even if the StartTask fails, new Tasks will continue to be scheduled on the Compute Node. The default is true. + internal StartTask(string commandLine, TaskContainerSettings containerSettings, IList resourceFiles, IList environmentSettings, UserIdentity userIdentity, int? maxTaskRetryCount, bool? waitForSuccess) + { + CommandLine = commandLine; + ContainerSettings = containerSettings; + ResourceFiles = resourceFiles; + EnvironmentSettings = environmentSettings; + UserIdentity = userIdentity; + MaxTaskRetryCount = maxTaskRetryCount; + WaitForSuccess = waitForSuccess; + } + + /// The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + public string CommandLine { get; set; } + /// When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + public TaskContainerSettings ContainerSettings { get; set; } + /// Files listed under this element are located in the Task's working directory. + public IList ResourceFiles { get; } + /// A list of environment variable settings for the StartTask. + public IList EnvironmentSettings { get; } + /// If omitted, the Task runs as a non-administrative user unique to the Task. + public UserIdentity UserIdentity { get; set; } + /// The Batch service retries a Task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the Task. If the maximum retry count is -1, the Batch service retries the Task without limit, however this is not recommended for a start task or any task. The default value is 0 (no retries). + public int? MaxTaskRetryCount { get; set; } + /// If true and the StartTask fails on a Node, the Batch service retries the StartTask up to its maximum retry count (maxTaskRetryCount). If the Task has still not completed successfully after all retries, then the Batch service marks the Node unusable, and will not schedule Tasks to it. This condition can be detected via the Compute Node state and failure info details. If false, the Batch service will not wait for the StartTask to complete. In this case, other Tasks can start executing on the Compute Node while the StartTask is still running; and even if the StartTask fails, new Tasks will continue to be scheduled on the Compute Node. The default is true. + public bool? WaitForSuccess { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTaskInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTaskInformation.Serialization.cs new file mode 100644 index 000000000000..122f19645ddb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTaskInformation.Serialization.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class StartTaskInformation + { + internal static StartTaskInformation DeserializeStartTaskInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + StartTaskState state = default; + DateTimeOffset startTime = default; + Optional endTime = default; + Optional exitCode = default; + Optional containerInfo = default; + Optional failureInfo = default; + int retryCount = default; + Optional lastRetryTime = default; + Optional result = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString().ToStartTaskState(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("exitCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exitCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("containerInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerInfo = TaskContainerExecutionInformation.DeserializeTaskContainerExecutionInformation(property.Value); + continue; + } + if (property.NameEquals("failureInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failureInfo = TaskFailureInformation.DeserializeTaskFailureInformation(property.Value); + continue; + } + if (property.NameEquals("retryCount"u8)) + { + retryCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("lastRetryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastRetryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("result"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + result = property.Value.GetString().ToTaskExecutionResult(); + continue; + } + } + return new StartTaskInformation(state, startTime, Optional.ToNullable(endTime), Optional.ToNullable(exitCode), containerInfo.Value, failureInfo.Value, retryCount, Optional.ToNullable(lastRetryTime), Optional.ToNullable(result)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTaskInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTaskInformation.cs new file mode 100644 index 000000000000..2f455fdcc8e3 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTaskInformation.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Information about a StartTask running on a Compute Node. + public partial class StartTaskInformation + { + /// Initializes a new instance of StartTaskInformation. + /// The state of the StartTask on the Compute Node. + /// This value is reset every time the Task is restarted or retried (that is, this is the most recent time at which the StartTask started running). + /// Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. + internal StartTaskInformation(StartTaskState state, DateTimeOffset startTime, int retryCount) + { + State = state; + StartTime = startTime; + RetryCount = retryCount; + } + + /// Initializes a new instance of StartTaskInformation. + /// The state of the StartTask on the Compute Node. + /// This value is reset every time the Task is restarted or retried (that is, this is the most recent time at which the StartTask started running). + /// This is the end time of the most recent run of the StartTask, if that run has completed (even if that run failed and a retry is pending). This element is not present if the StartTask is currently running. + /// This property is set only if the StartTask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the StartTask (due to timeout, or user termination via the API) you may see an operating system-defined exit code. + /// This property is set only if the Task runs in a container context. + /// This property is set only if the Task is in the completed state and encountered a failure. + /// Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. + /// This element is present only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. + /// If the value is 'failed', then the details of the failure can be found in the failureInfo property. + internal StartTaskInformation(StartTaskState state, DateTimeOffset startTime, DateTimeOffset? endTime, int? exitCode, TaskContainerExecutionInformation containerInfo, TaskFailureInformation failureInfo, int retryCount, DateTimeOffset? lastRetryTime, TaskExecutionResult? result) + { + State = state; + StartTime = startTime; + EndTime = endTime; + ExitCode = exitCode; + ContainerInfo = containerInfo; + FailureInfo = failureInfo; + RetryCount = retryCount; + LastRetryTime = lastRetryTime; + Result = result; + } + + /// The state of the StartTask on the Compute Node. + public StartTaskState State { get; } + /// This value is reset every time the Task is restarted or retried (that is, this is the most recent time at which the StartTask started running). + public DateTimeOffset StartTime { get; } + /// This is the end time of the most recent run of the StartTask, if that run has completed (even if that run failed and a retry is pending). This element is not present if the StartTask is currently running. + public DateTimeOffset? EndTime { get; } + /// This property is set only if the StartTask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the StartTask (due to timeout, or user termination via the API) you may see an operating system-defined exit code. + public int? ExitCode { get; } + /// This property is set only if the Task runs in a container context. + public TaskContainerExecutionInformation ContainerInfo { get; } + /// This property is set only if the Task is in the completed state and encountered a failure. + public TaskFailureInformation FailureInfo { get; } + /// Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. + public int RetryCount { get; } + /// This element is present only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. + public DateTimeOffset? LastRetryTime { get; } + /// If the value is 'failed', then the details of the failure can be found in the failureInfo property. + public TaskExecutionResult? Result { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTaskState.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTaskState.Serialization.cs new file mode 100644 index 000000000000..d0da9334c525 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTaskState.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class StartTaskStateExtensions + { + public static string ToSerialString(this StartTaskState value) => value switch + { + StartTaskState.Running => "running", + StartTaskState.Completed => "completed", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StartTaskState value.") + }; + + public static StartTaskState ToStartTaskState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "running")) return StartTaskState.Running; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "completed")) return StartTaskState.Completed; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StartTaskState value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTaskState.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTaskState.cs new file mode 100644 index 000000000000..ab5c04537909 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StartTaskState.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The state of the StartTask on the Compute Node. + public enum StartTaskState + { + /// The StartTask is currently running. + Running, + /// The StartTask has exited with exit code 0, or the StartTask has failed and the retry limit has reached, or the StartTask process did not run due to Task preparation errors (such as resource file download failures). + Completed + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StatusLevelTypes.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StatusLevelTypes.Serialization.cs new file mode 100644 index 000000000000..266b31856588 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StatusLevelTypes.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class StatusLevelTypesExtensions + { + public static string ToSerialString(this StatusLevelTypes value) => value switch + { + StatusLevelTypes.Error => "Error", + StatusLevelTypes.Info => "Info", + StatusLevelTypes.Warning => "Warning", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StatusLevelTypes value.") + }; + + public static StatusLevelTypes ToStatusLevelTypes(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Error")) return StatusLevelTypes.Error; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Info")) return StatusLevelTypes.Info; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Warning")) return StatusLevelTypes.Warning; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StatusLevelTypes value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StatusLevelTypes.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StatusLevelTypes.cs new file mode 100644 index 000000000000..c06e54c3c204 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StatusLevelTypes.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Level code. + public enum StatusLevelTypes + { + /// Error. + Error, + /// Info. + Info, + /// Warning. + Warning + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StorageAccountType.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StorageAccountType.Serialization.cs new file mode 100644 index 000000000000..7ee9e5f60124 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StorageAccountType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class StorageAccountTypeExtensions + { + public static string ToSerialString(this StorageAccountType value) => value switch + { + StorageAccountType.StandardLRS => "standard_lrs", + StorageAccountType.PremiumLRS => "premium_lrs", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StorageAccountType value.") + }; + + public static StorageAccountType ToStorageAccountType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "standard_lrs")) return StorageAccountType.StandardLRS; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "premium_lrs")) return StorageAccountType.PremiumLRS; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StorageAccountType value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StorageAccountType.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StorageAccountType.cs new file mode 100644 index 000000000000..2d8920c3bb0e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/StorageAccountType.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The storage Account type for use in creating data disks. + public enum StorageAccountType + { + /// The data disk should use standard locally redundant storage. + StandardLRS, + /// The data disk should use premium locally redundant storage. + PremiumLRS + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SubtaskInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SubtaskInformation.Serialization.cs new file mode 100644 index 000000000000..c187f04f68e4 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SubtaskInformation.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class SubtaskInformation + { + internal static SubtaskInformation DeserializeSubtaskInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional nodeInfo = default; + Optional startTime = default; + Optional endTime = default; + Optional exitCode = default; + Optional containerInfo = default; + Optional failureInfo = default; + Optional state = default; + Optional stateTransitionTime = default; + Optional previousState = default; + Optional previousStateTransitionTime = default; + Optional result = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nodeInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeInfo = ComputeNodeInformation.DeserializeComputeNodeInformation(property.Value); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("exitCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exitCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("containerInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerInfo = TaskContainerExecutionInformation.DeserializeTaskContainerExecutionInformation(property.Value); + continue; + } + if (property.NameEquals("failureInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failureInfo = TaskFailureInformation.DeserializeTaskFailureInformation(property.Value); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = property.Value.GetString().ToSubtaskState(); + continue; + } + if (property.NameEquals("stateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("previousState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + previousState = property.Value.GetString().ToSubtaskState(); + continue; + } + if (property.NameEquals("previousStateTransitionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + previousStateTransitionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("result"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + result = property.Value.GetString().ToTaskExecutionResult(); + continue; + } + } + return new SubtaskInformation(Optional.ToNullable(id), nodeInfo.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToNullable(exitCode), containerInfo.Value, failureInfo.Value, Optional.ToNullable(state), Optional.ToNullable(stateTransitionTime), Optional.ToNullable(previousState), Optional.ToNullable(previousStateTransitionTime), Optional.ToNullable(result)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SubtaskInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SubtaskInformation.cs new file mode 100644 index 000000000000..badf739c3267 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SubtaskInformation.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Information about an Azure Batch subtask. + public partial class SubtaskInformation + { + /// Initializes a new instance of SubtaskInformation. + internal SubtaskInformation() + { + } + + /// Initializes a new instance of SubtaskInformation. + /// The ID of the subtask. + /// Information about the Compute Node on which a Task ran. + /// The time at which the subtask started running. If the subtask has been restarted or retried, this is the most recent time at which the subtask started running. + /// This property is set only if the subtask is in the Completed state. + /// This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code. + /// This property is set only if the Task runs in a container context. + /// This property is set only if the Task is in the completed state and encountered a failure. + /// The state of the subtask. + /// The time at which the subtask entered its current state. + /// This property is not set if the subtask is in its initial running state. + /// This property is not set if the subtask is in its initial running state. + /// If the value is 'failed', then the details of the failure can be found in the failureInfo property. + internal SubtaskInformation(int? id, ComputeNodeInformation nodeInfo, DateTimeOffset? startTime, DateTimeOffset? endTime, int? exitCode, TaskContainerExecutionInformation containerInfo, TaskFailureInformation failureInfo, SubtaskState? state, DateTimeOffset? stateTransitionTime, SubtaskState? previousState, DateTimeOffset? previousStateTransitionTime, TaskExecutionResult? result) + { + Id = id; + NodeInfo = nodeInfo; + StartTime = startTime; + EndTime = endTime; + ExitCode = exitCode; + ContainerInfo = containerInfo; + FailureInfo = failureInfo; + State = state; + StateTransitionTime = stateTransitionTime; + PreviousState = previousState; + PreviousStateTransitionTime = previousStateTransitionTime; + Result = result; + } + + /// The ID of the subtask. + public int? Id { get; } + /// Information about the Compute Node on which a Task ran. + public ComputeNodeInformation NodeInfo { get; } + /// The time at which the subtask started running. If the subtask has been restarted or retried, this is the most recent time at which the subtask started running. + public DateTimeOffset? StartTime { get; } + /// This property is set only if the subtask is in the Completed state. + public DateTimeOffset? EndTime { get; } + /// This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code. + public int? ExitCode { get; } + /// This property is set only if the Task runs in a container context. + public TaskContainerExecutionInformation ContainerInfo { get; } + /// This property is set only if the Task is in the completed state and encountered a failure. + public TaskFailureInformation FailureInfo { get; } + /// The state of the subtask. + public SubtaskState? State { get; } + /// The time at which the subtask entered its current state. + public DateTimeOffset? StateTransitionTime { get; } + /// This property is not set if the subtask is in its initial running state. + public SubtaskState? PreviousState { get; } + /// This property is not set if the subtask is in its initial running state. + public DateTimeOffset? PreviousStateTransitionTime { get; } + /// If the value is 'failed', then the details of the failure can be found in the failureInfo property. + public TaskExecutionResult? Result { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SubtaskState.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SubtaskState.Serialization.cs new file mode 100644 index 000000000000..f66ce0e511d1 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SubtaskState.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class SubtaskStateExtensions + { + public static string ToSerialString(this SubtaskState value) => value switch + { + SubtaskState.Preparing => "preparing", + SubtaskState.Running => "running", + SubtaskState.Completed => "completed", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SubtaskState value.") + }; + + public static SubtaskState ToSubtaskState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "preparing")) return SubtaskState.Preparing; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "running")) return SubtaskState.Running; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "completed")) return SubtaskState.Completed; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SubtaskState value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SubtaskState.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SubtaskState.cs new file mode 100644 index 000000000000..14a5eb19d4fa --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/SubtaskState.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The state of the subtask. + public enum SubtaskState + { + /// The Task has been assigned to a Compute Node, but is waiting for a required Job Preparation Task to complete on the Compute Node. If the Job Preparation Task succeeds, the Task will move to running. If the Job Preparation Task fails, the Task will return to active and will be eligible to be assigned to a different Compute Node. + Preparing, + /// The Task is running on a Compute Node. This includes task-level preparation such as downloading resource files or deploying Packages specified on the Task - it does not necessarily mean that the Task command line has started executing. + Running, + /// The Task is no longer eligible to run, usually because the Task has finished successfully, or the Task has finished unsuccessfully and has exhausted its retry limit. A Task is also marked as completed if an error occurred launching the Task, or when the Task has been terminated. + Completed + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionOptions.cs new file mode 100644 index 000000000000..15a87d8e73de --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class TaskAddCollectionOptions + { + /// Initializes a new instance of TaskAddCollectionOptions. + public TaskAddCollectionOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionParameter.Serialization.cs new file mode 100644 index 000000000000..e682d7fe79d0 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionParameter.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskAddCollectionParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionParameter.cs new file mode 100644 index 000000000000..df3ea6107d6e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionParameter.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// A collection of Azure Batch Tasks to add. + public partial class TaskAddCollectionParameter + { + /// Initializes a new instance of TaskAddCollectionParameter. + /// The total serialized size of this collection must be less than 1MB. If it is greater than 1MB (for example if each Task has 100's of resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with fewer Tasks. + /// is null. + public TaskAddCollectionParameter(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// The total serialized size of this collection must be less than 1MB. If it is greater than 1MB (for example if each Task has 100's of resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with fewer Tasks. + public IList Value { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionResult.Serialization.cs new file mode 100644 index 000000000000..cb0172ac8f85 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionResult.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskAddCollectionResult + { + internal static TaskAddCollectionResult DeserializeTaskAddCollectionResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TaskAddResult.DeserializeTaskAddResult(item)); + } + value = array; + continue; + } + } + return new TaskAddCollectionResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionResult.cs new file mode 100644 index 000000000000..4ecf61c4bbed --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddCollectionResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of adding a collection of Tasks to a Job. + public partial class TaskAddCollectionResult + { + /// Initializes a new instance of TaskAddCollectionResult. + internal TaskAddCollectionResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of TaskAddCollectionResult. + /// The results of the add Task collection operation. + internal TaskAddCollectionResult(IReadOnlyList value) + { + Value = value; + } + + /// The results of the add Task collection operation. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddOptions.cs new file mode 100644 index 000000000000..12ccb050a08c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class TaskAddOptions + { + /// Initializes a new instance of TaskAddOptions. + public TaskAddOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddParameter.Serialization.cs new file mode 100644 index 000000000000..1484378c112e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddParameter.Serialization.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskAddParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + writer.WritePropertyName("commandLine"u8); + writer.WriteStringValue(CommandLine); + if (Optional.IsDefined(ContainerSettings)) + { + writer.WritePropertyName("containerSettings"u8); + writer.WriteObjectValue(ContainerSettings); + } + if (Optional.IsDefined(ExitConditions)) + { + writer.WritePropertyName("exitConditions"u8); + writer.WriteObjectValue(ExitConditions); + } + if (Optional.IsCollectionDefined(ResourceFiles)) + { + writer.WritePropertyName("resourceFiles"u8); + writer.WriteStartArray(); + foreach (var item in ResourceFiles) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(OutputFiles)) + { + writer.WritePropertyName("outputFiles"u8); + writer.WriteStartArray(); + foreach (var item in OutputFiles) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(EnvironmentSettings)) + { + writer.WritePropertyName("environmentSettings"u8); + writer.WriteStartArray(); + foreach (var item in EnvironmentSettings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AffinityInfo)) + { + writer.WritePropertyName("affinityInfo"u8); + writer.WriteObjectValue(AffinityInfo); + } + if (Optional.IsDefined(Constraints)) + { + writer.WritePropertyName("constraints"u8); + writer.WriteObjectValue(Constraints); + } + if (Optional.IsDefined(RequiredSlots)) + { + writer.WritePropertyName("requiredSlots"u8); + writer.WriteNumberValue(RequiredSlots.Value); + } + if (Optional.IsDefined(UserIdentity)) + { + writer.WritePropertyName("userIdentity"u8); + writer.WriteObjectValue(UserIdentity); + } + if (Optional.IsDefined(MultiInstanceSettings)) + { + writer.WritePropertyName("multiInstanceSettings"u8); + writer.WriteObjectValue(MultiInstanceSettings); + } + if (Optional.IsDefined(DependsOn)) + { + writer.WritePropertyName("dependsOn"u8); + writer.WriteObjectValue(DependsOn); + } + if (Optional.IsCollectionDefined(ApplicationPackageReferences)) + { + writer.WritePropertyName("applicationPackageReferences"u8); + writer.WriteStartArray(); + foreach (var item in ApplicationPackageReferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AuthenticationTokenSettings)) + { + writer.WritePropertyName("authenticationTokenSettings"u8); + writer.WriteObjectValue(AuthenticationTokenSettings); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddParameter.cs new file mode 100644 index 000000000000..e448501c478b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddParameter.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. + public partial class TaskAddParameter + { + /// Initializes a new instance of TaskAddParameter. + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a Job that differ only by case). + /// For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// or is null. + public TaskAddParameter(string id, string commandLine) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(commandLine, nameof(commandLine)); + + Id = id; + CommandLine = commandLine; + ResourceFiles = new ChangeTrackingList(); + OutputFiles = new ChangeTrackingList(); + EnvironmentSettings = new ChangeTrackingList(); + ApplicationPackageReferences = new ChangeTrackingList(); + } + + /// The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a Job that differ only by case). + public string Id { get; } + /// The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + public string DisplayName { get; set; } + /// For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + public string CommandLine { get; } + /// If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + public TaskContainerSettings ContainerSettings { get; set; } + /// How the Batch service should respond when the Task completes. + public ExitConditions ExitConditions { get; set; } + /// For multi-instance Tasks, the resource files will only be downloaded to the Compute Node on which the primary Task is executed. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. + public IList ResourceFiles { get; } + /// For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. + public IList OutputFiles { get; } + /// A list of environment variable settings for the Task. + public IList EnvironmentSettings { get; } + /// A locality hint that can be used by the Batch service to select a Compute Node on which to start a Task. + public AffinityInformation AffinityInfo { get; set; } + /// If you do not specify constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the Job, the maxWallClockTime is infinite, and the retentionTime is 7 days. + public TaskConstraints Constraints { get; set; } + /// 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. + public int? RequiredSlots { get; set; } + /// If omitted, the Task runs as a non-administrative user unique to the Task. + public UserIdentity UserIdentity { get; set; } + /// Multi-instance Tasks are commonly used to support MPI Tasks. In the MPI case, if any of the subtasks fail (for example due to exiting with a non-zero exit code) the entire multi-instance Task fails. The multi-instance Task is then terminated and retried, up to its retry limit. + public MultiInstanceSettings MultiInstanceSettings { get; set; } + /// This Task will not be scheduled until all Tasks that it depends on have completed successfully. If any of those Tasks fail and exhaust their retry counts, this Task will never be scheduled. If the Job does not have usesTaskDependencies set to true, and this element is present, the request fails with error code TaskDependenciesNotSpecifiedOnJob. + public TaskDependencies DependsOn { get; set; } + /// Application packages are downloaded and deployed to a shared directory, not the Task working directory. Therefore, if a referenced package is already on the Node, and is up to date, then it is not re-downloaded; the existing copy on the Compute Node is used. If a referenced Package cannot be installed, for example because the package has been deleted or because download failed, the Task fails. + public IList ApplicationPackageReferences { get; } + /// If this property is set, the Batch service provides the Task with an authentication token which can be used to authenticate Batch service operations without requiring an Account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the Task can carry out using the token depend on the settings. For example, a Task can request Job permissions in order to add other Tasks to the Job, or check the status of the Job or of other Tasks under the Job. + public AuthenticationTokenSettings AuthenticationTokenSettings { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddResult.Serialization.cs new file mode 100644 index 000000000000..17477462d0fb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddResult.Serialization.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskAddResult + { + internal static TaskAddResult DeserializeTaskAddResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TaskAddStatus status = default; + string taskId = default; + Optional eTag = default; + Optional lastModified = default; + Optional location = default; + Optional error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString().ToTaskAddStatus(); + continue; + } + if (property.NameEquals("taskId"u8)) + { + taskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("eTag"u8)) + { + eTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastModified"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModified = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = BatchError.DeserializeBatchError(property.Value); + continue; + } + } + return new TaskAddResult(status, taskId, eTag.Value, Optional.ToNullable(lastModified), location.Value, error.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddResult.cs new file mode 100644 index 000000000000..cd08dbc8f96f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddResult.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Result for a single Task added as part of an add Task collection operation. + public partial class TaskAddResult + { + /// Initializes a new instance of TaskAddResult. + /// The status of the add Task request. + /// The ID of the Task for which this is the result. + /// is null. + internal TaskAddResult(TaskAddStatus status, string taskId) + { + Argument.AssertNotNull(taskId, nameof(taskId)); + + Status = status; + TaskId = taskId; + } + + /// Initializes a new instance of TaskAddResult. + /// The status of the add Task request. + /// The ID of the Task for which this is the result. + /// You can use this to detect whether the Task has changed between requests. In particular, you can be pass the ETag with an Update Task request to specify that your changes should take effect only if nobody else has modified the Job in the meantime. + /// The last modified time of the Task. + /// The URL of the Task, if the Task was successfully added. + /// An error response received from the Azure Batch service. + internal TaskAddResult(TaskAddStatus status, string taskId, string eTag, DateTimeOffset? lastModified, string location, BatchError error) + { + Status = status; + TaskId = taskId; + ETag = eTag; + LastModified = lastModified; + Location = location; + Error = error; + } + + /// The status of the add Task request. + public TaskAddStatus Status { get; } + /// The ID of the Task for which this is the result. + public string TaskId { get; } + /// You can use this to detect whether the Task has changed between requests. In particular, you can be pass the ETag with an Update Task request to specify that your changes should take effect only if nobody else has modified the Job in the meantime. + public string ETag { get; } + /// The last modified time of the Task. + public DateTimeOffset? LastModified { get; } + /// The URL of the Task, if the Task was successfully added. + public string Location { get; } + /// An error response received from the Azure Batch service. + public BatchError Error { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddStatus.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddStatus.Serialization.cs new file mode 100644 index 000000000000..f72d718fc503 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddStatus.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class TaskAddStatusExtensions + { + public static string ToSerialString(this TaskAddStatus value) => value switch + { + TaskAddStatus.Success => "success", + TaskAddStatus.ClientError => "clienterror", + TaskAddStatus.ServerError => "servererror", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TaskAddStatus value.") + }; + + public static TaskAddStatus ToTaskAddStatus(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "success")) return TaskAddStatus.Success; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "clienterror")) return TaskAddStatus.ClientError; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "servererror")) return TaskAddStatus.ServerError; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TaskAddStatus value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddStatus.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddStatus.cs new file mode 100644 index 000000000000..2ee8e9eb5f8e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskAddStatus.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The status of the add Task request. + public enum TaskAddStatus + { + /// The Task was added successfully. + Success, + /// The Task failed to add due to a client error and should not be retried without modifying the request as appropriate. + ClientError, + /// Task failed to add due to a server error and can be retried without modification. + ServerError + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskConstraints.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskConstraints.Serialization.cs new file mode 100644 index 000000000000..43b909617908 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskConstraints.Serialization.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskConstraints : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(MaxWallClockTime)) + { + writer.WritePropertyName("maxWallClockTime"u8); + writer.WriteStringValue(MaxWallClockTime.Value, "P"); + } + if (Optional.IsDefined(RetentionTime)) + { + writer.WritePropertyName("retentionTime"u8); + writer.WriteStringValue(RetentionTime.Value, "P"); + } + if (Optional.IsDefined(MaxTaskRetryCount)) + { + writer.WritePropertyName("maxTaskRetryCount"u8); + writer.WriteNumberValue(MaxTaskRetryCount.Value); + } + writer.WriteEndObject(); + } + + internal static TaskConstraints DeserializeTaskConstraints(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional maxWallClockTime = default; + Optional retentionTime = default; + Optional maxTaskRetryCount = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxWallClockTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxWallClockTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("retentionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retentionTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("maxTaskRetryCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTaskRetryCount = property.Value.GetInt32(); + continue; + } + } + return new TaskConstraints(Optional.ToNullable(maxWallClockTime), Optional.ToNullable(retentionTime), Optional.ToNullable(maxTaskRetryCount)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskConstraints.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskConstraints.cs new file mode 100644 index 000000000000..e290b032436b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskConstraints.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Execution constraints to apply to a Task. + public partial class TaskConstraints + { + /// Initializes a new instance of TaskConstraints. + public TaskConstraints() + { + } + + /// Initializes a new instance of TaskConstraints. + /// If this is not specified, there is no time limit on how long the Task may run. + /// The default is 7 days, i.e. the Task directory will be retained for 7 days unless the Compute Node is removed or the Job is deleted. + /// Note that this value specifically controls the number of retries for the Task executable due to a nonzero exit code. The Batch service will try the Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the Task after the first attempt. If the maximum retry count is -1, the Batch service retries the Task without limit, however this is not recommended for a start task or any task. The default value is 0 (no retries). + internal TaskConstraints(TimeSpan? maxWallClockTime, TimeSpan? retentionTime, int? maxTaskRetryCount) + { + MaxWallClockTime = maxWallClockTime; + RetentionTime = retentionTime; + MaxTaskRetryCount = maxTaskRetryCount; + } + + /// If this is not specified, there is no time limit on how long the Task may run. + public TimeSpan? MaxWallClockTime { get; set; } + /// The default is 7 days, i.e. the Task directory will be retained for 7 days unless the Compute Node is removed or the Job is deleted. + public TimeSpan? RetentionTime { get; set; } + /// Note that this value specifically controls the number of retries for the Task executable due to a nonzero exit code. The Batch service will try the Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the Task after the first attempt. If the maximum retry count is -1, the Batch service retries the Task without limit, however this is not recommended for a start task or any task. The default value is 0 (no retries). + public int? MaxTaskRetryCount { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskContainerExecutionInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskContainerExecutionInformation.Serialization.cs new file mode 100644 index 000000000000..2da23c763852 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskContainerExecutionInformation.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskContainerExecutionInformation + { + internal static TaskContainerExecutionInformation DeserializeTaskContainerExecutionInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional containerId = default; + Optional state = default; + Optional error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("containerId"u8)) + { + containerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString(); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + } + return new TaskContainerExecutionInformation(containerId.Value, state.Value, error.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskContainerExecutionInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskContainerExecutionInformation.cs new file mode 100644 index 000000000000..e4e6f687e2a6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskContainerExecutionInformation.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Contains information about the container which a Task is executing. + public partial class TaskContainerExecutionInformation + { + /// Initializes a new instance of TaskContainerExecutionInformation. + internal TaskContainerExecutionInformation() + { + } + + /// Initializes a new instance of TaskContainerExecutionInformation. + /// The ID of the container. + /// This is the state of the container according to the Docker service. It is equivalent to the status field returned by "docker inspect". + /// This is the detailed error string from the Docker service, if available. It is equivalent to the error field returned by "docker inspect". + internal TaskContainerExecutionInformation(string containerId, string state, string error) + { + ContainerId = containerId; + State = state; + Error = error; + } + + /// The ID of the container. + public string ContainerId { get; } + /// This is the state of the container according to the Docker service. It is equivalent to the status field returned by "docker inspect". + public string State { get; } + /// This is the detailed error string from the Docker service, if available. It is equivalent to the error field returned by "docker inspect". + public string Error { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskContainerSettings.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskContainerSettings.Serialization.cs new file mode 100644 index 000000000000..b457cdd98202 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskContainerSettings.Serialization.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskContainerSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ContainerRunOptions)) + { + writer.WritePropertyName("containerRunOptions"u8); + writer.WriteStringValue(ContainerRunOptions); + } + writer.WritePropertyName("imageName"u8); + writer.WriteStringValue(ImageName); + if (Optional.IsDefined(Registry)) + { + writer.WritePropertyName("registry"u8); + writer.WriteObjectValue(Registry); + } + if (Optional.IsDefined(WorkingDirectory)) + { + writer.WritePropertyName("workingDirectory"u8); + writer.WriteStringValue(WorkingDirectory.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + internal static TaskContainerSettings DeserializeTaskContainerSettings(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional containerRunOptions = default; + string imageName = default; + Optional registry = default; + Optional workingDirectory = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("containerRunOptions"u8)) + { + containerRunOptions = property.Value.GetString(); + continue; + } + if (property.NameEquals("imageName"u8)) + { + imageName = property.Value.GetString(); + continue; + } + if (property.NameEquals("registry"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + registry = ContainerRegistry.DeserializeContainerRegistry(property.Value); + continue; + } + if (property.NameEquals("workingDirectory"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workingDirectory = property.Value.GetString().ToContainerWorkingDirectory(); + continue; + } + } + return new TaskContainerSettings(containerRunOptions.Value, imageName, registry.Value, Optional.ToNullable(workingDirectory)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskContainerSettings.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskContainerSettings.cs new file mode 100644 index 000000000000..8e010561206f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskContainerSettings.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The container settings for a Task. + public partial class TaskContainerSettings + { + /// Initializes a new instance of TaskContainerSettings. + /// This is the full Image reference, as would be specified to "docker pull". If no tag is provided as part of the Image name, the tag ":latest" is used as a default. + /// is null. + public TaskContainerSettings(string imageName) + { + Argument.AssertNotNull(imageName, nameof(imageName)); + + ImageName = imageName; + } + + /// Initializes a new instance of TaskContainerSettings. + /// These additional options are supplied as arguments to the "docker create" command, in addition to those controlled by the Batch Service. + /// This is the full Image reference, as would be specified to "docker pull". If no tag is provided as part of the Image name, the tag ":latest" is used as a default. + /// This setting can be omitted if was already provided at Pool creation. + /// The default is 'taskWorkingDirectory'. + internal TaskContainerSettings(string containerRunOptions, string imageName, ContainerRegistry registry, ContainerWorkingDirectory? workingDirectory) + { + ContainerRunOptions = containerRunOptions; + ImageName = imageName; + Registry = registry; + WorkingDirectory = workingDirectory; + } + + /// These additional options are supplied as arguments to the "docker create" command, in addition to those controlled by the Batch Service. + public string ContainerRunOptions { get; set; } + /// This is the full Image reference, as would be specified to "docker pull". If no tag is provided as part of the Image name, the tag ":latest" is used as a default. + public string ImageName { get; set; } + /// This setting can be omitted if was already provided at Pool creation. + public ContainerRegistry Registry { get; set; } + /// The default is 'taskWorkingDirectory'. + public ContainerWorkingDirectory? WorkingDirectory { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskCounts.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskCounts.Serialization.cs new file mode 100644 index 000000000000..264ebbbd07c3 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskCounts.Serialization.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskCounts + { + internal static TaskCounts DeserializeTaskCounts(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int active = default; + int running = default; + int completed = default; + int succeeded = default; + int failed = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("active"u8)) + { + active = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("running"u8)) + { + running = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("completed"u8)) + { + completed = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("succeeded"u8)) + { + succeeded = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("failed"u8)) + { + failed = property.Value.GetInt32(); + continue; + } + } + return new TaskCounts(active, running, completed, succeeded, failed); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskCounts.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskCounts.cs new file mode 100644 index 000000000000..1638e9bbf769 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskCounts.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The Task counts for a Job. + public partial class TaskCounts + { + /// Initializes a new instance of TaskCounts. + /// The number of Tasks in the active state. + /// The number of Tasks in the running or preparing state. + /// The number of Tasks in the completed state. + /// The number of Tasks which succeeded. A Task succeeds if its result (found in the executionInfo property) is 'success'. + /// The number of Tasks which failed. A Task fails if its result (found in the executionInfo property) is 'failure'. + internal TaskCounts(int active, int running, int completed, int succeeded, int failed) + { + Active = active; + Running = running; + Completed = completed; + Succeeded = succeeded; + Failed = failed; + } + + /// The number of Tasks in the active state. + public int Active { get; } + /// The number of Tasks in the running or preparing state. + public int Running { get; } + /// The number of Tasks in the completed state. + public int Completed { get; } + /// The number of Tasks which succeeded. A Task succeeds if its result (found in the executionInfo property) is 'success'. + public int Succeeded { get; } + /// The number of Tasks which failed. A Task fails if its result (found in the executionInfo property) is 'failure'. + public int Failed { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskCountsResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskCountsResult.Serialization.cs new file mode 100644 index 000000000000..bd4d827d639d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskCountsResult.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskCountsResult + { + internal static TaskCountsResult DeserializeTaskCountsResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TaskCounts taskCounts = default; + TaskSlotCounts taskSlotCounts = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("taskCounts"u8)) + { + taskCounts = TaskCounts.DeserializeTaskCounts(property.Value); + continue; + } + if (property.NameEquals("taskSlotCounts"u8)) + { + taskSlotCounts = TaskSlotCounts.DeserializeTaskSlotCounts(property.Value); + continue; + } + } + return new TaskCountsResult(taskCounts, taskSlotCounts); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskCountsResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskCountsResult.cs new file mode 100644 index 000000000000..cd81c223d713 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskCountsResult.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The Task and TaskSlot counts for a Job. + public partial class TaskCountsResult + { + /// Initializes a new instance of TaskCountsResult. + /// The Task counts for a Job. + /// The TaskSlot counts for a Job. + /// or is null. + internal TaskCountsResult(TaskCounts taskCounts, TaskSlotCounts taskSlotCounts) + { + Argument.AssertNotNull(taskCounts, nameof(taskCounts)); + Argument.AssertNotNull(taskSlotCounts, nameof(taskSlotCounts)); + + TaskCounts = taskCounts; + TaskSlotCounts = taskSlotCounts; + } + + /// The Task counts for a Job. + public TaskCounts TaskCounts { get; } + /// The TaskSlot counts for a Job. + public TaskSlotCounts TaskSlotCounts { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskDeleteOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskDeleteOptions.cs new file mode 100644 index 000000000000..38524ef08a89 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskDeleteOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class TaskDeleteOptions + { + /// Initializes a new instance of TaskDeleteOptions. + public TaskDeleteOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskDependencies.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskDependencies.Serialization.cs new file mode 100644 index 000000000000..0e4f72de5cee --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskDependencies.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskDependencies : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(TaskIds)) + { + writer.WritePropertyName("taskIds"u8); + writer.WriteStartArray(); + foreach (var item in TaskIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TaskIdRanges)) + { + writer.WritePropertyName("taskIdRanges"u8); + writer.WriteStartArray(); + foreach (var item in TaskIdRanges) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static TaskDependencies DeserializeTaskDependencies(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> taskIds = default; + Optional> taskIdRanges = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("taskIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + taskIds = array; + continue; + } + if (property.NameEquals("taskIdRanges"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TaskIdRange.DeserializeTaskIdRange(item)); + } + taskIdRanges = array; + continue; + } + } + return new TaskDependencies(Optional.ToList(taskIds), Optional.ToList(taskIdRanges)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskDependencies.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskDependencies.cs new file mode 100644 index 000000000000..faa0f919ec30 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskDependencies.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Specifies any dependencies of a Task. Any Task that is explicitly specified or within a dependency range must complete before the dependant Task will be scheduled. + public partial class TaskDependencies + { + /// Initializes a new instance of TaskDependencies. + public TaskDependencies() + { + TaskIds = new ChangeTrackingList(); + TaskIdRanges = new ChangeTrackingList(); + } + + /// Initializes a new instance of TaskDependencies. + /// The taskIds collection is limited to 64000 characters total (i.e. the combined length of all Task IDs). If the taskIds collection exceeds the maximum length, the Add Task request fails with error code TaskDependencyListTooLong. In this case consider using Task ID ranges instead. + /// The list of Task ID ranges that this Task depends on. All Tasks in all ranges must complete successfully before the dependent Task can be scheduled. + internal TaskDependencies(IList taskIds, IList taskIdRanges) + { + TaskIds = taskIds; + TaskIdRanges = taskIdRanges; + } + + /// The taskIds collection is limited to 64000 characters total (i.e. the combined length of all Task IDs). If the taskIds collection exceeds the maximum length, the Add Task request fails with error code TaskDependencyListTooLong. In this case consider using Task ID ranges instead. + public IList TaskIds { get; } + /// The list of Task ID ranges that this Task depends on. All Tasks in all ranges must complete successfully before the dependent Task can be scheduled. + public IList TaskIdRanges { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskExecutionInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskExecutionInformation.Serialization.cs new file mode 100644 index 000000000000..f88479559da5 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskExecutionInformation.Serialization.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskExecutionInformation + { + internal static TaskExecutionInformation DeserializeTaskExecutionInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional startTime = default; + Optional endTime = default; + Optional exitCode = default; + Optional containerInfo = default; + Optional failureInfo = default; + int retryCount = default; + Optional lastRetryTime = default; + int requeueCount = default; + Optional lastRequeueTime = default; + Optional result = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("exitCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exitCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("containerInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerInfo = TaskContainerExecutionInformation.DeserializeTaskContainerExecutionInformation(property.Value); + continue; + } + if (property.NameEquals("failureInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failureInfo = TaskFailureInformation.DeserializeTaskFailureInformation(property.Value); + continue; + } + if (property.NameEquals("retryCount"u8)) + { + retryCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("lastRetryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastRetryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("requeueCount"u8)) + { + requeueCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("lastRequeueTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastRequeueTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("result"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + result = property.Value.GetString().ToTaskExecutionResult(); + continue; + } + } + return new TaskExecutionInformation(Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToNullable(exitCode), containerInfo.Value, failureInfo.Value, retryCount, Optional.ToNullable(lastRetryTime), requeueCount, Optional.ToNullable(lastRequeueTime), Optional.ToNullable(result)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskExecutionInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskExecutionInformation.cs new file mode 100644 index 000000000000..9a08d06db5bc --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskExecutionInformation.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Information about the execution of a Task. + public partial class TaskExecutionInformation + { + /// Initializes a new instance of TaskExecutionInformation. + /// Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. + /// When the user removes Compute Nodes from a Pool (by resizing/shrinking the pool) or when the Job is being disabled, the user can specify that running Tasks on the Compute Nodes be requeued for execution. This count tracks how many times the Task has been requeued for these reasons. + internal TaskExecutionInformation(int retryCount, int requeueCount) + { + RetryCount = retryCount; + RequeueCount = requeueCount; + } + + /// Initializes a new instance of TaskExecutionInformation. + /// 'Running' corresponds to the running state, so if the Task specifies resource files or Packages, then the start time reflects the time at which the Task started downloading or deploying these. If the Task has been restarted or retried, this is the most recent time at which the Task started running. This property is present only for Tasks that are in the running or completed state. + /// This property is set only if the Task is in the Completed state. + /// This property is set only if the Task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the Task (due to timeout, or user termination via the API) you may see an operating system-defined exit code. + /// This property is set only if the Task runs in a container context. + /// This property is set only if the Task is in the completed state and encountered a failure. + /// Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. + /// This element is present only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. + /// When the user removes Compute Nodes from a Pool (by resizing/shrinking the pool) or when the Job is being disabled, the user can specify that running Tasks on the Compute Nodes be requeued for execution. This count tracks how many times the Task has been requeued for these reasons. + /// This property is set only if the requeueCount is nonzero. + /// If the value is 'failed', then the details of the failure can be found in the failureInfo property. + internal TaskExecutionInformation(DateTimeOffset? startTime, DateTimeOffset? endTime, int? exitCode, TaskContainerExecutionInformation containerInfo, TaskFailureInformation failureInfo, int retryCount, DateTimeOffset? lastRetryTime, int requeueCount, DateTimeOffset? lastRequeueTime, TaskExecutionResult? result) + { + StartTime = startTime; + EndTime = endTime; + ExitCode = exitCode; + ContainerInfo = containerInfo; + FailureInfo = failureInfo; + RetryCount = retryCount; + LastRetryTime = lastRetryTime; + RequeueCount = requeueCount; + LastRequeueTime = lastRequeueTime; + Result = result; + } + + /// 'Running' corresponds to the running state, so if the Task specifies resource files or Packages, then the start time reflects the time at which the Task started downloading or deploying these. If the Task has been restarted or retried, this is the most recent time at which the Task started running. This property is present only for Tasks that are in the running or completed state. + public DateTimeOffset? StartTime { get; } + /// This property is set only if the Task is in the Completed state. + public DateTimeOffset? EndTime { get; } + /// This property is set only if the Task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the Task (due to timeout, or user termination via the API) you may see an operating system-defined exit code. + public int? ExitCode { get; } + /// This property is set only if the Task runs in a container context. + public TaskContainerExecutionInformation ContainerInfo { get; } + /// This property is set only if the Task is in the completed state and encountered a failure. + public TaskFailureInformation FailureInfo { get; } + /// Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. + public int RetryCount { get; } + /// This element is present only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. + public DateTimeOffset? LastRetryTime { get; } + /// When the user removes Compute Nodes from a Pool (by resizing/shrinking the pool) or when the Job is being disabled, the user can specify that running Tasks on the Compute Nodes be requeued for execution. This count tracks how many times the Task has been requeued for these reasons. + public int RequeueCount { get; } + /// This property is set only if the requeueCount is nonzero. + public DateTimeOffset? LastRequeueTime { get; } + /// If the value is 'failed', then the details of the failure can be found in the failureInfo property. + public TaskExecutionResult? Result { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskExecutionResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskExecutionResult.Serialization.cs new file mode 100644 index 000000000000..03f61ca9a910 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskExecutionResult.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class TaskExecutionResultExtensions + { + public static string ToSerialString(this TaskExecutionResult value) => value switch + { + TaskExecutionResult.Success => "success", + TaskExecutionResult.Failure => "failure", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TaskExecutionResult value.") + }; + + public static TaskExecutionResult ToTaskExecutionResult(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "success")) return TaskExecutionResult.Success; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "failure")) return TaskExecutionResult.Failure; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TaskExecutionResult value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskExecutionResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskExecutionResult.cs new file mode 100644 index 000000000000..21bed84924c6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskExecutionResult.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The result of Task execution. + public enum TaskExecutionResult + { + /// The Task ran successfully. + Success, + /// There was an error during processing of the Task. The failure may have occurred before the Task process was launched, while the Task process was executing, or after the Task process exited. + Failure + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskFailureInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskFailureInformation.Serialization.cs new file mode 100644 index 000000000000..576c356ed949 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskFailureInformation.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskFailureInformation + { + internal static TaskFailureInformation DeserializeTaskFailureInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ErrorCategory category = default; + Optional code = default; + Optional message = default; + Optional> details = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString().ToErrorCategory(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePair.DeserializeNameValuePair(item)); + } + details = array; + continue; + } + } + return new TaskFailureInformation(category, code.Value, message.Value, Optional.ToList(details)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskFailureInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskFailureInformation.cs new file mode 100644 index 000000000000..0130d2c3cb07 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskFailureInformation.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Information about a Task failure. + public partial class TaskFailureInformation + { + /// Initializes a new instance of TaskFailureInformation. + /// The category of the error. + internal TaskFailureInformation(ErrorCategory category) + { + Category = category; + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of TaskFailureInformation. + /// The category of the error. + /// An identifier for the Task error. Codes are invariant and are intended to be consumed programmatically. + /// A message describing the Task error, intended to be suitable for display in a user interface. + /// A list of additional details related to the error. + internal TaskFailureInformation(ErrorCategory category, string code, string message, IReadOnlyList details) + { + Category = category; + Code = code; + Message = message; + Details = details; + } + + /// The category of the error. + public ErrorCategory Category { get; } + /// An identifier for the Task error. Codes are invariant and are intended to be consumed programmatically. + public string Code { get; } + /// A message describing the Task error, intended to be suitable for display in a user interface. + public string Message { get; } + /// A list of additional details related to the error. + public IReadOnlyList Details { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskGetOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskGetOptions.cs new file mode 100644 index 000000000000..d1fc9cafe78f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskGetOptions.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class TaskGetOptions + { + /// Initializes a new instance of TaskGetOptions. + public TaskGetOptions() + { + } + + /// An OData $select clause. + public string Select { get; set; } + /// An OData $expand clause. + public string Expand { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskIdRange.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskIdRange.Serialization.cs new file mode 100644 index 000000000000..d05fb6739496 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskIdRange.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskIdRange : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("start"u8); + writer.WriteNumberValue(Start); + writer.WritePropertyName("end"u8); + writer.WriteNumberValue(End); + writer.WriteEndObject(); + } + + internal static TaskIdRange DeserializeTaskIdRange(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int start = default; + int end = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("start"u8)) + { + start = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("end"u8)) + { + end = property.Value.GetInt32(); + continue; + } + } + return new TaskIdRange(start, end); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskIdRange.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskIdRange.cs new file mode 100644 index 000000000000..25ae32f316fc --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskIdRange.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The start and end of the range are inclusive. For example, if a range has start 9 and end 12, then it represents Tasks '9', '10', '11' and '12'. + public partial class TaskIdRange + { + /// Initializes a new instance of TaskIdRange. + /// The first Task ID in the range. + /// The last Task ID in the range. + public TaskIdRange(int start, int end) + { + Start = start; + End = end; + } + + /// The first Task ID in the range. + public int Start { get; set; } + /// The last Task ID in the range. + public int End { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskInformation.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskInformation.Serialization.cs new file mode 100644 index 000000000000..ec11829e3a2a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskInformation.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskInformation + { + internal static TaskInformation DeserializeTaskInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional taskUrl = default; + Optional jobId = default; + Optional taskId = default; + Optional subtaskId = default; + TaskState taskState = default; + Optional executionInfo = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("taskUrl"u8)) + { + taskUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("taskId"u8)) + { + taskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("subtaskId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subtaskId = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("taskState"u8)) + { + taskState = property.Value.GetString().ToTaskState(); + continue; + } + if (property.NameEquals("executionInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + executionInfo = TaskExecutionInformation.DeserializeTaskExecutionInformation(property.Value); + continue; + } + } + return new TaskInformation(taskUrl.Value, jobId.Value, taskId.Value, Optional.ToNullable(subtaskId), taskState, executionInfo.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskInformation.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskInformation.cs new file mode 100644 index 000000000000..2a9ea3d2f863 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskInformation.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Information about a Task running on a Compute Node. + public partial class TaskInformation + { + /// Initializes a new instance of TaskInformation. + /// The state of the Task. + internal TaskInformation(TaskState taskState) + { + TaskState = taskState; + } + + /// Initializes a new instance of TaskInformation. + /// The URL of the Task. + /// The ID of the Job to which the Task belongs. + /// The ID of the Task. + /// The ID of the subtask if the Task is a multi-instance Task. + /// The state of the Task. + /// Information about the execution of a Task. + internal TaskInformation(string taskUrl, string jobId, string taskId, int? subtaskId, TaskState taskState, TaskExecutionInformation executionInfo) + { + TaskUrl = taskUrl; + JobId = jobId; + TaskId = taskId; + SubtaskId = subtaskId; + TaskState = taskState; + ExecutionInfo = executionInfo; + } + + /// The URL of the Task. + public string TaskUrl { get; } + /// The ID of the Job to which the Task belongs. + public string JobId { get; } + /// The ID of the Task. + public string TaskId { get; } + /// The ID of the subtask if the Task is a multi-instance Task. + public int? SubtaskId { get; } + /// The state of the Task. + public TaskState TaskState { get; } + /// Information about the execution of a Task. + public TaskExecutionInformation ExecutionInfo { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskListOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskListOptions.cs new file mode 100644 index 000000000000..cdf367021768 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskListOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class TaskListOptions + { + /// Initializes a new instance of TaskListOptions. + public TaskListOptions() + { + } + + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-tasks. + public string Filter { get; set; } + /// An OData $select clause. + public string Select { get; set; } + /// An OData $expand clause. + public string Expand { get; set; } + /// The maximum number of items to return in the response. A maximum of 1000 Tasks can be returned. + public int? MaxResults { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskListSubtasksOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskListSubtasksOptions.cs new file mode 100644 index 000000000000..280d1428ee08 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskListSubtasksOptions.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class TaskListSubtasksOptions + { + /// Initializes a new instance of TaskListSubtasksOptions. + public TaskListSubtasksOptions() + { + } + + /// An OData $select clause. + public string Select { get; set; } + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskReactivateOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskReactivateOptions.cs new file mode 100644 index 000000000000..9c06e292a742 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskReactivateOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class TaskReactivateOptions + { + /// Initializes a new instance of TaskReactivateOptions. + public TaskReactivateOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskSchedulingPolicy.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskSchedulingPolicy.Serialization.cs new file mode 100644 index 000000000000..554cc77d7f84 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskSchedulingPolicy.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskSchedulingPolicy : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("nodeFillType"u8); + writer.WriteStringValue(NodeFillType.ToSerialString()); + writer.WriteEndObject(); + } + + internal static TaskSchedulingPolicy DeserializeTaskSchedulingPolicy(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeNodeFillType nodeFillType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nodeFillType"u8)) + { + nodeFillType = property.Value.GetString().ToComputeNodeFillType(); + continue; + } + } + return new TaskSchedulingPolicy(nodeFillType); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskSchedulingPolicy.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskSchedulingPolicy.cs new file mode 100644 index 000000000000..a1eda000c23e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskSchedulingPolicy.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Specifies how Tasks should be distributed across Compute Nodes. + public partial class TaskSchedulingPolicy + { + /// Initializes a new instance of TaskSchedulingPolicy. + /// If not specified, the default is spread. + public TaskSchedulingPolicy(ComputeNodeFillType nodeFillType) + { + NodeFillType = nodeFillType; + } + + /// If not specified, the default is spread. + public ComputeNodeFillType NodeFillType { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskSlotCounts.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskSlotCounts.Serialization.cs new file mode 100644 index 000000000000..f79f9b51b282 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskSlotCounts.Serialization.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskSlotCounts + { + internal static TaskSlotCounts DeserializeTaskSlotCounts(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int active = default; + int running = default; + int completed = default; + int succeeded = default; + int failed = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("active"u8)) + { + active = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("running"u8)) + { + running = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("completed"u8)) + { + completed = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("succeeded"u8)) + { + succeeded = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("failed"u8)) + { + failed = property.Value.GetInt32(); + continue; + } + } + return new TaskSlotCounts(active, running, completed, succeeded, failed); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskSlotCounts.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskSlotCounts.cs new file mode 100644 index 000000000000..ec3632d68722 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskSlotCounts.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The TaskSlot counts for a Job. + public partial class TaskSlotCounts + { + /// Initializes a new instance of TaskSlotCounts. + /// The number of TaskSlots for active Tasks. + /// The number of TaskSlots for running Tasks. + /// The number of TaskSlots for completed Tasks. + /// The number of TaskSlots for succeeded Tasks. + /// The number of TaskSlots for failed Tasks. + internal TaskSlotCounts(int active, int running, int completed, int succeeded, int failed) + { + Active = active; + Running = running; + Completed = completed; + Succeeded = succeeded; + Failed = failed; + } + + /// The number of TaskSlots for active Tasks. + public int Active { get; } + /// The number of TaskSlots for running Tasks. + public int Running { get; } + /// The number of TaskSlots for completed Tasks. + public int Completed { get; } + /// The number of TaskSlots for succeeded Tasks. + public int Succeeded { get; } + /// The number of TaskSlots for failed Tasks. + public int Failed { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskState.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskState.Serialization.cs new file mode 100644 index 000000000000..54f7a33dacee --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskState.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class TaskStateExtensions + { + public static string ToSerialString(this TaskState value) => value switch + { + TaskState.Active => "active", + TaskState.Preparing => "preparing", + TaskState.Running => "running", + TaskState.Completed => "completed", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TaskState value.") + }; + + public static TaskState ToTaskState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "active")) return TaskState.Active; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "preparing")) return TaskState.Preparing; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "running")) return TaskState.Running; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "completed")) return TaskState.Completed; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TaskState value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskState.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskState.cs new file mode 100644 index 000000000000..fc17b3102de1 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskState.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The state of the Task. + public enum TaskState + { + /// The Task is queued and able to run, but is not currently assigned to a Compute Node. A Task enters this state when it is created, when it is enabled after being disabled, or when it is awaiting a retry after a failed run. + Active, + /// The Task has been assigned to a Compute Node, but is waiting for a required Job Preparation Task to complete on the Compute Node. If the Job Preparation Task succeeds, the Task will move to running. If the Job Preparation Task fails, the Task will return to active and will be eligible to be assigned to a different Compute Node. + Preparing, + /// The Task is running on a Compute Node. This includes task-level preparation such as downloading resource files or deploying Packages specified on the Task - it does not necessarily mean that the Task command line has started executing. + Running, + /// The Task is no longer eligible to run, usually because the Task has finished successfully, or the Task has finished unsuccessfully and has exhausted its retry limit. A Task is also marked as completed if an error occurred launching the Task, or when the Task has been terminated. + Completed + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskStatistics.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskStatistics.Serialization.cs new file mode 100644 index 000000000000..cc97284c70b6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskStatistics.Serialization.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskStatistics + { + internal static TaskStatistics DeserializeTaskStatistics(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + DateTimeOffset startTime = default; + DateTimeOffset lastUpdateTime = default; + TimeSpan userCPUTime = default; + TimeSpan kernelCPUTime = default; + TimeSpan wallClockTime = default; + long readIOps = default; + long writeIOps = default; + double readIOGiB = default; + double writeIOGiB = default; + TimeSpan waitTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdateTime"u8)) + { + lastUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("userCPUTime"u8)) + { + userCPUTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("kernelCPUTime"u8)) + { + kernelCPUTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("wallClockTime"u8)) + { + wallClockTime = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("readIOps"u8)) + { + readIOps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("writeIOps"u8)) + { + writeIOps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("readIOGiB"u8)) + { + readIOGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("writeIOGiB"u8)) + { + writeIOGiB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("waitTime"u8)) + { + waitTime = property.Value.GetTimeSpan("P"); + continue; + } + } + return new TaskStatistics(url, startTime, lastUpdateTime, userCPUTime, kernelCPUTime, wallClockTime, readIOps, writeIOps, readIOGiB, writeIOGiB, waitTime); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskStatistics.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskStatistics.cs new file mode 100644 index 000000000000..de2953ec1b9f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskStatistics.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Resource usage statistics for a Task. + public partial class TaskStatistics + { + /// Initializes a new instance of TaskStatistics. + /// The URL of the statistics. + /// The start time of the time range covered by the statistics. + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + /// The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by the Task. + /// The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by the Task. + /// The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If the Task was retried, this includes the wall clock time of all the Task retries. + /// The total number of disk read operations made by the Task. + /// The total number of disk write operations made by the Task. + /// The total gibibytes read from disk by the Task. + /// The total gibibytes written to disk by the Task. + /// The total wait time of the Task. The wait time for a Task is defined as the elapsed time between the creation of the Task and the start of Task execution. (If the Task is retried due to failures, the wait time is the time to the most recent Task execution.). + /// is null. + internal TaskStatistics(string url, DateTimeOffset startTime, DateTimeOffset lastUpdateTime, TimeSpan userCPUTime, TimeSpan kernelCPUTime, TimeSpan wallClockTime, long readIOps, long writeIOps, double readIOGiB, double writeIOGiB, TimeSpan waitTime) + { + Argument.AssertNotNull(url, nameof(url)); + + Url = url; + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + UserCPUTime = userCPUTime; + KernelCPUTime = kernelCPUTime; + WallClockTime = wallClockTime; + ReadIOps = readIOps; + WriteIOps = writeIOps; + ReadIOGiB = readIOGiB; + WriteIOGiB = writeIOGiB; + WaitTime = waitTime; + } + + /// The URL of the statistics. + public string Url { get; } + /// The start time of the time range covered by the statistics. + public DateTimeOffset StartTime { get; } + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + public DateTimeOffset LastUpdateTime { get; } + /// The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by the Task. + public TimeSpan UserCPUTime { get; } + /// The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by the Task. + public TimeSpan KernelCPUTime { get; } + /// The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If the Task was retried, this includes the wall clock time of all the Task retries. + public TimeSpan WallClockTime { get; } + /// The total number of disk read operations made by the Task. + public long ReadIOps { get; } + /// The total number of disk write operations made by the Task. + public long WriteIOps { get; } + /// The total gibibytes read from disk by the Task. + public double ReadIOGiB { get; } + /// The total gibibytes written to disk by the Task. + public double WriteIOGiB { get; } + /// The total wait time of the Task. The wait time for a Task is defined as the elapsed time between the creation of the Task and the start of Task execution. (If the Task is retried due to failures, the wait time is the time to the most recent Task execution.). + public TimeSpan WaitTime { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskTerminateOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskTerminateOptions.cs new file mode 100644 index 000000000000..15f23373856a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskTerminateOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class TaskTerminateOptions + { + /// Initializes a new instance of TaskTerminateOptions. + public TaskTerminateOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskUpdateOptions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskUpdateOptions.cs new file mode 100644 index 000000000000..86b7b70e808b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskUpdateOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Parameter group. + public partial class TaskUpdateOptions + { + /// Initializes a new instance of TaskUpdateOptions. + public TaskUpdateOptions() + { + } + + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + public int? Timeout { get; set; } + /// 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. + public Guid? ClientRequestId { get; set; } + /// Whether the server should return the client-request-id in the response. + public bool? ReturnClientRequestId { get; set; } + /// 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 DateTimeOffset? OcpDate { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client. + public string IfMatch { get; set; } + /// An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client. + public string IfNoneMatch { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time. + public DateTimeOffset? IfModifiedSince { get; set; } + /// A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time. + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskUpdateParameter.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskUpdateParameter.Serialization.cs new file mode 100644 index 000000000000..d5705e70fb5e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskUpdateParameter.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class TaskUpdateParameter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Constraints)) + { + writer.WritePropertyName("constraints"u8); + writer.WriteObjectValue(Constraints); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskUpdateParameter.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskUpdateParameter.cs new file mode 100644 index 000000000000..b26bee9f5dd7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/TaskUpdateParameter.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// The set of changes to be made to a Task. + public partial class TaskUpdateParameter + { + /// Initializes a new instance of TaskUpdateParameter. + public TaskUpdateParameter() + { + } + + /// If omitted, the Task is given the default constraints. For multi-instance Tasks, updating the retention time applies only to the primary Task and not subtasks. + public TaskConstraints Constraints { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UploadBatchServiceLogsConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UploadBatchServiceLogsConfiguration.Serialization.cs new file mode 100644 index 000000000000..128ca663a445 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UploadBatchServiceLogsConfiguration.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class UploadBatchServiceLogsConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("containerUrl"u8); + writer.WriteStringValue(ContainerUrl); + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime, "O"); + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndTime.Value, "O"); + } + if (Optional.IsDefined(IdentityReference)) + { + writer.WritePropertyName("identityReference"u8); + writer.WriteObjectValue(IdentityReference); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UploadBatchServiceLogsConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UploadBatchServiceLogsConfiguration.cs new file mode 100644 index 000000000000..e37f159b59c0 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UploadBatchServiceLogsConfiguration.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The Azure Batch service log files upload configuration for a Compute Node. + public partial class UploadBatchServiceLogsConfiguration + { + /// Initializes a new instance of UploadBatchServiceLogsConfiguration. + /// 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. + /// Any log file containing a log message in the time range will be uploaded. This means that the operation might retrieve more logs than have been requested since the entire log file is always uploaded, but the operation should not retrieve fewer logs than have been requested. + /// is null. + public UploadBatchServiceLogsConfiguration(string containerUrl, DateTimeOffset startTime) + { + Argument.AssertNotNull(containerUrl, nameof(containerUrl)); + + ContainerUrl = containerUrl; + StartTime = startTime; + } + + /// 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. + public string ContainerUrl { get; } + /// Any log file containing a log message in the time range will be uploaded. This means that the operation might retrieve more logs than have been requested since the entire log file is always uploaded, but the operation should not retrieve fewer logs than have been requested. + public DateTimeOffset StartTime { get; } + /// Any log file containing a log message in the time range will be uploaded. This means that the operation might retrieve more logs than have been requested since the entire log file is always uploaded, but the operation should not retrieve fewer logs than have been requested. If omitted, the default is to upload all logs available after the startTime. + public DateTimeOffset? EndTime { get; set; } + /// The identity must have write access to the Azure Blob Storage container. + public ComputeNodeIdentityReference IdentityReference { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UploadBatchServiceLogsResult.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UploadBatchServiceLogsResult.Serialization.cs new file mode 100644 index 000000000000..54f7b103ed37 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UploadBatchServiceLogsResult.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class UploadBatchServiceLogsResult + { + internal static UploadBatchServiceLogsResult DeserializeUploadBatchServiceLogsResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string virtualDirectoryName = default; + int numberOfFilesUploaded = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualDirectoryName"u8)) + { + virtualDirectoryName = property.Value.GetString(); + continue; + } + if (property.NameEquals("numberOfFilesUploaded"u8)) + { + numberOfFilesUploaded = property.Value.GetInt32(); + continue; + } + } + return new UploadBatchServiceLogsResult(virtualDirectoryName, numberOfFilesUploaded); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UploadBatchServiceLogsResult.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UploadBatchServiceLogsResult.cs new file mode 100644 index 000000000000..5f28661535d6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UploadBatchServiceLogsResult.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The result of uploading Batch service log files from a specific Compute Node. + public partial class UploadBatchServiceLogsResult + { + /// Initializes a new instance of UploadBatchServiceLogsResult. + /// The virtual directory name is part of the blob name for each log file uploaded, and it is built based poolId, nodeId and a unique identifier. + /// The number of log files which will be uploaded. + /// is null. + internal UploadBatchServiceLogsResult(string virtualDirectoryName, int numberOfFilesUploaded) + { + Argument.AssertNotNull(virtualDirectoryName, nameof(virtualDirectoryName)); + + VirtualDirectoryName = virtualDirectoryName; + NumberOfFilesUploaded = numberOfFilesUploaded; + } + + /// The virtual directory name is part of the blob name for each log file uploaded, and it is built based poolId, nodeId and a unique identifier. + public string VirtualDirectoryName { get; } + /// The number of log files which will be uploaded. + public int NumberOfFilesUploaded { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UsageStatistics.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UsageStatistics.Serialization.cs new file mode 100644 index 000000000000..938b7f51af1f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UsageStatistics.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class UsageStatistics + { + internal static UsageStatistics DeserializeUsageStatistics(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset startTime = default; + DateTimeOffset lastUpdateTime = default; + TimeSpan dedicatedCoreTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdateTime"u8)) + { + lastUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("dedicatedCoreTime"u8)) + { + dedicatedCoreTime = property.Value.GetTimeSpan("P"); + continue; + } + } + return new UsageStatistics(startTime, lastUpdateTime, dedicatedCoreTime); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UsageStatistics.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UsageStatistics.cs new file mode 100644 index 000000000000..cf291287db8a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UsageStatistics.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + /// Statistics related to Pool usage information. + public partial class UsageStatistics + { + /// Initializes a new instance of UsageStatistics. + /// The start time of the time range covered by the statistics. + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + /// The aggregated wall-clock time of the dedicated Compute Node cores being part of the Pool. + internal UsageStatistics(DateTimeOffset startTime, DateTimeOffset lastUpdateTime, TimeSpan dedicatedCoreTime) + { + StartTime = startTime; + LastUpdateTime = lastUpdateTime; + DedicatedCoreTime = dedicatedCoreTime; + } + + /// The start time of the time range covered by the statistics. + public DateTimeOffset StartTime { get; } + /// The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. + public DateTimeOffset LastUpdateTime { get; } + /// The aggregated wall-clock time of the dedicated Compute Node cores being part of the Pool. + public TimeSpan DedicatedCoreTime { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserAccount.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserAccount.Serialization.cs new file mode 100644 index 000000000000..b82965903ac1 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserAccount.Serialization.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class UserAccount : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + if (Optional.IsDefined(ElevationLevel)) + { + writer.WritePropertyName("elevationLevel"u8); + writer.WriteStringValue(ElevationLevel.Value.ToSerialString()); + } + if (Optional.IsDefined(LinuxUserConfiguration)) + { + writer.WritePropertyName("linuxUserConfiguration"u8); + writer.WriteObjectValue(LinuxUserConfiguration); + } + if (Optional.IsDefined(WindowsUserConfiguration)) + { + writer.WritePropertyName("windowsUserConfiguration"u8); + writer.WriteObjectValue(WindowsUserConfiguration); + } + writer.WriteEndObject(); + } + + internal static UserAccount DeserializeUserAccount(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string password = default; + Optional elevationLevel = default; + Optional linuxUserConfiguration = default; + Optional windowsUserConfiguration = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("elevationLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + elevationLevel = property.Value.GetString().ToElevationLevel(); + continue; + } + if (property.NameEquals("linuxUserConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxUserConfiguration = LinuxUserConfiguration.DeserializeLinuxUserConfiguration(property.Value); + continue; + } + if (property.NameEquals("windowsUserConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + windowsUserConfiguration = WindowsUserConfiguration.DeserializeWindowsUserConfiguration(property.Value); + continue; + } + } + return new UserAccount(name, password, Optional.ToNullable(elevationLevel), linuxUserConfiguration.Value, windowsUserConfiguration.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserAccount.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserAccount.cs new file mode 100644 index 000000000000..9050cfb8ee66 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserAccount.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// Properties used to create a user used to execute Tasks on an Azure Batch Compute Node. + public partial class UserAccount + { + /// Initializes a new instance of UserAccount. + /// The name of the user Account. Names can contain any Unicode characters up to a maximum length of 20. + /// The password for the user Account. + /// or is null. + public UserAccount(string name, string password) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(password, nameof(password)); + + Name = name; + Password = password; + } + + /// Initializes a new instance of UserAccount. + /// The name of the user Account. Names can contain any Unicode characters up to a maximum length of 20. + /// The password for the user Account. + /// The default value is nonAdmin. + /// This property is ignored if specified on a Windows Pool. If not specified, the user is created with the default options. + /// This property can only be specified if the user is on a Windows Pool. If not specified and on a Windows Pool, the user is created with the default options. + internal UserAccount(string name, string password, ElevationLevel? elevationLevel, LinuxUserConfiguration linuxUserConfiguration, WindowsUserConfiguration windowsUserConfiguration) + { + Name = name; + Password = password; + ElevationLevel = elevationLevel; + LinuxUserConfiguration = linuxUserConfiguration; + WindowsUserConfiguration = windowsUserConfiguration; + } + + /// The name of the user Account. Names can contain any Unicode characters up to a maximum length of 20. + public string Name { get; set; } + /// The password for the user Account. + public string Password { get; set; } + /// The default value is nonAdmin. + public ElevationLevel? ElevationLevel { get; set; } + /// This property is ignored if specified on a Windows Pool. If not specified, the user is created with the default options. + public LinuxUserConfiguration LinuxUserConfiguration { get; set; } + /// This property can only be specified if the user is on a Windows Pool. If not specified and on a Windows Pool, the user is created with the default options. + public WindowsUserConfiguration WindowsUserConfiguration { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserAssignedIdentity.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserAssignedIdentity.Serialization.cs new file mode 100644 index 000000000000..6082c0dee3f6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserAssignedIdentity.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class UserAssignedIdentity + { + internal static UserAssignedIdentity DeserializeUserAssignedIdentity(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string resourceId = default; + Optional clientId = default; + Optional principalId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientId"u8)) + { + clientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("principalId"u8)) + { + principalId = property.Value.GetString(); + continue; + } + } + return new UserAssignedIdentity(resourceId, clientId.Value, principalId.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserAssignedIdentity.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserAssignedIdentity.cs new file mode 100644 index 000000000000..693922583e64 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserAssignedIdentity.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The user assigned Identity. + public partial class UserAssignedIdentity + { + /// Initializes a new instance of UserAssignedIdentity. + /// The ARM resource id of the user assigned identity. + /// is null. + internal UserAssignedIdentity(string resourceId) + { + Argument.AssertNotNull(resourceId, nameof(resourceId)); + + ResourceId = resourceId; + } + + /// Initializes a new instance of UserAssignedIdentity. + /// 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. + internal UserAssignedIdentity(string resourceId, string clientId, string principalId) + { + ResourceId = resourceId; + ClientId = clientId; + PrincipalId = principalId; + } + + /// The ARM resource id of the user assigned identity. + public string ResourceId { get; } + /// The client id of the user assigned identity. + public string ClientId { get; } + /// The principal id of the user assigned identity. + public string PrincipalId { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserIdentity.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserIdentity.Serialization.cs new file mode 100644 index 000000000000..4540c8b31376 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserIdentity.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class UserIdentity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(UserName)) + { + writer.WritePropertyName("username"u8); + writer.WriteStringValue(UserName); + } + if (Optional.IsDefined(AutoUser)) + { + writer.WritePropertyName("autoUser"u8); + writer.WriteObjectValue(AutoUser); + } + writer.WriteEndObject(); + } + + internal static UserIdentity DeserializeUserIdentity(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional username = default; + Optional autoUser = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("username"u8)) + { + username = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUser"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUser = AutoUserSpecification.DeserializeAutoUserSpecification(property.Value); + continue; + } + } + return new UserIdentity(username.Value, autoUser.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserIdentity.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserIdentity.cs new file mode 100644 index 000000000000..45bd0d7f66d1 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/UserIdentity.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Specify either the userName or autoUser property, but not both. + public partial class UserIdentity + { + /// Initializes a new instance of UserIdentity. + public UserIdentity() + { + } + + /// Initializes a new instance of UserIdentity. + /// The userName and autoUser properties are mutually exclusive; you must specify one but not both. + /// The userName and autoUser properties are mutually exclusive; you must specify one but not both. + internal UserIdentity(string userName, AutoUserSpecification autoUser) + { + UserName = userName; + AutoUser = autoUser; + } + + /// The userName and autoUser properties are mutually exclusive; you must specify one but not both. + public string UserName { get; set; } + /// The userName and autoUser properties are mutually exclusive; you must specify one but not both. + public AutoUserSpecification AutoUser { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VMExtension.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VMExtension.Serialization.cs new file mode 100644 index 000000000000..a12e44570d38 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VMExtension.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class VMExtension : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + if (Optional.IsDefined(TypeHandlerVersion)) + { + writer.WritePropertyName("typeHandlerVersion"u8); + writer.WriteStringValue(TypeHandlerVersion); + } + if (Optional.IsDefined(AutoUpgradeMinorVersion)) + { + writer.WritePropertyName("autoUpgradeMinorVersion"u8); + writer.WriteBooleanValue(AutoUpgradeMinorVersion.Value); + } + if (Optional.IsDefined(EnableAutomaticUpgrade)) + { + writer.WritePropertyName("enableAutomaticUpgrade"u8); + writer.WriteBooleanValue(EnableAutomaticUpgrade.Value); + } + if (Optional.IsDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteObjectValue(Settings); + } + if (Optional.IsDefined(ProtectedSettings)) + { + writer.WritePropertyName("protectedSettings"u8); + writer.WriteObjectValue(ProtectedSettings); + } + if (Optional.IsCollectionDefined(ProvisionAfterExtensions)) + { + writer.WritePropertyName("provisionAfterExtensions"u8); + writer.WriteStartArray(); + foreach (var item in ProvisionAfterExtensions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static VMExtension DeserializeVMExtension(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string publisher = default; + string type = default; + Optional typeHandlerVersion = default; + Optional autoUpgradeMinorVersion = default; + Optional enableAutomaticUpgrade = default; + Optional settings = default; + Optional protectedSettings = default; + Optional> provisionAfterExtensions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisher"u8)) + { + publisher = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("typeHandlerVersion"u8)) + { + typeHandlerVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUpgradeMinorVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpgradeMinorVersion = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableAutomaticUpgrade"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutomaticUpgrade = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + settings = property.Value.GetObject(); + continue; + } + if (property.NameEquals("protectedSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protectedSettings = property.Value.GetObject(); + continue; + } + if (property.NameEquals("provisionAfterExtensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + provisionAfterExtensions = array; + continue; + } + } + return new VMExtension(name, publisher, type, typeHandlerVersion.Value, Optional.ToNullable(autoUpgradeMinorVersion), Optional.ToNullable(enableAutomaticUpgrade), settings.Value, protectedSettings.Value, Optional.ToList(provisionAfterExtensions)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VMExtension.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VMExtension.cs new file mode 100644 index 000000000000..8df17854add7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VMExtension.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The configuration for virtual machine extensions. + public partial class VMExtension + { + /// Initializes a new instance of VMExtension. + /// The name of the virtual machine extension. + /// The name of the extension handler publisher. + /// The type of the extension. + /// , or is null. + public VMExtension(string name, string publisher, string type) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(publisher, nameof(publisher)); + Argument.AssertNotNull(type, nameof(type)); + + Name = name; + Publisher = publisher; + Type = type; + ProvisionAfterExtensions = new ChangeTrackingList(); + } + + /// Initializes a new instance of VMExtension. + /// 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. + /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + /// JSON formatted public settings for the extension. + /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + /// Collection of extension names after which this extension needs to be provisioned. + internal VMExtension(string name, string publisher, string type, string typeHandlerVersion, bool? autoUpgradeMinorVersion, bool? enableAutomaticUpgrade, object settings, object protectedSettings, IList provisionAfterExtensions) + { + Name = name; + Publisher = publisher; + Type = type; + TypeHandlerVersion = typeHandlerVersion; + AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + EnableAutomaticUpgrade = enableAutomaticUpgrade; + Settings = settings; + ProtectedSettings = protectedSettings; + ProvisionAfterExtensions = provisionAfterExtensions; + } + + /// The name of the virtual machine extension. + public string Name { get; set; } + /// The name of the extension handler publisher. + public string Publisher { get; set; } + /// The type of the extension. + public string Type { get; set; } + /// The version of script handler. + public string TypeHandlerVersion { get; set; } + /// 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; set; } + /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + public bool? EnableAutomaticUpgrade { get; set; } + /// JSON formatted public settings for the extension. + public object Settings { get; set; } + /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + public object ProtectedSettings { get; set; } + /// Collection of extension names after which this extension needs to be provisioned. + public IList ProvisionAfterExtensions { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VMExtensionInstanceView.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VMExtensionInstanceView.Serialization.cs new file mode 100644 index 000000000000..2f2ace91fd8d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VMExtensionInstanceView.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class VMExtensionInstanceView + { + internal static VMExtensionInstanceView DeserializeVMExtensionInstanceView(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional> statuses = default; + Optional> subStatuses = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("statuses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InstanceViewStatus.DeserializeInstanceViewStatus(item)); + } + statuses = array; + continue; + } + if (property.NameEquals("subStatuses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InstanceViewStatus.DeserializeInstanceViewStatus(item)); + } + subStatuses = array; + continue; + } + } + return new VMExtensionInstanceView(name.Value, Optional.ToList(statuses), Optional.ToList(subStatuses)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VMExtensionInstanceView.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VMExtensionInstanceView.cs new file mode 100644 index 000000000000..ad332ef802f3 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VMExtensionInstanceView.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The vm extension instance view. + public partial class VMExtensionInstanceView + { + /// Initializes a new instance of VMExtensionInstanceView. + internal VMExtensionInstanceView() + { + Statuses = new ChangeTrackingList(); + SubStatuses = new ChangeTrackingList(); + } + + /// Initializes a new instance of VMExtensionInstanceView. + /// The name of the vm extension instance view. + /// The resource status information. + /// The resource status information. + internal VMExtensionInstanceView(string name, IReadOnlyList statuses, IReadOnlyList subStatuses) + { + Name = name; + Statuses = statuses; + SubStatuses = subStatuses; + } + + /// The name of the vm extension instance view. + public string Name { get; } + /// The resource status information. + public IReadOnlyList Statuses { get; } + /// The resource status information. + public IReadOnlyList SubStatuses { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VerificationType.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VerificationType.Serialization.cs new file mode 100644 index 000000000000..64fccf42d374 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VerificationType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Temp.Batch.Models +{ + internal static partial class VerificationTypeExtensions + { + public static string ToSerialString(this VerificationType value) => value switch + { + VerificationType.Verified => "verified", + VerificationType.Unverified => "unverified", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown VerificationType value.") + }; + + public static VerificationType ToVerificationType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "verified")) return VerificationType.Verified; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "unverified")) return VerificationType.Unverified; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown VerificationType value."); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VerificationType.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VerificationType.cs new file mode 100644 index 000000000000..d93ed597ab57 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VerificationType.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Whether the Azure Batch service actively verifies that the Image is compatible with the associated Compute Node agent SKU. + public enum VerificationType + { + /// The Image is guaranteed to be compatible with the associated Compute Node agent SKU and all Batch features have been confirmed to work as expected. + Verified, + /// The associated Compute Node agent SKU should have binary compatibility with the Image, but specific functionality has not been verified. + Unverified + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VirtualMachineConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VirtualMachineConfiguration.Serialization.cs new file mode 100644 index 000000000000..39f4a64ceadf --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VirtualMachineConfiguration.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class VirtualMachineConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("imageReference"u8); + writer.WriteObjectValue(ImageReference); + writer.WritePropertyName("nodeAgentSKUId"u8); + writer.WriteStringValue(NodeAgentSKUId); + if (Optional.IsDefined(WindowsConfiguration)) + { + writer.WritePropertyName("windowsConfiguration"u8); + writer.WriteObjectValue(WindowsConfiguration); + } + if (Optional.IsCollectionDefined(DataDisks)) + { + writer.WritePropertyName("dataDisks"u8); + writer.WriteStartArray(); + foreach (var item in DataDisks) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(LicenseType)) + { + writer.WritePropertyName("licenseType"u8); + writer.WriteStringValue(LicenseType); + } + if (Optional.IsDefined(ContainerConfiguration)) + { + writer.WritePropertyName("containerConfiguration"u8); + writer.WriteObjectValue(ContainerConfiguration); + } + if (Optional.IsDefined(DiskEncryptionConfiguration)) + { + writer.WritePropertyName("diskEncryptionConfiguration"u8); + writer.WriteObjectValue(DiskEncryptionConfiguration); + } + if (Optional.IsDefined(NodePlacementConfiguration)) + { + writer.WritePropertyName("nodePlacementConfiguration"u8); + writer.WriteObjectValue(NodePlacementConfiguration); + } + if (Optional.IsCollectionDefined(Extensions)) + { + writer.WritePropertyName("extensions"u8); + writer.WriteStartArray(); + foreach (var item in Extensions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(OsDisk)) + { + writer.WritePropertyName("osDisk"u8); + writer.WriteObjectValue(OsDisk); + } + writer.WriteEndObject(); + } + + internal static VirtualMachineConfiguration DeserializeVirtualMachineConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ImageReference imageReference = default; + string nodeAgentSKUId = default; + Optional windowsConfiguration = default; + Optional> dataDisks = default; + Optional licenseType = default; + Optional containerConfiguration = default; + Optional diskEncryptionConfiguration = default; + Optional nodePlacementConfiguration = default; + Optional> extensions = default; + Optional osDisk = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("imageReference"u8)) + { + imageReference = ImageReference.DeserializeImageReference(property.Value); + continue; + } + if (property.NameEquals("nodeAgentSKUId"u8)) + { + nodeAgentSKUId = property.Value.GetString(); + continue; + } + if (property.NameEquals("windowsConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + windowsConfiguration = WindowsConfiguration.DeserializeWindowsConfiguration(property.Value); + continue; + } + if (property.NameEquals("dataDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataDisk.DeserializeDataDisk(item)); + } + dataDisks = array; + continue; + } + if (property.NameEquals("licenseType"u8)) + { + licenseType = property.Value.GetString(); + continue; + } + if (property.NameEquals("containerConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerConfiguration = ContainerConfiguration.DeserializeContainerConfiguration(property.Value); + continue; + } + if (property.NameEquals("diskEncryptionConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskEncryptionConfiguration = DiskEncryptionConfiguration.DeserializeDiskEncryptionConfiguration(property.Value); + continue; + } + if (property.NameEquals("nodePlacementConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodePlacementConfiguration = NodePlacementConfiguration.DeserializeNodePlacementConfiguration(property.Value); + continue; + } + if (property.NameEquals("extensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMExtension.DeserializeVMExtension(item)); + } + extensions = array; + continue; + } + if (property.NameEquals("osDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osDisk = OSDisk.DeserializeOSDisk(property.Value); + continue; + } + } + return new VirtualMachineConfiguration(imageReference, nodeAgentSKUId, windowsConfiguration.Value, Optional.ToList(dataDisks), licenseType.Value, containerConfiguration.Value, diskEncryptionConfiguration.Value, nodePlacementConfiguration.Value, Optional.ToList(extensions), osDisk.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VirtualMachineConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VirtualMachineConfiguration.cs new file mode 100644 index 000000000000..d988d46d87bb --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VirtualMachineConfiguration.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + /// The configuration for Compute Nodes in a Pool based on the Azure Virtual Machines infrastructure. + public partial class VirtualMachineConfiguration + { + /// Initializes a new instance of VirtualMachineConfiguration. + /// 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. + /// The Batch Compute Node agent is a program that runs on each Compute Node in the Pool, and provides the command-and-control interface between the Compute Node and the Batch service. There are different implementations of the Compute Node agent, known as SKUs, for different operating systems. You must specify a Compute Node agent SKU which matches the selected Image reference. To get the list of supported Compute Node agent SKUs along with their list of verified Image references, see the 'List supported Compute Node agent SKUs' operation. + /// or is null. + public VirtualMachineConfiguration(ImageReference imageReference, string nodeAgentSKUId) + { + Argument.AssertNotNull(imageReference, nameof(imageReference)); + Argument.AssertNotNull(nodeAgentSKUId, nameof(nodeAgentSKUId)); + + ImageReference = imageReference; + NodeAgentSKUId = nodeAgentSKUId; + DataDisks = new ChangeTrackingList(); + Extensions = new ChangeTrackingList(); + } + + /// Initializes a new instance of VirtualMachineConfiguration. + /// 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. + /// The Batch Compute Node agent is a program that runs on each Compute Node in the Pool, and provides the command-and-control interface between the Compute Node and the Batch service. There are different implementations of the Compute Node agent, known as SKUs, for different operating systems. You must specify a Compute Node agent SKU which matches the selected Image reference. To get the list of supported Compute Node agent SKUs along with their list of verified Image references, see the 'List supported Compute Node agent SKUs' operation. + /// This property must not be specified if the imageReference property specifies a Linux OS Image. + /// 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. Each Compute Node gets its own disk (the disk is not a file share). Existing disks cannot be attached, each attached disk is empty. When the Compute Node is removed from the Pool, the disk and all data associated with it is also deleted. The disk is not formatted after being attached, it must be formatted before use - for more information see https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/attach-disk#initialize-a-new-data-disk-in-linux and https://docs.microsoft.com/en-us/azure/virtual-machines/windows/attach-disk-ps#add-an-empty-data-disk-to-a-virtual-machine. + /// + /// 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 Compute 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. + /// + /// + /// If specified, setup is performed on each Compute Node in the Pool to allow Tasks to run in containers. All regular Tasks and Job manager Tasks run on this Pool must specify the containerSettings property, and all other Tasks may specify it. + /// If specified, encryption is performed on each node in the pool during node provisioning. + /// This configuration will specify rules on how nodes in the pool will be physically allocated. + /// If specified, the extensions mentioned in this configuration will be installed on each node. + /// Settings for the operating system disk of the compute node (VM). + internal VirtualMachineConfiguration(ImageReference imageReference, string nodeAgentSKUId, WindowsConfiguration windowsConfiguration, IList dataDisks, string licenseType, ContainerConfiguration containerConfiguration, DiskEncryptionConfiguration diskEncryptionConfiguration, NodePlacementConfiguration nodePlacementConfiguration, IList extensions, OSDisk osDisk) + { + ImageReference = imageReference; + NodeAgentSKUId = nodeAgentSKUId; + WindowsConfiguration = windowsConfiguration; + DataDisks = dataDisks; + LicenseType = licenseType; + ContainerConfiguration = containerConfiguration; + DiskEncryptionConfiguration = diskEncryptionConfiguration; + NodePlacementConfiguration = nodePlacementConfiguration; + Extensions = extensions; + OsDisk = osDisk; + } + + /// 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 ImageReference ImageReference { get; set; } + /// The Batch Compute Node agent is a program that runs on each Compute Node in the Pool, and provides the command-and-control interface between the Compute Node and the Batch service. There are different implementations of the Compute Node agent, known as SKUs, for different operating systems. You must specify a Compute Node agent SKU which matches the selected Image reference. To get the list of supported Compute Node agent SKUs along with their list of verified Image references, see the 'List supported Compute Node agent SKUs' operation. + public string NodeAgentSKUId { get; set; } + /// This property must not be specified if the imageReference property specifies a Linux OS Image. + public WindowsConfiguration WindowsConfiguration { get; set; } + /// 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. Each Compute Node gets its own disk (the disk is not a file share). Existing disks cannot be attached, each attached disk is empty. When the Compute Node is removed from the Pool, the disk and all data associated with it is also deleted. The disk is not formatted after being attached, it must be formatted before use - for more information see https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/attach-disk#initialize-a-new-data-disk-in-linux and https://docs.microsoft.com/en-us/azure/virtual-machines/windows/attach-disk-ps#add-an-empty-data-disk-to-a-virtual-machine. + public IList DataDisks { get; } + /// + /// 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 Compute 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. + /// + /// + public string LicenseType { get; set; } + /// If specified, setup is performed on each Compute Node in the Pool to allow Tasks to run in containers. All regular Tasks and Job manager Tasks run on this Pool must specify the containerSettings property, and all other Tasks may specify it. + public ContainerConfiguration ContainerConfiguration { get; set; } + /// If specified, encryption is performed on each node in the pool during node provisioning. + public DiskEncryptionConfiguration DiskEncryptionConfiguration { get; set; } + /// This configuration will specify rules on how nodes in the pool will be physically allocated. + public NodePlacementConfiguration NodePlacementConfiguration { get; set; } + /// If specified, the extensions mentioned in this configuration will be installed on each node. + public IList Extensions { get; } + /// Settings for the operating system disk of the compute node (VM). + public OSDisk OsDisk { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VirtualMachineInfo.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VirtualMachineInfo.Serialization.cs new file mode 100644 index 000000000000..09ae63fc744a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VirtualMachineInfo.Serialization.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class VirtualMachineInfo + { + internal static VirtualMachineInfo DeserializeVirtualMachineInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional imageReference = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("imageReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + imageReference = ImageReference.DeserializeImageReference(property.Value); + continue; + } + } + return new VirtualMachineInfo(imageReference.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VirtualMachineInfo.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VirtualMachineInfo.cs new file mode 100644 index 000000000000..028b56048432 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/VirtualMachineInfo.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Info about the current state of the virtual machine. + public partial class VirtualMachineInfo + { + /// Initializes a new instance of VirtualMachineInfo. + internal VirtualMachineInfo() + { + } + + /// Initializes a new instance of VirtualMachineInfo. + /// 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. + internal VirtualMachineInfo(ImageReference imageReference) + { + ImageReference = imageReference; + } + + /// 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 ImageReference ImageReference { get; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/WindowsConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/WindowsConfiguration.Serialization.cs new file mode 100644 index 000000000000..86988df0ccc6 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/WindowsConfiguration.Serialization.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class WindowsConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(EnableAutomaticUpdates)) + { + writer.WritePropertyName("enableAutomaticUpdates"u8); + writer.WriteBooleanValue(EnableAutomaticUpdates.Value); + } + writer.WriteEndObject(); + } + + internal static WindowsConfiguration DeserializeWindowsConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional enableAutomaticUpdates = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enableAutomaticUpdates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutomaticUpdates = property.Value.GetBoolean(); + continue; + } + } + return new WindowsConfiguration(Optional.ToNullable(enableAutomaticUpdates)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/WindowsConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/WindowsConfiguration.cs new file mode 100644 index 000000000000..4ca47bd4128f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/WindowsConfiguration.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Windows operating system settings to apply to the virtual machine. + public partial class WindowsConfiguration + { + /// Initializes a new instance of WindowsConfiguration. + public WindowsConfiguration() + { + } + + /// Initializes a new instance of WindowsConfiguration. + /// If omitted, the default value is true. + internal WindowsConfiguration(bool? enableAutomaticUpdates) + { + EnableAutomaticUpdates = enableAutomaticUpdates; + } + + /// If omitted, the default value is true. + public bool? EnableAutomaticUpdates { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/WindowsUserConfiguration.Serialization.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/WindowsUserConfiguration.Serialization.cs new file mode 100644 index 000000000000..3e624d90961d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/WindowsUserConfiguration.Serialization.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Temp.Batch.Models +{ + public partial class WindowsUserConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(LoginMode)) + { + writer.WritePropertyName("loginMode"u8); + writer.WriteStringValue(LoginMode.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + internal static WindowsUserConfiguration DeserializeWindowsUserConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional loginMode = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("loginMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loginMode = property.Value.GetString().ToLoginMode(); + continue; + } + } + return new WindowsUserConfiguration(Optional.ToNullable(loginMode)); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/Models/WindowsUserConfiguration.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/WindowsUserConfiguration.cs new file mode 100644 index 000000000000..a72207071454 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/Models/WindowsUserConfiguration.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Temp.Batch.Models +{ + /// Properties used to create a user Account on a Windows Compute Node. + public partial class WindowsUserConfiguration + { + /// Initializes a new instance of WindowsUserConfiguration. + public WindowsUserConfiguration() + { + } + + /// Initializes a new instance of WindowsUserConfiguration. + /// The default value for VirtualMachineConfiguration Pools is 'batch' and for CloudServiceConfiguration Pools is 'interactive'. + internal WindowsUserConfiguration(LoginMode? loginMode) + { + LoginMode = loginMode; + } + + /// The default value for VirtualMachineConfiguration Pools is 'batch' and for CloudServiceConfiguration Pools is 'interactive'. + public LoginMode? LoginMode { get; set; } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/PoolClient.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/PoolClient.cs new file mode 100644 index 000000000000..7cafc7af7f48 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/PoolClient.cs @@ -0,0 +1,1591 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Temp.Batch +{ + // Data plane generated client. + /// The Pool service client. + public partial class PoolClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://batch.core.windows.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly string _batchUrl; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of PoolClient for mocking. + protected PoolClient() + { + } + + /// Initializes a new instance of PoolClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public PoolClient(string batchUrl, TokenCredential credential) : this(batchUrl, credential, new BatchServiceClientOptions()) + { + } + + /// Initializes a new instance of PoolClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public PoolClient(string batchUrl, TokenCredential credential, BatchServiceClientOptions options) + { + Argument.AssertNotNull(batchUrl, nameof(batchUrl)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new BatchServiceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _batchUrl = batchUrl; + _apiVersion = options.Version; + } + + /// + /// [Protocol Method] Adds a Pool to the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AddAsync(RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.Add"); + scope.Start(); + try + { + using HttpMessage message = CreateAddRequest(content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds a Pool to the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Add(RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.Add"); + scope.Start(); + try + { + using HttpMessage message = CreateAddRequest(content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a Pool from the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool to delete. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string poolId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(poolId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a Pool from the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool to delete. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string poolId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(poolId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets basic properties of a Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool to get. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ExistsAsync(string poolId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.Exists"); + scope.Start(); + try + { + using HttpMessage message = CreateExistsRequest(poolId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets basic properties of a Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool to get. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Exists(string poolId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.Exists"); + scope.Start(); + try + { + using HttpMessage message = CreateExistsRequest(poolId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool to get. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetPoolAsync(string poolId, string select, string expand, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.GetPool"); + scope.Start(); + try + { + using HttpMessage message = CreateGetPoolRequest(poolId, select, expand, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool to get. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetPool(string poolId, string select, string expand, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.GetPool"); + scope.Start(); + try + { + using HttpMessage message = CreateGetPoolRequest(poolId, select, expand, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task PatchAsync(string poolId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.Patch"); + scope.Start(); + try + { + using HttpMessage message = CreatePatchRequest(poolId, content, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Patch(string poolId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.Patch"); + scope.Start(); + try + { + using HttpMessage message = CreatePatchRequest(poolId, content, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Disables automatic scaling for a Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool on which to disable automatic scaling. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DisableAutoScaleAsync(string poolId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.DisableAutoScale"); + scope.Start(); + try + { + using HttpMessage message = CreateDisableAutoScaleRequest(poolId, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Disables automatic scaling for a Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool on which to disable automatic scaling. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DisableAutoScale(string poolId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.DisableAutoScale"); + scope.Start(); + try + { + using HttpMessage message = CreateDisableAutoScaleRequest(poolId, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Enables automatic scaling for a Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool on which to enable automatic scaling. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task EnableAutoScaleAsync(string poolId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.EnableAutoScale"); + scope.Start(); + try + { + using HttpMessage message = CreateEnableAutoScaleRequest(poolId, content, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Enables automatic scaling for a Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool on which to enable automatic scaling. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response EnableAutoScale(string poolId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.EnableAutoScale"); + scope.Start(); + try + { + using HttpMessage message = CreateEnableAutoScaleRequest(poolId, content, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the result of evaluating an automatic scaling formula on the Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool on which to evaluate the automatic scaling formula. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task EvaluateAutoScaleAsync(string poolId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.EvaluateAutoScale"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateAutoScaleRequest(poolId, content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the result of evaluating an automatic scaling formula on the Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool on which to evaluate the automatic scaling formula. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response EvaluateAutoScale(string poolId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.EvaluateAutoScale"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateAutoScaleRequest(poolId, content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Changes the number of Compute Nodes that are assigned to a Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool to resize. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ResizeAsync(string poolId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.Resize"); + scope.Start(); + try + { + using HttpMessage message = CreateResizeRequest(poolId, content, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Changes the number of Compute Nodes that are assigned to a Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool to resize. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Resize(string poolId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.Resize"); + scope.Start(); + try + { + using HttpMessage message = CreateResizeRequest(poolId, content, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Stops an ongoing resize operation on the Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool whose resizing you want to stop. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task StopResizeAsync(string poolId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.StopResize"); + scope.Start(); + try + { + using HttpMessage message = CreateStopResizeRequest(poolId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Stops an ongoing resize operation on the Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool whose resizing you want to stop. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response StopResize(string poolId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.StopResize"); + scope.Start(); + try + { + using HttpMessage message = CreateStopResizeRequest(poolId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task UpdatePropertiesAsync(string poolId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.UpdateProperties"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdatePropertiesRequest(poolId, content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response UpdateProperties(string poolId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.UpdateProperties"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdatePropertiesRequest(poolId, content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Removes Compute Nodes from the specified Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool from which you want to remove Compute Nodes. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task RemoveNodesAsync(string poolId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.RemoveNodes"); + scope.Start(); + try + { + using HttpMessage message = CreateRemoveNodesRequest(poolId, content, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Removes Compute Nodes from the specified Pool. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool from which you want to remove Compute Nodes. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response RemoveNodes(string poolId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PoolClient.RemoveNodes"); + scope.Start(); + try + { + using HttpMessage message = CreateRemoveNodesRequest(poolId, content, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists the usage metrics, aggregated by Pool across individual time intervals, for the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The earliest time from which to include metrics. This must be at least two and a half hours before the current time. If not specified this defaults to the start time of the last aggregation interval currently available. + /// The latest time from which to include metrics. This must be at least two hours before the current time. If not specified this defaults to the end time of the last aggregation interval currently available. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. + /// The maximum number of items to return in the response. A maximum of 1000 results will be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetUsageMetricsAsync(DateTimeOffset? startTime, DateTimeOffset? endTime, string filter, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetUsageMetricsRequest(startTime, endTime, filter, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetUsageMetricsNextPageRequest(nextLink, startTime, endTime, filter, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PoolClient.GetUsageMetrics", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists the usage metrics, aggregated by Pool across individual time intervals, for the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The earliest time from which to include metrics. This must be at least two and a half hours before the current time. If not specified this defaults to the start time of the last aggregation interval currently available. + /// The latest time from which to include metrics. This must be at least two hours before the current time. If not specified this defaults to the end time of the last aggregation interval currently available. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. + /// The maximum number of items to return in the response. A maximum of 1000 results will be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetUsageMetrics(DateTimeOffset? startTime, DateTimeOffset? endTime, string filter, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetUsageMetricsRequest(startTime, endTime, filter, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetUsageMetricsNextPageRequest(nextLink, startTime, endTime, filter, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PoolClient.GetUsageMetrics", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists all of the Pools in the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum number of items to return in the response. A maximum of 1000 Pools can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetPoolsAsync(string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetPoolsRequest(filter, select, expand, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetPoolsNextPageRequest(nextLink, filter, select, expand, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PoolClient.GetPools", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists all of the Pools in the specified Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum number of items to return in the response. A maximum of 1000 Pools can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetPools(string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetPoolsRequest(filter, select, expand, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetPoolsNextPageRequest(nextLink, filter, select, expand, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PoolClient.GetPools", "value", "odata.nextLink", context); + } + + internal HttpMessage CreateGetUsageMetricsRequest(DateTimeOffset? startTime, DateTimeOffset? endTime, string filter, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/poolusagemetrics", false); + if (startTime != null) + { + uri.AppendQuery("starttime", startTime.Value, "O", true); + } + if (endTime != null) + { + uri.AppendQuery("endtime", endTime.Value, "O", true); + } + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateAddRequest(RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetPoolsRequest(string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateDeleteRequest(string poolId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateExistsRequest(string poolId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200404); + var request = message.Request; + request.Method = RequestMethod.Head; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateGetPoolRequest(string poolId, string select, string expand, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreatePatchRequest(string poolId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDisableAutoScaleRequest(string poolId, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/disableautoscale", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateEnableAutoScaleRequest(string poolId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/enableautoscale", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateEvaluateAutoScaleRequest(string poolId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/evaluateautoscale", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateResizeRequest(string poolId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/resize", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateStopResizeRequest(string poolId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/stopresize", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateUpdatePropertiesRequest(string poolId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/updateproperties", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateRemoveNodesRequest(string poolId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/removenodes", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetUsageMetricsNextPageRequest(string nextLink, DateTimeOffset? startTime, DateTimeOffset? endTime, string filter, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateGetPoolsNextPageRequest(string nextLink, string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + private static ResponseClassifier _responseClassifier200404; + private static ResponseClassifier ResponseClassifier200404 => _responseClassifier200404 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 404 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/TaskClient.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/TaskClient.cs new file mode 100644 index 000000000000..5d4ed7f5159e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/TaskClient.cs @@ -0,0 +1,1095 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Temp.Batch +{ + // Data plane generated client. + /// The Task service client. + public partial class TaskClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://batch.core.windows.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly string _batchUrl; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of TaskClient for mocking. + protected TaskClient() + { + } + + /// Initializes a new instance of TaskClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public TaskClient(string batchUrl, TokenCredential credential) : this(batchUrl, credential, new BatchServiceClientOptions()) + { + } + + /// Initializes a new instance of TaskClient. + /// The base URL for all Azure Batch service requests. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public TaskClient(string batchUrl, TokenCredential credential, BatchServiceClientOptions options) + { + Argument.AssertNotNull(batchUrl, nameof(batchUrl)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new BatchServiceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _batchUrl = batchUrl; + _apiVersion = options.Version; + } + + /// + /// [Protocol Method] Adds a Task to the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job to which the Task is to be added. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AddAsync(string jobId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.Add"); + scope.Start(); + try + { + using HttpMessage message = CreateAddRequest(jobId, content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds a Task to the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job to which the Task is to be added. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Add(string jobId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.Add"); + scope.Start(); + try + { + using HttpMessage message = CreateAddRequest(jobId, content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds a collection of Tasks to the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job to which the Task collection is to be added. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AddCollectionAsync(string jobId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.AddCollection"); + scope.Start(); + try + { + using HttpMessage message = CreateAddCollectionRequest(jobId, content, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds a collection of Tasks to the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job to which the Task collection is to be added. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response AddCollection(string jobId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.AddCollection"); + scope.Start(); + try + { + using HttpMessage message = CreateAddCollectionRequest(jobId, content, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a Task from the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job from which to delete the Task. + /// The ID of the Task to delete. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string jobId, string taskId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(jobId, taskId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a Task from the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job from which to delete the Task. + /// The ID of the Task to delete. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string jobId, string taskId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(jobId, taskId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Task. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job that contains the Task. + /// The ID of the Task to get information about. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTaskAsync(string jobId, string taskId, string select, string expand, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.GetTask"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTaskRequest(jobId, taskId, select, expand, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets information about the specified Task. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job that contains the Task. + /// The ID of the Task to get information about. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTask(string jobId, string taskId, string select, string expand, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.GetTask"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTaskRequest(jobId, taskId, select, expand, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Task. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job containing the Task. + /// The ID of the Task to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task UpdateAsync(string jobId, string taskId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.Update"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateRequest(jobId, taskId, content, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Updates the properties of the specified Task. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job containing the Task. + /// The ID of the Task to update. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Update(string jobId, string taskId, RequestContent content, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.Update"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateRequest(jobId, taskId, content, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists all of the subtasks that are associated with the specified multi-instance Task. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job. + /// The ID of the Task. + /// An OData $select clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetSubtasksAsync(string jobId, string taskId, string select, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.GetSubtasks"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSubtasksRequest(jobId, taskId, select, timeout, ocpDate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists all of the subtasks that are associated with the specified multi-instance Task. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job. + /// The ID of the Task. + /// An OData $select clause. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetSubtasks(string jobId, string taskId, string select, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.GetSubtasks"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSubtasksRequest(jobId, taskId, select, timeout, ocpDate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Terminates the specified Task. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job containing the Task. + /// The ID of the Task to terminate. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task TerminateAsync(string jobId, string taskId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.Terminate"); + scope.Start(); + try + { + using HttpMessage message = CreateTerminateRequest(jobId, taskId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Terminates the specified Task. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job containing the Task. + /// The ID of the Task to terminate. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Terminate(string jobId, string taskId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.Terminate"); + scope.Start(); + try + { + using HttpMessage message = CreateTerminateRequest(jobId, taskId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Reactivates a Task, allowing it to run again even if its retry count has been exhausted. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job containing the Task. + /// The ID of the Task to reactivate. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ReactivateAsync(string jobId, string taskId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.Reactivate"); + scope.Start(); + try + { + using HttpMessage message = CreateReactivateRequest(jobId, taskId, timeout, ocpDate, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Reactivates a Task, allowing it to run again even if its retry count has been exhausted. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job containing the Task. + /// The ID of the Task to reactivate. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Reactivate(string jobId, string taskId, int? timeout = null, DateTimeOffset? ocpDate = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("TaskClient.Reactivate"); + scope.Start(); + try + { + using HttpMessage message = CreateReactivateRequest(jobId, taskId, timeout, ocpDate, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists all of the Tasks that are associated with the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-tasks. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum number of items to return in the response. A maximum of 1000 Tasks can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetTasksAsync(string jobId, string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTasksRequest(jobId, filter, select, expand, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTasksNextPageRequest(nextLink, jobId, filter, select, expand, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TaskClient.GetTasks", "value", "odata.nextLink", context); + } + + /// + /// [Protocol Method] Lists all of the Tasks that are associated with the specified Job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Job. + /// An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-tasks. + /// An OData $select clause. + /// An OData $expand clause. + /// The maximum number of items to return in the response. A maximum of 1000 Tasks can be returned. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. + /// 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. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetTasks(string jobId, string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTasksRequest(jobId, filter, select, expand, maxResults, timeout, ocpDate, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTasksNextPageRequest(nextLink, jobId, filter, select, expand, maxResults, timeout, ocpDate, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TaskClient.GetTasks", "value", "odata.nextLink", context); + } + + internal HttpMessage CreateAddRequest(string jobId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/tasks", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetTasksRequest(string jobId, string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/tasks", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + if (maxResults != null) + { + uri.AppendQuery("maxresults", maxResults.Value, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateAddCollectionRequest(string jobId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/addtaskcollection", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(string jobId, string taskId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateGetTaskRequest(string jobId, string taskId, string select, string expand, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateUpdateRequest(string jobId, string taskId, RequestContent content, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetSubtasksRequest(string jobId, string taskId, string select, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + uri.AppendPath("/subtasksinfo", false); + if (select != null) + { + uri.AppendQuery("$select", select, true); + } + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateTerminateRequest(string jobId, string taskId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + uri.AppendPath("/terminate", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateReactivateRequest(string jobId, string taskId, int? timeout, DateTimeOffset? ocpDate, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + uri.AppendPath("/reactivate", false); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateGetTasksNextPageRequest(string nextLink, string jobId, string filter, string select, string expand, int? maxResults, int? timeout, DateTimeOffset? ocpDate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_batchUrl, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpDate != null) + { + request.Headers.Add("ocp-date", ocpDate.Value, "R"); + } + return message; + } + + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/Generated/TempBatchClientBuilderExtensions.cs b/sdk/batch/Azure.Temp.Batch/src/Generated/TempBatchClientBuilderExtensions.cs new file mode 100644 index 000000000000..b1339bed4c14 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/Generated/TempBatchClientBuilderExtensions.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Extensions; +using Azure.Temp.Batch; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add , , , , , , , , , to client builder. + public static partial class TempBatchClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// The base URL for all Azure Batch service requests. + public static IAzureClientBuilder AddApplicationClient(this TBuilder builder, string batchUrl) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new ApplicationClient(batchUrl, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The base URL for all Azure Batch service requests. + public static IAzureClientBuilder AddPoolClient(this TBuilder builder, string batchUrl) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new PoolClient(batchUrl, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The base URL for all Azure Batch service requests. + public static IAzureClientBuilder AddAccountClient(this TBuilder builder, string batchUrl) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new AccountClient(batchUrl, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The base URL for all Azure Batch service requests. + public static IAzureClientBuilder AddCertificateClient(this TBuilder builder, string batchUrl) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new CertificateClient(batchUrl, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The base URL for all Azure Batch service requests. + public static IAzureClientBuilder AddFileClient(this TBuilder builder, string batchUrl) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new FileClient(batchUrl, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The base URL for all Azure Batch service requests. + public static IAzureClientBuilder AddJobScheduleClient(this TBuilder builder, string batchUrl) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new JobScheduleClient(batchUrl, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The base URL for all Azure Batch service requests. + public static IAzureClientBuilder AddJobClient(this TBuilder builder, string batchUrl) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new JobClient(batchUrl, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The base URL for all Azure Batch service requests. + public static IAzureClientBuilder AddTaskClient(this TBuilder builder, string batchUrl) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new TaskClient(batchUrl, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The base URL for all Azure Batch service requests. + public static IAzureClientBuilder AddComputeNodeClient(this TBuilder builder, string batchUrl) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new ComputeNodeClient(batchUrl, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The base URL for all Azure Batch service requests. + public static IAzureClientBuilder AddComputeNodeExtensionClient(this TBuilder builder, string batchUrl) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new ComputeNodeExtensionClient(batchUrl, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddApplicationClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddPoolClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddAccountClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddCertificateClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddFileClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddJobScheduleClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddJobClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddTaskClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddComputeNodeClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddComputeNodeExtensionClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/src/GlobalSuppressions.cs b/sdk/batch/Azure.Temp.Batch/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..7b9613ef4fff --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/GlobalSuppressions.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0001: Namespace 'Azure.Temp.Batch.Models' shouldn't contain public types. Use one of the following pre-approved namespace groups (https://azure.github.io/azure-sdk/registered_namespaces.html): Azure.AI, Azure.Analytics, Azure.Communication, Azure.Containers, Azure.Core.Expressions, Azure.Data, Azure.DigitalTwins, Azure.Identity, Azure.IoT, Azure.Learn, Azure.Management, Azure.Media, Azure.Messaging, Azure.MixedReality, Azure.Monitor, Azure.ResourceManager, Azure.Search, Azure.Security, Azure.Storage, Azure.Template, Microsoft.Extensions.Azure", Justification = "")] +[assembly: SuppressMessage("Usage", "AZC0012: Single word class names are too generic and have high chance of collision with BCL types or types from other libraries", Justification = "")] diff --git a/sdk/batch/Azure.Temp.Batch/src/autorest.md b/sdk/batch/Azure.Temp.Batch/src/autorest.md new file mode 100644 index 000000000000..6297084e1182 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/autorest.md @@ -0,0 +1,14 @@ +# Azure SDK Code Generation for Data Plane + +Run `dotnet build /t:GenerateCode` to generate code. + +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +input-file: +- https://github.com/Azure/azure-rest-api-specs/blob/b407b6c6e11d2b9d543408a1cce9050c95ac74de/specification/batch/data-plane/Microsoft.Batch/stable/2023-05-01.17.0/BatchService.json +namespace: Azure.Temp.Batch +security: AADToken +security-scopes: https://batch.core.windows.net/.default +``` diff --git a/sdk/batch/Azure.Temp.Batch/src/properties/AssemblyInfo.cs b/sdk/batch/Azure.Temp.Batch/src/properties/AssemblyInfo.cs new file mode 100644 index 000000000000..9b5ade43f66d --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/src/properties/AssemblyInfo.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +// Replace with test project/test project public key and uncomment to make internal members visible to +// your test project. If not needed, this can be deleted. +// [assembly: InternalsVisibleTo("Azure.Template.Generated.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/batch/Azure.Temp.Batch/stress/README.md b/sdk/batch/Azure.Temp.Batch/stress/README.md new file mode 100644 index 000000000000..f29fddf0794e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/stress/README.md @@ -0,0 +1 @@ +For information on reliability testing with the Azure SDK stress test framework, please refer to the [Reliability testing wiki](https://aka.ms/azsdk/stress). diff --git a/sdk/batch/Azure.Temp.Batch/test-resources.json b/sdk/batch/Azure.Temp.Batch/test-resources.json new file mode 100644 index 000000000000..e3738f63cf06 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/test-resources.json @@ -0,0 +1,84 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "baseName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The base resource name." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "metadata": { + "description": "The tenant ID to which the application and resources belong." + } + }, + "testApplicationOid": { + "type": "string", + "metadata": { + "description": "The client OID to grant access to test resources." + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "The location of the resource. By default, this is the same as the resource group." + } + } + }, + "variables": { + "secretValue": "Very secret value" + }, + "resources": [ + { + "type": "Microsoft.KeyVault/vaults", + "apiVersion": "2016-10-01", + "name": "[parameters('baseName')]", + "location": "[parameters('location')]", + "properties": { + "sku": { + "family": "A", + "name": "premium" + }, + "tenantId": "[parameters('tenantId')]", + "accessPolicies": [ + { + "tenantId": "[parameters('tenantId')]", + "objectId": "[parameters('testApplicationOid')]", + "permissions": { + "secrets": [ + "get" + ] + } + } + ] + } + }, + { + "type": "Microsoft.KeyVault/vaults/secrets", + "name": "[concat(parameters('baseName'), '/TestSecret')]", + "apiVersion": "2016-10-01", + "location": "[parameters('location')]", + "dependsOn": [ + "[resourceId('Microsoft.KeyVault/vaults', parameters('baseName'))]" + ], + "properties": { + "value": "[variables('secretValue')]" + } + } + ], + "outputs": { + "KEYVAULT_URL": { + "type": "string", + "value": "[reference(parameters('baseName')).vaultUri]" + }, + "KEYVAULT_SECRET": { + "type": "string", + "value": "[variables('secretValue')]" + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests.yml b/sdk/batch/Azure.Temp.Batch/tests.yml new file mode 100644 index 000000000000..6c539b353599 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests.yml @@ -0,0 +1,7 @@ +trigger: none + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml + parameters: + ServiceDirectory: template + SupportedClouds: 'Public' diff --git a/sdk/batch/Azure.Temp.Batch/tests/Azure.Template.Tests.csproj b/sdk/batch/Azure.Temp.Batch/tests/Azure.Template.Tests.csproj new file mode 100644 index 000000000000..2ed01b70f4d8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Azure.Template.Tests.csproj @@ -0,0 +1,25 @@ + + + $(RequiredTargetFrameworks) + + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_AccountClient.cs b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_AccountClient.cs new file mode 100644 index 000000000000..6115935f0973 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_AccountClient.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Temp.Batch.Samples +{ + public class Samples_AccountClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSupportedImages() + { + var credential = new DefaultAzureCredential(); + var client = new AccountClient("", credential); + + foreach (var item in client.GetSupportedImages("", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("imageReference").ToString()); + Console.WriteLine(result.GetProperty("osType").ToString()); + Console.WriteLine(result.GetProperty("verificationType").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSupportedImages_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new AccountClient("", credential); + + foreach (var item in client.GetSupportedImages("", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("osType").ToString()); + Console.WriteLine(result.GetProperty("capabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("batchSupportEndOfLife").ToString()); + Console.WriteLine(result.GetProperty("verificationType").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetSupportedImages_Async() + { + var credential = new DefaultAzureCredential(); + var client = new AccountClient("", credential); + + await foreach (var item in client.GetSupportedImagesAsync("", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("imageReference").ToString()); + Console.WriteLine(result.GetProperty("osType").ToString()); + Console.WriteLine(result.GetProperty("verificationType").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetSupportedImages_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new AccountClient("", credential); + + await foreach (var item in client.GetSupportedImagesAsync("", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("osType").ToString()); + Console.WriteLine(result.GetProperty("capabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("batchSupportEndOfLife").ToString()); + Console.WriteLine(result.GetProperty("verificationType").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetPoolNodeCounts() + { + var credential = new DefaultAzureCredential(); + var client = new AccountClient("", credential); + + foreach (var item in client.GetPoolNodeCounts("", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetPoolNodeCounts_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new AccountClient("", credential); + + foreach (var item in client.GetPoolNodeCounts("", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("creating").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("idle").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("offline").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("preempted").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("rebooting").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("reimaging").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("starting").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("startTaskFailed").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("leavingPool").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("unknown").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("unusable").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("waitingForStartTask").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("total").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("creating").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("idle").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("offline").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("preempted").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("rebooting").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("reimaging").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("starting").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("startTaskFailed").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("leavingPool").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("unknown").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("unusable").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("waitingForStartTask").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("total").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetPoolNodeCounts_Async() + { + var credential = new DefaultAzureCredential(); + var client = new AccountClient("", credential); + + await foreach (var item in client.GetPoolNodeCountsAsync("", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetPoolNodeCounts_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new AccountClient("", credential); + + await foreach (var item in client.GetPoolNodeCountsAsync("", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("creating").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("idle").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("offline").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("preempted").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("rebooting").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("reimaging").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("starting").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("startTaskFailed").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("leavingPool").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("unknown").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("unusable").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("waitingForStartTask").ToString()); + Console.WriteLine(result.GetProperty("dedicated").GetProperty("total").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("creating").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("idle").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("offline").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("preempted").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("rebooting").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("reimaging").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("starting").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("startTaskFailed").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("leavingPool").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("unknown").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("unusable").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("waitingForStartTask").ToString()); + Console.WriteLine(result.GetProperty("lowPriority").GetProperty("total").ToString()); + } + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_ApplicationClient.cs b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_ApplicationClient.cs new file mode 100644 index 000000000000..f6305e0476d7 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_ApplicationClient.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Temp.Batch.Samples +{ + public class Samples_ApplicationClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetApplication() + { + var credential = new DefaultAzureCredential(); + var client = new ApplicationClient("", credential); + + Response response = client.GetApplication("", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("versions")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetApplication_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new ApplicationClient("", credential); + + Response response = client.GetApplication("", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("versions")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetApplication_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ApplicationClient("", credential); + + Response response = await client.GetApplicationAsync("", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("versions")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetApplication_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ApplicationClient("", credential); + + Response response = await client.GetApplicationAsync("", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("versions")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetApplications() + { + var credential = new DefaultAzureCredential(); + var client = new ApplicationClient("", credential); + + foreach (var item in client.GetApplications(1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("versions")[0].ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetApplications_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new ApplicationClient("", credential); + + foreach (var item in client.GetApplications(1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("versions")[0].ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetApplications_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ApplicationClient("", credential); + + await foreach (var item in client.GetApplicationsAsync(1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("versions")[0].ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetApplications_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ApplicationClient("", credential); + + await foreach (var item in client.GetApplicationsAsync(1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("versions")[0].ToString()); + } + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_CertificateClient.cs b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_CertificateClient.cs new file mode 100644 index 000000000000..5e457b4befde --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_CertificateClient.cs @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Temp.Batch.Samples +{ + public class Samples_CertificateClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Add() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + var data = new + { + thumbprint = "", + thumbprintAlgorithm = "", + data = "", + }; + + Response response = client.Add(RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Add_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + var data = new + { + thumbprint = "", + thumbprintAlgorithm = "", + data = "", + certificateFormat = "pfx", + password = "", + }; + + Response response = client.Add(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Add_Async() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + var data = new + { + thumbprint = "", + thumbprintAlgorithm = "", + data = "", + }; + + Response response = await client.AddAsync(RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Add_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + var data = new + { + thumbprint = "", + thumbprintAlgorithm = "", + data = "", + certificateFormat = "pfx", + password = "", + }; + + Response response = await client.AddAsync(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CancelDeletion() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + Response response = client.CancelDeletion("", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CancelDeletion_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + Response response = client.CancelDeletion("", "", 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_CancelDeletion_Async() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + Response response = await client.CancelDeletionAsync("", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_CancelDeletion_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + Response response = await client.CancelDeletionAsync("", "", 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Delete() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + Response response = client.Delete("", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Delete_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + Response response = client.Delete("", "", 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Delete_Async() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + Response response = await client.DeleteAsync("", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Delete_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + Response response = await client.DeleteAsync("", "", 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetCertificate() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + Response response = client.GetCertificate("", "", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("publicData").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("values")[0].GetProperty("value").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetCertificate_Async() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + Response response = await client.GetCertificateAsync("", "", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("publicData").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("values")[0].GetProperty("value").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetCertificates() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + foreach (var item in client.GetCertificates("", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("publicData").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("values")[0].GetProperty("value").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetCertificates_Async() + { + var credential = new DefaultAzureCredential(); + var client = new CertificateClient("", credential); + + await foreach (var item in client.GetCertificatesAsync("", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("publicData").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("deleteCertificateError").GetProperty("values")[0].GetProperty("value").ToString()); + } + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_ComputeNodeClient.cs b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_ComputeNodeClient.cs new file mode 100644 index 000000000000..5468ffd9ba9f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_ComputeNodeClient.cs @@ -0,0 +1,1120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Temp.Batch.Samples +{ + public class Samples_ComputeNodeClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AddUser() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + name = "", + }; + + Response response = client.AddUser("", "", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AddUser_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + name = "", + isAdmin = true, + expiryTime = "2022-05-10T18:57:31.2311892Z", + password = "", + sshPublicKey = "", + }; + + Response response = client.AddUser("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AddUser_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + name = "", + }; + + Response response = await client.AddUserAsync("", "", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AddUser_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + name = "", + isAdmin = true, + expiryTime = "2022-05-10T18:57:31.2311892Z", + password = "", + sshPublicKey = "", + }; + + Response response = await client.AddUserAsync("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeleteUser() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = client.DeleteUser("", "", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeleteUser_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = client.DeleteUser("", "", "", 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeleteUser_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = await client.DeleteUserAsync("", "", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeleteUser_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = await client.DeleteUserAsync("", "", "", 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_UpdateUser() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new { }; + + Response response = client.UpdateUser("", "", "", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_UpdateUser_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + password = "", + expiryTime = "2022-05-10T18:57:31.2311892Z", + sshPublicKey = "", + }; + + Response response = client.UpdateUser("", "", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_UpdateUser_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new { }; + + Response response = await client.UpdateUserAsync("", "", "", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_UpdateUser_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + password = "", + expiryTime = "2022-05-10T18:57:31.2311892Z", + sshPublicKey = "", + }; + + Response response = await client.UpdateUserAsync("", "", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetComputeNode() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = client.GetComputeNode("", "", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("schedulingState").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("lastBootTime").ToString()); + Console.WriteLine(result.GetProperty("allocationTime").ToString()); + Console.WriteLine(result.GetProperty("ipAddress").ToString()); + Console.WriteLine(result.GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("totalTasksRun").ToString()); + Console.WriteLine(result.GetProperty("runningTasksCount").ToString()); + Console.WriteLine(result.GetProperty("runningTaskSlotsCount").ToString()); + Console.WriteLine(result.GetProperty("totalTasksSucceeded").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskUrl").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("subtaskId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskState").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("requeueCount").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("lastRequeueTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("errorDetails")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("errorDetails")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("isDedicated").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("publicIPAddress").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("publicFQDN").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("frontendPort").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("nodeAgentInfo").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("nodeAgentInfo").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetComputeNode_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = await client.GetComputeNodeAsync("", "", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("schedulingState").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("lastBootTime").ToString()); + Console.WriteLine(result.GetProperty("allocationTime").ToString()); + Console.WriteLine(result.GetProperty("ipAddress").ToString()); + Console.WriteLine(result.GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("totalTasksRun").ToString()); + Console.WriteLine(result.GetProperty("runningTasksCount").ToString()); + Console.WriteLine(result.GetProperty("runningTaskSlotsCount").ToString()); + Console.WriteLine(result.GetProperty("totalTasksSucceeded").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskUrl").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("subtaskId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskState").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("requeueCount").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("lastRequeueTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("errorDetails")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("errorDetails")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("isDedicated").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("publicIPAddress").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("publicFQDN").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("frontendPort").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("nodeAgentInfo").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("nodeAgentInfo").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Reboot() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new { }; + + Response response = client.Reboot("", "", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Reboot_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + nodeRebootOption = "requeue", + }; + + Response response = client.Reboot("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Reboot_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new { }; + + Response response = await client.RebootAsync("", "", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Reboot_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + nodeRebootOption = "requeue", + }; + + Response response = await client.RebootAsync("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Reimage() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new { }; + + Response response = client.Reimage("", "", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Reimage_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + nodeReimageOption = "requeue", + }; + + Response response = client.Reimage("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Reimage_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new { }; + + Response response = await client.ReimageAsync("", "", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Reimage_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + nodeReimageOption = "requeue", + }; + + Response response = await client.ReimageAsync("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DisableScheduling() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new { }; + + Response response = client.DisableScheduling("", "", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DisableScheduling_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + nodeDisableSchedulingOption = "requeue", + }; + + Response response = client.DisableScheduling("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DisableScheduling_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new { }; + + Response response = await client.DisableSchedulingAsync("", "", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DisableScheduling_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + nodeDisableSchedulingOption = "requeue", + }; + + Response response = await client.DisableSchedulingAsync("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EnableScheduling() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = client.EnableScheduling("", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EnableScheduling_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = client.EnableScheduling("", "", 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EnableScheduling_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = await client.EnableSchedulingAsync("", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EnableScheduling_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = await client.EnableSchedulingAsync("", "", 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetRemoteLoginSettings() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = client.GetRemoteLoginSettings("", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("remoteLoginIPAddress").ToString()); + Console.WriteLine(result.GetProperty("remoteLoginPort").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetRemoteLoginSettings_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = client.GetRemoteLoginSettings("", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("remoteLoginIPAddress").ToString()); + Console.WriteLine(result.GetProperty("remoteLoginPort").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetRemoteLoginSettings_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = await client.GetRemoteLoginSettingsAsync("", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("remoteLoginIPAddress").ToString()); + Console.WriteLine(result.GetProperty("remoteLoginPort").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetRemoteLoginSettings_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = await client.GetRemoteLoginSettingsAsync("", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("remoteLoginIPAddress").ToString()); + Console.WriteLine(result.GetProperty("remoteLoginPort").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetRemoteDesktop() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = client.GetRemoteDesktop("", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + if (response.ContentStream != null) + { + using (Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetRemoteDesktop_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = client.GetRemoteDesktop("", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + if (response.ContentStream != null) + { + using (Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetRemoteDesktop_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = await client.GetRemoteDesktopAsync("", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + if (response.ContentStream != null) + { + using (Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetRemoteDesktop_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + Response response = await client.GetRemoteDesktopAsync("", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + if (response.ContentStream != null) + { + using (Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_UploadBatchServiceLogs() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + containerUrl = "", + startTime = "2022-05-10T18:57:31.2311892Z", + }; + + Response response = client.UploadBatchServiceLogs("", "", RequestContent.Create(data)); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("virtualDirectoryName").ToString()); + Console.WriteLine(result.GetProperty("numberOfFilesUploaded").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_UploadBatchServiceLogs_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + containerUrl = "", + startTime = "2022-05-10T18:57:31.2311892Z", + endTime = "2022-05-10T18:57:31.2311892Z", + identityReference = new + { + resourceId = "", + }, + }; + + Response response = client.UploadBatchServiceLogs("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("virtualDirectoryName").ToString()); + Console.WriteLine(result.GetProperty("numberOfFilesUploaded").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_UploadBatchServiceLogs_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + containerUrl = "", + startTime = "2022-05-10T18:57:31.2311892Z", + }; + + Response response = await client.UploadBatchServiceLogsAsync("", "", RequestContent.Create(data)); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("virtualDirectoryName").ToString()); + Console.WriteLine(result.GetProperty("numberOfFilesUploaded").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_UploadBatchServiceLogs_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + var data = new + { + containerUrl = "", + startTime = "2022-05-10T18:57:31.2311892Z", + endTime = "2022-05-10T18:57:31.2311892Z", + identityReference = new + { + resourceId = "", + }, + }; + + Response response = await client.UploadBatchServiceLogsAsync("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("virtualDirectoryName").ToString()); + Console.WriteLine(result.GetProperty("numberOfFilesUploaded").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetComputeNodes() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + foreach (var item in client.GetComputeNodes("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("schedulingState").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("lastBootTime").ToString()); + Console.WriteLine(result.GetProperty("allocationTime").ToString()); + Console.WriteLine(result.GetProperty("ipAddress").ToString()); + Console.WriteLine(result.GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("totalTasksRun").ToString()); + Console.WriteLine(result.GetProperty("runningTasksCount").ToString()); + Console.WriteLine(result.GetProperty("runningTaskSlotsCount").ToString()); + Console.WriteLine(result.GetProperty("totalTasksSucceeded").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskUrl").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("subtaskId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskState").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("requeueCount").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("lastRequeueTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("errorDetails")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("errorDetails")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("isDedicated").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("publicIPAddress").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("publicFQDN").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("frontendPort").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("nodeAgentInfo").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("nodeAgentInfo").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetComputeNodes_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeClient("", credential); + + await foreach (var item in client.GetComputeNodesAsync("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("schedulingState").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("lastBootTime").ToString()); + Console.WriteLine(result.GetProperty("allocationTime").ToString()); + Console.WriteLine(result.GetProperty("ipAddress").ToString()); + Console.WriteLine(result.GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("totalTasksRun").ToString()); + Console.WriteLine(result.GetProperty("runningTasksCount").ToString()); + Console.WriteLine(result.GetProperty("runningTaskSlotsCount").ToString()); + Console.WriteLine(result.GetProperty("totalTasksSucceeded").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskUrl").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("subtaskId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("taskState").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("requeueCount").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("lastRequeueTime").ToString()); + Console.WriteLine(result.GetProperty("recentTasks")[0].GetProperty("executionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("startTaskInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("errorDetails")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("errorDetails")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("isDedicated").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("publicIPAddress").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("publicFQDN").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("frontendPort").ToString()); + Console.WriteLine(result.GetProperty("endpointConfiguration").GetProperty("inboundEndpoints")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("nodeAgentInfo").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("nodeAgentInfo").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineInfo").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + } + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_ComputeNodeExtensionClient.cs b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_ComputeNodeExtensionClient.cs new file mode 100644 index 000000000000..3ddb66c7a5b4 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_ComputeNodeExtensionClient.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Temp.Batch.Samples +{ + public class Samples_ComputeNodeExtensionClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetComputeNodeExtension() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeExtensionClient("", credential); + + Response response = client.GetComputeNodeExtension("", "", "", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("provisioningState").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("displayStatus").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("level").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("time").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("displayStatus").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("level").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("time").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetComputeNodeExtension_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeExtensionClient("", credential); + + Response response = await client.GetComputeNodeExtensionAsync("", "", "", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("provisioningState").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("displayStatus").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("level").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("time").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("displayStatus").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("level").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("time").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetComputeNodeExtensions() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeExtensionClient("", credential); + + foreach (var item in client.GetComputeNodeExtensions("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("provisioningState").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("displayStatus").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("level").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("time").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("displayStatus").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("level").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("time").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetComputeNodeExtensions_Async() + { + var credential = new DefaultAzureCredential(); + var client = new ComputeNodeExtensionClient("", credential); + + await foreach (var item in client.GetComputeNodeExtensionsAsync("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("provisioningState").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("vmExtension").GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("displayStatus").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("level").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("time").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("displayStatus").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("level").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("time").ToString()); + } + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_FileClient.cs b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_FileClient.cs new file mode 100644 index 000000000000..fd67cf4a3f1c --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_FileClient.cs @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Temp.Batch.Samples +{ + public class Samples_FileClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeleteFromTask() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = client.DeleteFromTask("", "", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeleteFromTask_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = client.DeleteFromTask("", "", "", true, 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeleteFromTask_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = await client.DeleteFromTaskAsync("", "", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeleteFromTask_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = await client.DeleteFromTaskAsync("", "", "", true, 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetFromTask() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = client.GetFromTask("", "", "", 1234, DateTimeOffset.UtcNow, "", null, new RequestContext()); + if (response.ContentStream != null) + { + using (Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetFromTask_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = client.GetFromTask("", "", "", 1234, DateTimeOffset.UtcNow, "", null, new RequestContext()); + if (response.ContentStream != null) + { + using (Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetFromTask_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = await client.GetFromTaskAsync("", "", "", 1234, DateTimeOffset.UtcNow, "", null, new RequestContext()); + if (response.ContentStream != null) + { + using (Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetFromTask_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = await client.GetFromTaskAsync("", "", "", 1234, DateTimeOffset.UtcNow, "", null, new RequestContext()); + if (response.ContentStream != null) + { + using (Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetPropertiesFromTask() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = client.GetPropertiesFromTask("", "", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetPropertiesFromTask_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = client.GetPropertiesFromTask("", "", "", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetPropertiesFromTask_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = await client.GetPropertiesFromTaskAsync("", "", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetPropertiesFromTask_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = await client.GetPropertiesFromTaskAsync("", "", "", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeleteFromComputeNode() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = client.DeleteFromComputeNode("", "", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeleteFromComputeNode_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = client.DeleteFromComputeNode("", "", "", true, 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeleteFromComputeNode_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = await client.DeleteFromComputeNodeAsync("", "", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeleteFromComputeNode_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = await client.DeleteFromComputeNodeAsync("", "", "", true, 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetFromComputeNode() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = client.GetFromComputeNode("", "", "", 1234, DateTimeOffset.UtcNow, "", null, new RequestContext()); + if (response.ContentStream != null) + { + using (Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetFromComputeNode_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = client.GetFromComputeNode("", "", "", 1234, DateTimeOffset.UtcNow, "", null, new RequestContext()); + if (response.ContentStream != null) + { + using (Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetFromComputeNode_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = await client.GetFromComputeNodeAsync("", "", "", 1234, DateTimeOffset.UtcNow, "", null, new RequestContext()); + if (response.ContentStream != null) + { + using (Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetFromComputeNode_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = await client.GetFromComputeNodeAsync("", "", "", 1234, DateTimeOffset.UtcNow, "", null, new RequestContext()); + if (response.ContentStream != null) + { + using (Stream outFileStream = File.OpenWrite("")) + { + response.ContentStream.CopyTo(outFileStream); + } + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetPropertiesFromComputeNode() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = client.GetPropertiesFromComputeNode("", "", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetPropertiesFromComputeNode_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = client.GetPropertiesFromComputeNode("", "", "", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetPropertiesFromComputeNode_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = await client.GetPropertiesFromComputeNodeAsync("", "", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetPropertiesFromComputeNode_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + Response response = await client.GetPropertiesFromComputeNodeAsync("", "", "", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetFromTasks() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + foreach (var item in client.GetFromTasks("", "", "", true, 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetFromTasks_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + foreach (var item in client.GetFromTasks("", "", "", true, 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("isDirectory").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentLength").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentType").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("fileMode").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetFromTasks_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + await foreach (var item in client.GetFromTasksAsync("", "", "", true, 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetFromTasks_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + await foreach (var item in client.GetFromTasksAsync("", "", "", true, 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("isDirectory").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentLength").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentType").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("fileMode").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetFromComputeNodes() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + foreach (var item in client.GetFromComputeNodes("", "", "", true, 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetFromComputeNodes_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + foreach (var item in client.GetFromComputeNodes("", "", "", true, 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("isDirectory").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentLength").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentType").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("fileMode").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetFromComputeNodes_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + await foreach (var item in client.GetFromComputeNodesAsync("", "", "", true, 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetFromComputeNodes_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new FileClient("", credential); + + await foreach (var item in client.GetFromComputeNodesAsync("", "", "", true, 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("isDirectory").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentLength").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("contentType").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("fileMode").ToString()); + } + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_JobClient.cs b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_JobClient.cs new file mode 100644 index 000000000000..0db28c7ac053 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_JobClient.cs @@ -0,0 +1,4446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Temp.Batch.Samples +{ + public class Samples_JobClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Delete() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = client.Delete(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Delete_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = client.Delete("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Delete_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = await client.DeleteAsync(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Delete_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = await client.DeleteAsync("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetJob() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = client.GetJob("", "", "", 1234, DateTimeOffset.UtcNow, null, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("terminateReason").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetJob_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = await client.GetJobAsync("", "", "", 1234, DateTimeOffset.UtcNow, null, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("terminateReason").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Patch() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new { }; + + Response response = client.Patch("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Patch_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + priority = 1234, + maxParallelTasks = 1234, + allowTaskPreemption = true, + onAllTasksComplete = "noaction", + constraints = new + { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + poolInfo = new + { + poolId = "", + autoPoolSpecification = new + { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new + { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }; + + Response response = client.Patch("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Patch_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new { }; + + Response response = await client.PatchAsync("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Patch_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + priority = 1234, + maxParallelTasks = 1234, + allowTaskPreemption = true, + onAllTasksComplete = "noaction", + constraints = new + { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + poolInfo = new + { + poolId = "", + autoPoolSpecification = new + { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new + { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }; + + Response response = await client.PatchAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Update() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + poolInfo = new { }, + }; + + Response response = client.Update("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Update_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + priority = 1234, + maxParallelTasks = 1234, + allowTaskPreemption = true, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + poolInfo = new + { + poolId = "", + autoPoolSpecification = new + { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new + { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + onAllTasksComplete = "noaction", + }; + + Response response = client.Update("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Update_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + poolInfo = new { }, + }; + + Response response = await client.UpdateAsync("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Update_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + priority = 1234, + maxParallelTasks = 1234, + allowTaskPreemption = true, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + poolInfo = new + { + poolId = "", + autoPoolSpecification = new + { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new + { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + onAllTasksComplete = "noaction", + }; + + Response response = await client.UpdateAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Disable() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + disableTasks = "requeue", + }; + + Response response = client.Disable("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Disable_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + disableTasks = "requeue", + }; + + Response response = client.Disable("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Disable_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + disableTasks = "requeue", + }; + + Response response = await client.DisableAsync("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Disable_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + disableTasks = "requeue", + }; + + Response response = await client.DisableAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Enable() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = client.Enable(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Enable_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = client.Enable("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Enable_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = await client.EnableAsync(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Enable_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = await client.EnableAsync("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Terminate() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new { }; + + Response response = client.Terminate("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Terminate_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + terminateReason = "", + }; + + Response response = client.Terminate("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Terminate_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new { }; + + Response response = await client.TerminateAsync("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Terminate_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + terminateReason = "", + }; + + Response response = await client.TerminateAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Add() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + id = "", + poolInfo = new { }, + }; + + Response response = client.Add(RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Add_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + id = "", + displayName = "", + priority = 1234, + maxParallelTasks = 1234, + allowTaskPreemption = true, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new + { + id = "", + displayName = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new + { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new + { + poolId = "", + autoPoolSpecification = new + { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new + { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + metadata = new[] { + new { + name = "", + value = "", + } + }, + usesTaskDependencies = true, + networkConfiguration = new + { + subnetId = "", + }, + }; + + Response response = client.Add(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Add_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + id = "", + poolInfo = new { }, + }; + + Response response = await client.AddAsync(RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Add_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + var data = new + { + id = "", + displayName = "", + priority = 1234, + maxParallelTasks = 1234, + allowTaskPreemption = true, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new + { + id = "", + displayName = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new + { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new + { + poolId = "", + autoPoolSpecification = new + { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new + { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + metadata = new[] { + new { + name = "", + value = "", + } + }, + usesTaskDependencies = true, + networkConfiguration = new + { + subnetId = "", + }, + }; + + Response response = await client.AddAsync(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTaskCounts() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = client.GetTaskCounts("", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("succeeded").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("succeeded").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("failed").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTaskCounts_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = client.GetTaskCounts("", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("succeeded").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("succeeded").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("failed").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetTaskCounts_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = await client.GetTaskCountsAsync("", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("succeeded").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("succeeded").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("failed").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetTaskCounts_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + Response response = await client.GetTaskCountsAsync("", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("succeeded").ToString()); + Console.WriteLine(result.GetProperty("taskCounts").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("running").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("succeeded").ToString()); + Console.WriteLine(result.GetProperty("taskSlotCounts").GetProperty("failed").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetJobs() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + foreach (var item in client.GetJobs("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("terminateReason").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetJobs_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + await foreach (var item in client.GetJobsAsync("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("terminateReason").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetFromJobSchedules() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + foreach (var item in client.GetFromJobSchedules("", "", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("terminateReason").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetFromJobSchedules_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + await foreach (var item in client.GetFromJobSchedulesAsync("", "", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("schedulingError").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("terminateReason").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetPreparationAndReleaseTaskStatuses() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + foreach (var item in client.GetPreparationAndReleaseTaskStatuses("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("nodeId").ToString()); + Console.WriteLine(result.GetProperty("nodeUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("result").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetPreparationAndReleaseTaskStatuses_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobClient("", credential); + + await foreach (var item in client.GetPreparationAndReleaseTaskStatusesAsync("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("nodeId").ToString()); + Console.WriteLine(result.GetProperty("nodeUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("result").ToString()); + } + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_JobScheduleClient.cs b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_JobScheduleClient.cs new file mode 100644 index 000000000000..5abdc6779a04 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_JobScheduleClient.cs @@ -0,0 +1,4664 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Temp.Batch.Samples +{ + public class Samples_JobScheduleClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Exists() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = client.Exists(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Exists_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = client.Exists("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Exists_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = await client.ExistsAsync(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Exists_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = await client.ExistsAsync("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Delete() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = client.Delete(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Delete_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = client.Delete("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Delete_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = await client.DeleteAsync(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Delete_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = await client.DeleteAsync("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetJobSchedule() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = client.GetJobSchedule("", "", "", 1234, DateTimeOffset.UtcNow, null, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("doNotRunUntil").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("doNotRunAfter").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("startWindow").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("recurrenceInterval").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("nextRunTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("recentJob").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("recentJob").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetJobSchedule_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = await client.GetJobScheduleAsync("", "", "", 1234, DateTimeOffset.UtcNow, null, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("doNotRunUntil").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("doNotRunAfter").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("startWindow").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("recurrenceInterval").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("nextRunTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("recentJob").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("recentJob").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Patch() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + var data = new { }; + + Response response = client.Patch("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Patch_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + var data = new + { + schedule = new + { + doNotRunUntil = "2022-05-10T18:57:31.2311892Z", + doNotRunAfter = "2022-05-10T18:57:31.2311892Z", + startWindow = "PT1H23M45S", + recurrenceInterval = "PT1H23M45S", + }, + jobSpecification = new + { + priority = 1234, + allowTaskPreemption = true, + maxParallelTasks = 1234, + displayName = "", + usesTaskDependencies = true, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + networkConfiguration = new + { + subnetId = "", + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new + { + id = "", + displayName = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new + { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new + { + poolId = "", + autoPoolSpecification = new + { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new + { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }; + + Response response = client.Patch("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Patch_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + var data = new { }; + + Response response = await client.PatchAsync("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Patch_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + var data = new + { + schedule = new + { + doNotRunUntil = "2022-05-10T18:57:31.2311892Z", + doNotRunAfter = "2022-05-10T18:57:31.2311892Z", + startWindow = "PT1H23M45S", + recurrenceInterval = "PT1H23M45S", + }, + jobSpecification = new + { + priority = 1234, + allowTaskPreemption = true, + maxParallelTasks = 1234, + displayName = "", + usesTaskDependencies = true, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + networkConfiguration = new + { + subnetId = "", + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new + { + id = "", + displayName = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new + { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new + { + poolId = "", + autoPoolSpecification = new + { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new + { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }; + + Response response = await client.PatchAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Update() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + var data = new + { + schedule = new { }, + jobSpecification = new + { + poolInfo = new { }, + }, + }; + + Response response = client.Update("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Update_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + var data = new + { + schedule = new + { + doNotRunUntil = "2022-05-10T18:57:31.2311892Z", + doNotRunAfter = "2022-05-10T18:57:31.2311892Z", + startWindow = "PT1H23M45S", + recurrenceInterval = "PT1H23M45S", + }, + jobSpecification = new + { + priority = 1234, + allowTaskPreemption = true, + maxParallelTasks = 1234, + displayName = "", + usesTaskDependencies = true, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + networkConfiguration = new + { + subnetId = "", + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new + { + id = "", + displayName = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new + { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new + { + poolId = "", + autoPoolSpecification = new + { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new + { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }; + + Response response = client.Update("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Update_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + var data = new + { + schedule = new { }, + jobSpecification = new + { + poolInfo = new { }, + }, + }; + + Response response = await client.UpdateAsync("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Update_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + var data = new + { + schedule = new + { + doNotRunUntil = "2022-05-10T18:57:31.2311892Z", + doNotRunAfter = "2022-05-10T18:57:31.2311892Z", + startWindow = "PT1H23M45S", + recurrenceInterval = "PT1H23M45S", + }, + jobSpecification = new + { + priority = 1234, + allowTaskPreemption = true, + maxParallelTasks = 1234, + displayName = "", + usesTaskDependencies = true, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + networkConfiguration = new + { + subnetId = "", + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new + { + id = "", + displayName = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new + { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new + { + poolId = "", + autoPoolSpecification = new + { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new + { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }; + + Response response = await client.UpdateAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Disable() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = client.Disable(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Disable_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = client.Disable("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Disable_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = await client.DisableAsync(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Disable_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = await client.DisableAsync("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Enable() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = client.Enable(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Enable_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = client.Enable("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Enable_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = await client.EnableAsync(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Enable_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = await client.EnableAsync("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Terminate() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = client.Terminate(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Terminate_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = client.Terminate("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Terminate_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = await client.TerminateAsync(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Terminate_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + Response response = await client.TerminateAsync("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Add() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + var data = new + { + id = "", + schedule = new { }, + jobSpecification = new + { + poolInfo = new { }, + }, + }; + + Response response = client.Add(RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Add_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + var data = new + { + id = "", + displayName = "", + schedule = new + { + doNotRunUntil = "2022-05-10T18:57:31.2311892Z", + doNotRunAfter = "2022-05-10T18:57:31.2311892Z", + startWindow = "PT1H23M45S", + recurrenceInterval = "PT1H23M45S", + }, + jobSpecification = new + { + priority = 1234, + allowTaskPreemption = true, + maxParallelTasks = 1234, + displayName = "", + usesTaskDependencies = true, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + networkConfiguration = new + { + subnetId = "", + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new + { + id = "", + displayName = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new + { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new + { + poolId = "", + autoPoolSpecification = new + { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new + { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }; + + Response response = client.Add(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Add_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + var data = new + { + id = "", + schedule = new { }, + jobSpecification = new + { + poolInfo = new { }, + }, + }; + + Response response = await client.AddAsync(RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Add_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + var data = new + { + id = "", + displayName = "", + schedule = new + { + doNotRunUntil = "2022-05-10T18:57:31.2311892Z", + doNotRunAfter = "2022-05-10T18:57:31.2311892Z", + startWindow = "PT1H23M45S", + recurrenceInterval = "PT1H23M45S", + }, + jobSpecification = new + { + priority = 1234, + allowTaskPreemption = true, + maxParallelTasks = 1234, + displayName = "", + usesTaskDependencies = true, + onAllTasksComplete = "noaction", + onTaskFailure = "noaction", + networkConfiguration = new + { + subnetId = "", + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + jobManagerTask = new + { + id = "", + displayName = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + killJobOnCompletion = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new + { + access = new[] { + "job" + }, + }, + allowLowPriorityNode = true, + }, + jobPreparationTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + waitForSuccess = true, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + rerunOnNodeRebootAfterSuccess = true, + }, + jobReleaseTask = new + { + id = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }, + commonEnvironmentSettings = new[] { + new { + name = "", + value = "", + } + }, + poolInfo = new + { + poolId = "", + autoPoolSpecification = new + { + autoPoolIdPrefix = "", + poolLifetimeOption = "jobschedule", + keepAlive = true, + pool = new + { + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }; + + Response response = await client.AddAsync(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetJobSchedules() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + foreach (var item in client.GetJobSchedules("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("doNotRunUntil").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("doNotRunAfter").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("startWindow").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("recurrenceInterval").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("nextRunTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("recentJob").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("recentJob").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetJobSchedules_Async() + { + var credential = new DefaultAzureCredential(); + var client = new JobScheduleClient("", credential); + + await foreach (var item in client.GetJobSchedulesAsync("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("doNotRunUntil").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("doNotRunAfter").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("startWindow").ToString()); + Console.WriteLine(result.GetProperty("schedule").GetProperty("recurrenceInterval").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("allowTaskPreemption").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("maxParallelTasks").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("usesTaskDependencies").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("onAllTasksComplete").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("onTaskFailure").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("killJobOnCompletion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("runExclusive").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobManagerTask").GetProperty("allowLowPriorityNode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobPreparationTask").GetProperty("rerunOnNodeRebootAfterSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("jobReleaseTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("commonEnvironmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("commonEnvironmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("autoPoolIdPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("poolLifetimeOption").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("keepAlive").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("poolInfo").GetProperty("autoPoolSpecification").GetProperty("pool").GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("jobSpecification").GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("nextRunTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("recentJob").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("recentJob").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numSucceededTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numFailedTasks").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("numTaskRetries").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + } + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_PoolClient.cs b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_PoolClient.cs new file mode 100644 index 000000000000..de9fba7cdb3b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_PoolClient.cs @@ -0,0 +1,2328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Temp.Batch.Samples +{ + public class Samples_PoolClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Add() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + id = "", + vmSize = "", + }; + + Response response = client.Add(RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Add_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + id = "", + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }; + + Response response = client.Add(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Add_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + id = "", + vmSize = "", + }; + + Response response = await client.AddAsync(RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Add_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + id = "", + displayName = "", + vmSize = "", + cloudServiceConfiguration = new + { + osFamily = "", + osVersion = "", + }, + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "", + offer = "", + sku = "", + version = "", + virtualMachineImageId = "", + }, + nodeAgentSKUId = "", + windowsConfiguration = new + { + enableAutomaticUpdates = true, + }, + dataDisks = new[] { + new { + lun = 1234, + caching = "none", + diskSizeGB = 1234, + storageAccountType = "standard_lrs", + } + }, + licenseType = "", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new[] { + "" + }, + containerRegistries = new[] { + new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + diskEncryptionConfiguration = new + { + targets = new[] { + "osdisk" + }, + }, + nodePlacementConfiguration = new + { + policy = "regional", + }, + extensions = new[] { + new { + name = "", + publisher = "", + type = "", + typeHandlerVersion = "", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new {}, + protectedSettings = new {}, + provisionAfterExtensions = new[] { + "" + }, + } + }, + osDisk = new + { + ephemeralOSDiskSettings = new + { + placement = "CacheDisk", + }, + }, + }, + resizeTimeout = "PT1H23M45S", + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + enableAutoScale = true, + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + enableInterNodeCommunication = true, + networkConfiguration = new + { + subnetId = "", + dynamicVNetAssignmentScope = "none", + endpointConfiguration = new + { + inboundNATPools = new[] { + new { + name = "", + protocol = "tcp", + backendPort = 1234, + frontendPortRangeStart = 1234, + frontendPortRangeEnd = 1234, + networkSecurityGroupRules = new[] { + new { + priority = 1234, + access = "allow", + sourceAddressPrefix = "", + sourcePortRanges = new[] { + "" + }, + } + }, + } + }, + }, + publicIPAddressConfiguration = new + { + provision = "batchmanaged", + ipAddressIds = new[] { + "" + }, + }, + enableAcceleratedNetworking = true, + }, + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + applicationLicenses = new[] { + "" + }, + taskSlotsPerNode = 1234, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + userAccounts = new[] { + new { + name = "", + password = "", + elevationLevel = "nonadmin", + linuxUserConfiguration = new { + uid = 1234, + gid = 1234, + sshPrivateKey = "", + }, + windowsUserConfiguration = new { + loginMode = "batch", + }, + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + mountConfiguration = new[] { + new { + azureBlobFileSystemConfiguration = new { + accountName = "", + containerName = "", + accountKey = "", + sasKey = "", + blobfuseOptions = "", + relativeMountPath = "", + identityReference = new { + resourceId = "", + }, + }, + nfsMountConfiguration = new { + source = "", + relativeMountPath = "", + mountOptions = "", + }, + cifsMountConfiguration = new { + username = "", + source = "", + relativeMountPath = "", + mountOptions = "", + password = "", + }, + azureFileShareConfiguration = new { + accountName = "", + azureFileUrl = "", + accountKey = "", + relativeMountPath = "", + mountOptions = "", + }, + } + }, + targetNodeCommunicationMode = "default", + }; + + Response response = await client.AddAsync(RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Delete() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = client.Delete(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Delete_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = client.Delete("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Delete_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = await client.DeleteAsync(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Delete_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = await client.DeleteAsync("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Exists() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = client.Exists(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Exists_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = client.Exists("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Exists_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = await client.ExistsAsync(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Exists_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = await client.ExistsAsync("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetPool() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = client.GetPool("", "", "", 1234, DateTimeOffset.UtcNow, null, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("allocationState").ToString()); + Console.WriteLine(result.GetProperty("allocationStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("values")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("currentDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("currentLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("timestamp").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("results").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("dedicatedCoreTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgCPUPercentage").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgMemoryGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("peakMemoryGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgDiskGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("peakDiskGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskReadIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskWriteIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskReadGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskWriteGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("networkReadGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("networkWriteGiB").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("clientId").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("principalId").ToString()); + Console.WriteLine(result.GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("currentNodeCommunicationMode").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetPool_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = await client.GetPoolAsync("", "", "", 1234, DateTimeOffset.UtcNow, null, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("allocationState").ToString()); + Console.WriteLine(result.GetProperty("allocationStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("values")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("currentDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("currentLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("timestamp").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("results").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("dedicatedCoreTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgCPUPercentage").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgMemoryGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("peakMemoryGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgDiskGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("peakDiskGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskReadIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskWriteIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskReadGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskWriteGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("networkReadGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("networkWriteGiB").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("clientId").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("principalId").ToString()); + Console.WriteLine(result.GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("currentNodeCommunicationMode").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Patch() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new { }; + + Response response = client.Patch("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Patch_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + targetNodeCommunicationMode = "default", + }; + + Response response = client.Patch("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Patch_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new { }; + + Response response = await client.PatchAsync("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Patch_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + targetNodeCommunicationMode = "default", + }; + + Response response = await client.PatchAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DisableAutoScale() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = client.DisableAutoScale(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DisableAutoScale_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = client.DisableAutoScale("", 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DisableAutoScale_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = await client.DisableAutoScaleAsync(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DisableAutoScale_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = await client.DisableAutoScaleAsync("", 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EnableAutoScale() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new { }; + + Response response = client.EnableAutoScale("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EnableAutoScale_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + }; + + Response response = client.EnableAutoScale("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EnableAutoScale_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new { }; + + Response response = await client.EnableAutoScaleAsync("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EnableAutoScale_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + autoScaleFormula = "", + autoScaleEvaluationInterval = "PT1H23M45S", + }; + + Response response = await client.EnableAutoScaleAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluateAutoScale() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + autoScaleFormula = "", + }; + + Response response = client.EvaluateAutoScale("", RequestContent.Create(data)); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("timestamp").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluateAutoScale_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + autoScaleFormula = "", + }; + + Response response = client.EvaluateAutoScale("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("timestamp").ToString()); + Console.WriteLine(result.GetProperty("results").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluateAutoScale_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + autoScaleFormula = "", + }; + + Response response = await client.EvaluateAutoScaleAsync("", RequestContent.Create(data)); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("timestamp").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluateAutoScale_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + autoScaleFormula = "", + }; + + Response response = await client.EvaluateAutoScaleAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("timestamp").ToString()); + Console.WriteLine(result.GetProperty("results").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Resize() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new { }; + + Response response = client.Resize("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Resize_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + resizeTimeout = "PT1H23M45S", + nodeDeallocationOption = "requeue", + }; + + Response response = client.Resize("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Resize_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new { }; + + Response response = await client.ResizeAsync("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Resize_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + targetDedicatedNodes = 1234, + targetLowPriorityNodes = 1234, + resizeTimeout = "PT1H23M45S", + nodeDeallocationOption = "requeue", + }; + + Response response = await client.ResizeAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_StopResize() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = client.StopResize(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_StopResize_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = client.StopResize("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_StopResize_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = await client.StopResizeAsync(""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_StopResize_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + Response response = await client.StopResizeAsync("", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_UpdateProperties() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }; + + Response response = client.UpdateProperties("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_UpdateProperties_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + targetNodeCommunicationMode = "default", + }; + + Response response = client.UpdateProperties("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_UpdateProperties_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + }; + + Response response = await client.UpdatePropertiesAsync("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_UpdateProperties_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + startTask = new + { + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + maxTaskRetryCount = 1234, + waitForSuccess = true, + }, + certificateReferences = new[] { + new { + thumbprint = "", + thumbprintAlgorithm = "", + storeLocation = "currentuser", + storeName = "", + visibility = new[] { + "starttask" + }, + } + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + metadata = new[] { + new { + name = "", + value = "", + } + }, + targetNodeCommunicationMode = "default", + }; + + Response response = await client.UpdatePropertiesAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RemoveNodes() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + nodeList = new[] { + "" + }, + }; + + Response response = client.RemoveNodes("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RemoveNodes_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + nodeList = new[] { + "" + }, + resizeTimeout = "PT1H23M45S", + nodeDeallocationOption = "requeue", + }; + + Response response = client.RemoveNodes("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RemoveNodes_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + nodeList = new[] { + "" + }, + }; + + Response response = await client.RemoveNodesAsync("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RemoveNodes_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + var data = new + { + nodeList = new[] { + "" + }, + resizeTimeout = "PT1H23M45S", + nodeDeallocationOption = "requeue", + }; + + Response response = await client.RemoveNodesAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetUsageMetrics() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + foreach (var item in client.GetUsageMetrics(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow, "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("totalCoreHours").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetUsageMetrics_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + foreach (var item in client.GetUsageMetrics(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow, "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("totalCoreHours").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetUsageMetrics_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + await foreach (var item in client.GetUsageMetricsAsync(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow, "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("totalCoreHours").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetUsageMetrics_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + await foreach (var item in client.GetUsageMetricsAsync(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow, "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("totalCoreHours").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetPools() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + foreach (var item in client.GetPools("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("allocationState").ToString()); + Console.WriteLine(result.GetProperty("allocationStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("values")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("currentDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("currentLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("timestamp").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("results").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("dedicatedCoreTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgCPUPercentage").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgMemoryGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("peakMemoryGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgDiskGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("peakDiskGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskReadIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskWriteIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskReadGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskWriteGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("networkReadGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("networkWriteGiB").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("clientId").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("principalId").ToString()); + Console.WriteLine(result.GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("currentNodeCommunicationMode").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetPools_Async() + { + var credential = new DefaultAzureCredential(); + var client = new PoolClient("", credential); + + await foreach (var item in client.GetPoolsAsync("", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("allocationState").ToString()); + Console.WriteLine(result.GetProperty("allocationStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("vmSize").ToString()); + Console.WriteLine(result.GetProperty("cloudServiceConfiguration").GetProperty("osFamily").ToString()); + Console.WriteLine(result.GetProperty("cloudServiceConfiguration").GetProperty("osVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("offer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("sku").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("imageReference").GetProperty("exactVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("nodeAgentSKUId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("windowsConfiguration").GetProperty("enableAutomaticUpdates").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("lun").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("caching").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("diskSizeGB").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("dataDisks")[0].GetProperty("storageAccountType").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("licenseType").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerImageNames")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("containerConfiguration").GetProperty("containerRegistries")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("diskEncryptionConfiguration").GetProperty("targets")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("nodePlacementConfiguration").GetProperty("policy").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("publisher").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("typeHandlerVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("autoUpgradeMinorVersion").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("enableAutomaticUpgrade").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("settings").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("protectedSettings").ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("extensions")[0].GetProperty("provisionAfterExtensions")[0].ToString()); + Console.WriteLine(result.GetProperty("virtualMachineConfiguration").GetProperty("osDisk").GetProperty("ephemeralOSDiskSettings").GetProperty("placement").ToString()); + Console.WriteLine(result.GetProperty("resizeTimeout").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("resizeErrors")[0].GetProperty("values")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("currentDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("currentLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("targetDedicatedNodes").ToString()); + Console.WriteLine(result.GetProperty("targetLowPriorityNodes").ToString()); + Console.WriteLine(result.GetProperty("enableAutoScale").ToString()); + Console.WriteLine(result.GetProperty("autoScaleFormula").ToString()); + Console.WriteLine(result.GetProperty("autoScaleEvaluationInterval").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("timestamp").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("results").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("values")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("autoScaleRun").GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("enableInterNodeCommunication").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("subnetId").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("dynamicVNetAssignmentScope").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("protocol").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("backendPort").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeStart").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("frontendPortRangeEnd").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("access").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourceAddressPrefix").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("endpointConfiguration").GetProperty("inboundNATPools")[0].GetProperty("networkSecurityGroupRules")[0].GetProperty("sourcePortRanges")[0].ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("provision").ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("publicIPAddressConfiguration").GetProperty("ipAddressIds")[0].ToString()); + Console.WriteLine(result.GetProperty("networkConfiguration").GetProperty("enableAcceleratedNetworking").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("startTask").GetProperty("waitForSuccess").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprint").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("thumbprintAlgorithm").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeLocation").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("storeName").ToString()); + Console.WriteLine(result.GetProperty("certificateReferences")[0].GetProperty("visibility")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("applicationLicenses")[0].ToString()); + Console.WriteLine(result.GetProperty("taskSlotsPerNode").ToString()); + Console.WriteLine(result.GetProperty("taskSchedulingPolicy").GetProperty("nodeFillType").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("uid").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("gid").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("linuxUserConfiguration").GetProperty("sshPrivateKey").ToString()); + Console.WriteLine(result.GetProperty("userAccounts")[0].GetProperty("windowsUserConfiguration").GetProperty("loginMode").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("metadata")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("usageStats").GetProperty("dedicatedCoreTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgCPUPercentage").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgMemoryGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("peakMemoryGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("avgDiskGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("peakDiskGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskReadIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskWriteIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskReadGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("diskWriteGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("networkReadGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("resourceStats").GetProperty("networkWriteGiB").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("containerName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("sasKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("blobfuseOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureBlobFileSystemConfiguration").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("nfsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("cifsMountConfiguration").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("azureFileUrl").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("accountKey").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("relativeMountPath").ToString()); + Console.WriteLine(result.GetProperty("mountConfiguration")[0].GetProperty("azureFileShareConfiguration").GetProperty("mountOptions").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("clientId").ToString()); + Console.WriteLine(result.GetProperty("identity").GetProperty("userAssignedIdentities")[0].GetProperty("principalId").ToString()); + Console.WriteLine(result.GetProperty("targetNodeCommunicationMode").ToString()); + Console.WriteLine(result.GetProperty("currentNodeCommunicationMode").ToString()); + } + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_TaskClient.cs b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_TaskClient.cs new file mode 100644 index 000000000000..437786fdb33f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_TaskClient.cs @@ -0,0 +1,1616 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Temp.Batch.Samples +{ + public class Samples_TaskClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Add() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + var data = new + { + id = "", + commandLine = "", + }; + + Response response = client.Add("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Add_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + var data = new + { + id = "", + displayName = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + exitConditions = new + { + exitCodes = new[] { + new { + code = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + exitCodeRanges = new[] { + new { + start = 1234, + end = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + preProcessingError = new + { + jobAction = "none", + dependencyAction = "satisfy", + }, + fileUploadError = new + { + jobAction = "none", + dependencyAction = "satisfy", + }, + @default = new + { + jobAction = "none", + dependencyAction = "satisfy", + }, + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + affinityInfo = new + { + affinityId = "", + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + multiInstanceSettings = new + { + numberOfInstances = 1234, + coordinationCommandLine = "", + commonResourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + dependsOn = new + { + taskIds = new[] { + "" + }, + taskIdRanges = new[] { + new { + start = 1234, + end = 1234, + } + }, + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new + { + access = new[] { + "job" + }, + }, + }; + + Response response = client.Add("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Add_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + var data = new + { + id = "", + commandLine = "", + }; + + Response response = await client.AddAsync("", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Add_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + var data = new + { + id = "", + displayName = "", + commandLine = "", + containerSettings = new + { + containerRunOptions = "", + imageName = "", + registry = new + { + username = "", + password = "", + registryServer = "", + identityReference = new + { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + exitConditions = new + { + exitCodes = new[] { + new { + code = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + exitCodeRanges = new[] { + new { + start = 1234, + end = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + preProcessingError = new + { + jobAction = "none", + dependencyAction = "satisfy", + }, + fileUploadError = new + { + jobAction = "none", + dependencyAction = "satisfy", + }, + @default = new + { + jobAction = "none", + dependencyAction = "satisfy", + }, + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + affinityInfo = new + { + affinityId = "", + }, + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + userIdentity = new + { + username = "", + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + multiInstanceSettings = new + { + numberOfInstances = 1234, + coordinationCommandLine = "", + commonResourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + dependsOn = new + { + taskIds = new[] { + "" + }, + taskIdRanges = new[] { + new { + start = 1234, + end = 1234, + } + }, + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new + { + access = new[] { + "job" + }, + }, + }; + + Response response = await client.AddAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AddCollection() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + var data = new + { + value = new[] { + new { + id = "", + commandLine = "", + } + }, + }; + + Response response = client.AddCollection("", RequestContent.Create(data)); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AddCollection_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + var data = new + { + value = new[] { + new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + exitConditions = new { + exitCodes = new[] { + new { + code = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + exitCodeRanges = new[] { + new { + start = 1234, + end = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + preProcessingError = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + fileUploadError = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + @default = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + affinityInfo = new { + affinityId = "", + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + multiInstanceSettings = new { + numberOfInstances = 1234, + coordinationCommandLine = "", + commonResourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + dependsOn = new { + taskIds = new[] { + "" + }, + taskIdRanges = new[] { + new { + start = 1234, + end = 1234, + } + }, + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, + } + }, + }; + + Response response = client.AddCollection("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("taskId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("message").GetProperty("lang").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("message").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("values")[0].GetProperty("key").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AddCollection_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + var data = new + { + value = new[] { + new { + id = "", + commandLine = "", + } + }, + }; + + Response response = await client.AddCollectionAsync("", RequestContent.Create(data)); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AddCollection_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + var data = new + { + value = new[] { + new { + id = "", + displayName = "", + commandLine = "", + containerSettings = new { + containerRunOptions = "", + imageName = "", + registry = new { + username = "", + password = "", + registryServer = "", + identityReference = new { + resourceId = "", + }, + }, + workingDirectory = "taskWorkingDirectory", + }, + exitConditions = new { + exitCodes = new[] { + new { + code = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + exitCodeRanges = new[] { + new { + start = 1234, + end = 1234, + exitOptions = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + } + }, + preProcessingError = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + fileUploadError = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + @default = new { + jobAction = "none", + dependencyAction = "satisfy", + }, + }, + resourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + outputFiles = new[] { + new { + filePattern = "", + destination = new { + container = new { + path = "", + containerUrl = "", + identityReference = new { + resourceId = "", + }, + uploadHeaders = new[] { + new { + name = "", + value = "", + } + }, + }, + }, + uploadOptions = new { + uploadCondition = "tasksuccess", + }, + } + }, + environmentSettings = new[] { + new { + name = "", + value = "", + } + }, + affinityInfo = new { + affinityId = "", + }, + constraints = new { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + requiredSlots = 1234, + userIdentity = new { + username = "", + autoUser = new { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + multiInstanceSettings = new { + numberOfInstances = 1234, + coordinationCommandLine = "", + commonResourceFiles = new[] { + new { + autoStorageContainerName = "", + storageContainerUrl = "", + httpUrl = "", + blobPrefix = "", + filePath = "", + fileMode = "", + identityReference = new { + resourceId = "", + }, + } + }, + }, + dependsOn = new { + taskIds = new[] { + "" + }, + taskIdRanges = new[] { + new { + start = 1234, + end = 1234, + } + }, + }, + applicationPackageReferences = new[] { + new { + applicationId = "", + version = "", + } + }, + authenticationTokenSettings = new { + access = new[] { + "job" + }, + }, + } + }, + }; + + Response response = await client.AddCollectionAsync("", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("taskId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("message").GetProperty("lang").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("message").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("values")[0].GetProperty("key").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("error").GetProperty("values")[0].GetProperty("value").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Delete() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = client.Delete("", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Delete_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = client.Delete("", "", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Delete_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = await client.DeleteAsync("", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Delete_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = await client.DeleteAsync("", "", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTask() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = client.GetTask("", "", "", "", 1234, DateTimeOffset.UtcNow, null, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("exitOptions").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("exitOptions").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("exitOptions").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("exitOptions").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("preProcessingError").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("preProcessingError").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("fileUploadError").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("fileUploadError").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("default").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("default").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("affinityInfo").GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("requeueCount").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("lastRequeueTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("nodeUrl").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("nodeId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("numberOfInstances").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("coordinationCommandLine").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIds")[0].ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIdRanges")[0].GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIdRanges")[0].GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetTask_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = await client.GetTaskAsync("", "", "", "", 1234, DateTimeOffset.UtcNow, null, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("exitOptions").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("exitOptions").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("exitOptions").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("exitOptions").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("preProcessingError").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("preProcessingError").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("fileUploadError").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("fileUploadError").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("default").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("default").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("affinityInfo").GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("requeueCount").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("lastRequeueTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("nodeUrl").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("nodeId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("numberOfInstances").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("coordinationCommandLine").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIds")[0].ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIdRanges")[0].GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIdRanges")[0].GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Update() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + var data = new { }; + + Response response = client.Update("", "", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Update_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + var data = new + { + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + }; + + Response response = client.Update("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Update_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + var data = new { }; + + Response response = await client.UpdateAsync("", "", RequestContent.Create(data)); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Update_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + var data = new + { + constraints = new + { + maxWallClockTime = "PT1H23M45S", + retentionTime = "PT1H23M45S", + maxTaskRetryCount = 1234, + }, + }; + + Response response = await client.UpdateAsync("", "", RequestContent.Create(data), 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSubtasks() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = client.GetSubtasks("", "", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("nodeUrl").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("nodeId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("result").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetSubtasks_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = await client.GetSubtasksAsync("", "", "", 1234, DateTimeOffset.UtcNow, new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("nodeUrl").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("nodeId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("nodeInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("result").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Terminate() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = client.Terminate("", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Terminate_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = client.Terminate("", "", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Terminate_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = await client.TerminateAsync("", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Terminate_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = await client.TerminateAsync("", "", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Reactivate() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = client.Reactivate("", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Reactivate_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = client.Reactivate("", "", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Reactivate_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = await client.ReactivateAsync("", ""); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Reactivate_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + Response response = await client.ReactivateAsync("", "", 1234, DateTimeOffset.UtcNow, null); + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTasks() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + foreach (var item in client.GetTasks("", "", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("exitOptions").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("exitOptions").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("exitOptions").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("exitOptions").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("preProcessingError").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("preProcessingError").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("fileUploadError").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("fileUploadError").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("default").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("default").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("affinityInfo").GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("requeueCount").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("lastRequeueTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("nodeUrl").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("nodeId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("numberOfInstances").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("coordinationCommandLine").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIds")[0].ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIdRanges")[0].GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIdRanges")[0].GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetTasks_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TaskClient("", credential); + + await foreach (var item in client.GetTasksAsync("", "", "", "", 1234, 1234, DateTimeOffset.UtcNow, new RequestContext())) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("eTag").ToString()); + Console.WriteLine(result.GetProperty("lastModified").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("exitOptions").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodes")[0].GetProperty("exitOptions").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("exitOptions").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("exitCodeRanges")[0].GetProperty("exitOptions").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("preProcessingError").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("preProcessingError").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("fileUploadError").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("fileUploadError").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("default").GetProperty("jobAction").ToString()); + Console.WriteLine(result.GetProperty("exitConditions").GetProperty("default").GetProperty("dependencyAction").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("stateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("previousState").ToString()); + Console.WriteLine(result.GetProperty("previousStateTransitionTime").ToString()); + Console.WriteLine(result.GetProperty("commandLine").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("containerRunOptions").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("imageName").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("password").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("registryServer").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("registry").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("containerSettings").GetProperty("workingDirectory").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("resourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("filePattern").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("path").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("containerUrl").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("destination").GetProperty("container").GetProperty("uploadHeaders")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("outputFiles")[0].GetProperty("uploadOptions").GetProperty("uploadCondition").ToString()); + Console.WriteLine(result.GetProperty("environmentSettings")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("environmentSettings")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("affinityInfo").GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxWallClockTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("retentionTime").ToString()); + Console.WriteLine(result.GetProperty("constraints").GetProperty("maxTaskRetryCount").ToString()); + Console.WriteLine(result.GetProperty("requiredSlots").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("username").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("autoUser").GetProperty("scope").ToString()); + Console.WriteLine(result.GetProperty("userIdentity").GetProperty("autoUser").GetProperty("elevationLevel").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("endTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("exitCode").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("containerInfo").GetProperty("error").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("lastRetryTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("requeueCount").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("lastRequeueTime").ToString()); + Console.WriteLine(result.GetProperty("executionInfo").GetProperty("result").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("affinityId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("nodeUrl").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("poolId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("nodeId").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("taskRootDirectory").ToString()); + Console.WriteLine(result.GetProperty("nodeInfo").GetProperty("taskRootDirectoryUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("numberOfInstances").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("coordinationCommandLine").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("autoStorageContainerName").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("storageContainerUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("httpUrl").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("blobPrefix").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("filePath").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("fileMode").ToString()); + Console.WriteLine(result.GetProperty("multiInstanceSettings").GetProperty("commonResourceFiles")[0].GetProperty("identityReference").GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("startTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("lastUpdateTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("userCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("kernelCPUTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("wallClockTime").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOps").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("readIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("writeIOGiB").ToString()); + Console.WriteLine(result.GetProperty("stats").GetProperty("waitTime").ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIds")[0].ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIdRanges")[0].GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("dependsOn").GetProperty("taskIdRanges")[0].GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("applicationId").ToString()); + Console.WriteLine(result.GetProperty("applicationPackageReferences")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("authenticationTokenSettings").GetProperty("access")[0].ToString()); + } + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_TemplateClient.cs b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_TemplateClient.cs new file mode 100644 index 000000000000..6131f8c3ac56 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Generated/Samples/Samples_TemplateClient.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Template.Samples +{ + public class Samples_TemplateClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSecret() + { + var credential = new DefaultAzureCredential(); + var client = new TemplateClient("", credential); + + Response response = client.GetSecret("", new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSecret_AllParameters() + { + var credential = new DefaultAzureCredential(); + var client = new TemplateClient("", credential); + + Response response = client.GetSecret("", new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("contentType").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("kid").ToString()); + Console.WriteLine(result.GetProperty("managed").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetSecret_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TemplateClient("", credential); + + Response response = await client.GetSecretAsync("", new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_GetSecret_AllParameters_Async() + { + var credential = new DefaultAzureCredential(); + var client = new TemplateClient("", credential); + + Response response = await client.GetSecretAsync("", new RequestContext()); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("contentType").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("kid").ToString()); + Console.WriteLine(result.GetProperty("managed").ToString()); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/Samples/README.md b/sdk/batch/Azure.Temp.Batch/tests/Samples/README.md new file mode 100644 index 000000000000..78c99dc6603e --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Samples/README.md @@ -0,0 +1,3 @@ +Source files in this directory are written as tests from which samples are extracted. +They are not intended to be viewed directly and help ensure our samples compile and work correctly. +See our [list of samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/template/Azure.Template/samples) for more explanation about how to use this client library. diff --git a/sdk/batch/Azure.Temp.Batch/tests/Samples/Sample1_HelloWorld.cs b/sdk/batch/Azure.Temp.Batch/tests/Samples/Sample1_HelloWorld.cs new file mode 100644 index 000000000000..67be8a4caf7b --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Samples/Sample1_HelloWorld.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core; +using Azure.Core.TestFramework; +#region Snippet:Azure_Template +using Azure.Identity; +using Azure.Template.Models; +#endregion +using NUnit.Framework; + +namespace Azure.Template.Tests.Samples +{ + public partial class TemplateSamples: SamplesBase + { + [Test] + [SyncOnly] + public void GettingASecret() + { + #region Snippet:Azure_Template_GetSecret +#if SNIPPET + string endpoint = "https://myvault.vault.azure.net"; + var credential = new DefaultAzureCredential(); +#else + string endpoint = TestEnvironment.KeyVaultUri; + var credential = TestEnvironment.Credential; +#endif + var client = new TemplateClient(endpoint, credential); + + SecretBundle secret = client.GetSecretValue("TestSecret"); + + Console.WriteLine(secret.Value); + #endregion + + Assert.NotNull(secret.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/Samples/Sample1_HelloWorldAsync.cs b/sdk/batch/Azure.Temp.Batch/tests/Samples/Sample1_HelloWorldAsync.cs new file mode 100644 index 000000000000..3fb502e5e38f --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/Samples/Sample1_HelloWorldAsync.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.Template.Models; +using NUnit.Framework; + +namespace Azure.Template.Tests.Samples +{ + public partial class TemplateSamples: SamplesBase + { + [Test] + [AsyncOnly] + public async Task GettingASecretAsync() + { + #region Snippet:Azure_Template_GetSecretAsync +#if SNIPPET + string endpoint = "https://myvault.vault.azure.net"; + var credential = new DefaultAzureCredential(); +#else + string endpoint = TestEnvironment.KeyVaultUri; + var credential = TestEnvironment.Credential; +#endif + var client = new TemplateClient(endpoint, credential); + + SecretBundle secret = await client.GetSecretValueAsync("TestSecret"); + + Console.WriteLine(secret.Value); + #endregion + + Assert.NotNull(secret.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/SessionRecords/TemplateClientLiveTests/CanGetSecret.json b/sdk/batch/Azure.Temp.Batch/tests/SessionRecords/TemplateClientLiveTests/CanGetSecret.json new file mode 100644 index 000000000000..90846a3af8d8 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/SessionRecords/TemplateClientLiveTests/CanGetSecret.json @@ -0,0 +1,50 @@ +{ + "Entries": [ + { + "RequestUri": "https://td6ee755a427d4cbd.vault.azure.net/secrets/TestSecret?api-version=7.0", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-Template/1.0.2-dev.20200824.4", + "(.NET Core 4.6.27514.02; Microsoft Windows 10.0.17763 )" + ], + "x-ms-client-request-id": "2d69f86bb5cd658959d538084efd6435", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "230", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 24 Aug 2020 17:28:34 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-AspNet-Version": "4.0.30319", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=52.188.205.173;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.1.44.0", + "x-ms-request-id": "336162b9-e626-49f9-9ff3-44ace416e108", + "X-Powered-By": "ASP.NET" + }, + "ResponseBody": { + "value": "Very secret value", + "id": "https://td6ee755a427d4cbd.vault.azure.net/secrets/TestSecret/a63ea68be4ec4148b0de05599a163b86", + "attributes": { + "enabled": true, + "created": 1598290014, + "updated": 1598290014, + "recoveryLevel": "Purgeable" + } + } + } + ], + "Variables": { + "KEYVAULT_URL": "https://td6ee755a427d4cbd.vault.azure.net", + "RandomSeed": "1523443367" + } +} \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/tests/SessionRecords/TemplateClientLiveTests/CanGetSecretAsync.json b/sdk/batch/Azure.Temp.Batch/tests/SessionRecords/TemplateClientLiveTests/CanGetSecretAsync.json new file mode 100644 index 000000000000..c0048bce6853 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/SessionRecords/TemplateClientLiveTests/CanGetSecretAsync.json @@ -0,0 +1,50 @@ +{ + "Entries": [ + { + "RequestUri": "https://td6ee755a427d4cbd.vault.azure.net/secrets/TestSecret?api-version=7.0", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-Template/1.0.2-dev.20200824.4", + "(.NET Core 4.6.27514.02; Microsoft Windows 10.0.17763 )" + ], + "x-ms-client-request-id": "b41531fddad5df6f8a3bc26c53829105", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "230", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 24 Aug 2020 17:28:34 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-AspNet-Version": "4.0.30319", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=52.188.205.173;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.1.44.0", + "x-ms-request-id": "f4fdd9a6-9ddf-4ef5-8f2e-3c59cba16c2d", + "X-Powered-By": "ASP.NET" + }, + "ResponseBody": { + "value": "Very secret value", + "id": "https://td6ee755a427d4cbd.vault.azure.net/secrets/TestSecret/a63ea68be4ec4148b0de05599a163b86", + "attributes": { + "enabled": true, + "created": 1598290014, + "updated": 1598290014, + "recoveryLevel": "Purgeable" + } + } + } + ], + "Variables": { + "KEYVAULT_URL": "https://td6ee755a427d4cbd.vault.azure.net", + "RandomSeed": "2070406030" + } +} \ No newline at end of file diff --git a/sdk/batch/Azure.Temp.Batch/tests/TemplateClientLiveTests.cs b/sdk/batch/Azure.Temp.Batch/tests/TemplateClientLiveTests.cs new file mode 100644 index 000000000000..c3b9c332ba60 --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/TemplateClientLiveTests.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; +using Azure.Template.Models; + +namespace Azure.Template.Tests +{ + // When necessary, use the [ClientTestFixture] to test multiple versions. + // See https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core.TestFramework#support-multi-service-version-testing. + public class TemplateClientLiveTests: RecordedTestBase + { + public TemplateClientLiveTests(bool isAsync) + // Delete null and the opening comment to re-record, or change to debug live tests. + // You can also change eng/nunit.runsettings to set the TestMode parameter. + // See https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core.TestFramework#test-settings. + : base(isAsync, null /* RecordedTestMode.Record /* to re-record */) + { + } + + private TemplateClient CreateClient() + { + return InstrumentClient(new TemplateClient( + TestEnvironment.KeyVaultUri, + TestEnvironment.Credential, + InstrumentClientOptions(new TemplateClientOptions()) + )); + } + + [RecordedTest] + public async Task CanGetSecret() + { + TemplateClient client = CreateClient(); + + Response secret = await client.GetSecretValueAsync("TestSecret"); + + Assert.AreEqual("Very secret value", secret.Value.Value); + } + } +} diff --git a/sdk/batch/Azure.Temp.Batch/tests/TemplateClientTestEnvironment.cs b/sdk/batch/Azure.Temp.Batch/tests/TemplateClientTestEnvironment.cs new file mode 100644 index 000000000000..2fb75b1d747a --- /dev/null +++ b/sdk/batch/Azure.Temp.Batch/tests/TemplateClientTestEnvironment.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.Template.Tests +{ + public class TemplateClientTestEnvironment : TestEnvironment + { + public string KeyVaultUri => GetRecordedVariable("KEYVAULT_URL"); + + // You can sanitize secrets from recorded variables e.g., principal secrets. + // See https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core.TestFramework#test-environment-and-live-test-resources for variables, + // and https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core.TestFramework#sanitizing for sanitizing responses. + public string KeyVaultSecret => GetRecordedVariable("KEYVAULT_SECRET", options => options.IsSecret()); + } +}