Skip to content

Commit

Permalink
Update Azure Batch C# library to version 5.0 (#2226)
Browse files Browse the repository at this point in the history
* Update documentation in C# generated protocol

* Add script to regenerate batch protocol

* Add Roslyn parser/code generation

* Regenerate generated protocol with latest AutoRest

* Batch Add CommitChanges support in object model

* Comment tidying

* Fixed spelling error in Batch behavior manager comments

* Removed obsolete comment in regarding Batch CloudJob committal

* Removed comment about not having a CancellationToken (since we now do)

* Regenerate Batch protocol based on newest version of AutoRest

* Fix RoslynParser dll copies

* Regenerate Batch protocol layer with latest AutoRest

* Update to latest AutoRest and regenerate protocol

* Add exception comment for AddTaskCollection

* Add C# ConfigureAwaitAnalyzer for use by Batch

-  Also remove unneeded ConfigureAwait false unit test.

* Move Batch client to subdirectory to allow sibling build scopes

* Azure Batch file conventions library

* Azure Batch file conventions library

* Added portable build config (no-op)

* Added NuGet packaging info

* Renamed UnitTests assembly to Tests to work with Azure SDK test discoverer

* Renamed directory to remove redundant prefix

* Add README.md for Batch

* Add NetworkConfiguration and update required constructors

* Regenerated protocol layer from the vnext swagger branch

* updated autorest version

* Fix RegenerateBatch script

* Add NetworkConfiguration and update required constructors

  - Updated the required constructors for the following classes:
    - JobManagerTask
    - JobPreparationTask
    - JobReleaseTask
    - JobSpecification
    - StartTask
  - Add test which ensures Swagger file has right version
  - Update OM code generator constructor order logic
  - Remove extra commas from BatchProperties.json

* Skip BatchClientVersionIsNot9999 test for now

* Update TaskStateMonitor and improve clarity

- Remove overload of WhenAllAsync to WhenAll
  - The WhenAll method and its overloads had a weird ambiguity where
    depending on if you included a CancellationToken or not, the return type was
    either Task<bool> or Task.  Removed the Task<bool> overload in order to
    remove this ambiguity.
  - Removed previously Obsolete method WaitAllAsync.
  - Removed WaitAll which returns Task<bool>.
  - Update documentation strings for the WhenAll/WaitAll methods.
  - Refactored existing methods to provide an overload which takes a cancellation token,
    and an overload which takes a timeout.  Removed the overload which takes both.

* Updated client to support job auto failure and job auto complete.

* CloudJobIntegrationTests.cs wasn't included in the project.

Termination Reason should be TaskFailed instead of CriticalTaskFailure.
TestUtil new error message  + last observed {cloudJob.State}");

* Azure Batch integration test improvements

- Reduce integration test runtime by refactoring certificate
   tests.
   - Split certificate test into 2 integration tests and some new
     unit tests as well.
   - Stopped the test from allocating a real VM (which reduces test
     run time).
 - Update InterceptorFactory methods to return a collection in order to
   more easily enable usage.

* Update NuGet package version for Batch file conventions preview release

* Update Batch nuspec for 5.0.0 release

* Update PoolState.Active comments

* Update Batch ClientRuntime reference to be 3.3.1

* Add new Batch TaskSchedulingErrorCode

  - Also change test target VM family type to Dv2
  - Remove unneeded RegenerateBatch command script (the correct one
    lives under the Client folder.
  - Fix some minor test issues.

* Delete models which were accidentally added

* Additional utility methods for Batch file conventions

* Added CloudJob extension method to calculate a SAS URL for the container name (suitable for passing to tasks as an environment variable)

* Added helper for uploading text to a blob (will be handy for task parameter JSON)

* Removed borked comment

* Update Batch file conventions library NuGet package version

* Shorten a long line

* Minor documentation fixes

* Batch/feature/app pack on tasks

* Update documentation in C# generated protocol

* Add script to regenerate batch protocol (#7)

* Add Roslyn parser/code generator (#8)

Add Roslyn parser/code generation

* Regenerate generated protocol with latest AutoRest (#9)

* Batch Add CommitChanges support in object model (#11)

* Comment tidying (#10)

* Fixed spelling error in Batch behavior manager comments

* Removed obsolete comment in regarding Batch CloudJob committal

* Removed comment about not having a CancellationToken (since we now do)

* Regenerate Batch protocol based on newest version of AutoRest (#12)

* Fix RoslynParser dll copies

* Regenerate Batch protocol layer with latest AutoRest

* Added APR to a few Tasks in the BatchProperites file

* Add support for job autocomplete

Squashed commit of the following:

commit 9cc1a68afb1090185fd2c9f006beccc0acfeadf2
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Thu Jun 9 09:22:12 2016 +1200

    Started cleaning up a few doc strings

commit a9ebcd69754b81af7db0ed3026feea037ab283d9
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Wed Jun 8 13:44:50 2016 +1200

    Updated a few swagger generated files with autorest.0.17.0-Nightly20160601 build

commit 93b3e8be890cd487070fc92c526a4fd3f8ac3b2b
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Wed Jun 8 13:28:05 2016 +1200

    Splitting up tests in the BindingStateConstraintUnitTests.

commit 46cb5eb34f8142d25b197c4153885f9a19cc0218
Merge: fbb1e78 17badc2
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Tue Jun 7 13:01:27 2016 +1200

    Merge branch 'batch/develop' into batch/feature/job-autocomplete

    # Conflicts:
    #	src/Batch/Src/GeneratedProtocol/Models/CloudJob.cs
    #	src/Batch/Src/GeneratedProtocol/Models/CloudTask.cs
    #	src/Batch/Src/GeneratedProtocol/Models/JobAddParameter.cs
    #	src/Batch/Src/GeneratedProtocol/Models/JobUpdateParameter.cs

commit fbb1e78ad96efd9a730bd89c6fe7e2de25255541
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Tue Jun 7 12:44:24 2016 +1200

    First Code review changes,

commit 76d7e242db5742da96d904aff33ba5c56228177e
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Tue May 31 13:06:01 2016 +1200

    removed remarksComment = null from batchProperties.json

commit 915c2d48a60ff7b45b640fafccc87f52a39285d8
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Tue May 31 13:02:11 2016 +1200

    Forgot copyright notice

commit afc3cb84034ae53047ac86740219591c32605b01
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Tue May 31 12:38:06 2016 +1200

    Added /// into BatchProperties.json file

commit 759d973308ca0da59d43f43040ccec9cc8ad5c62
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Tue May 31 11:56:54 2016 +1200

    Used the most recent autorest build

commit 22bb4a9772de67d4d70627c9d589ef90e620aa05
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Tue May 31 10:59:44 2016 +1200

    Updated generated protocol layer

commit dc678a2bdcb20423358def2893ae1afd98af3919
Merge: 3e01884 8bb4302
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Tue May 31 09:43:51 2016 +1200

    Merge branch 'batch/develop' into batch/feature/job-autocomplete

    Conflicts:
    	src/Batch/Src/GeneratedProtocol/Models/AccountListNodeAgentSkusNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/AccountListNodeAgentSkusOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/AffinityInformation.cs
    	src/Batch/Src/GeneratedProtocol/Models/ApplicationGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ApplicationListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ApplicationListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ApplicationPackageReference.cs
    	src/Batch/Src/GeneratedProtocol/Models/AutoScaleRun.cs
    	src/Batch/Src/GeneratedProtocol/Models/AutoScaleRunError.cs
    	src/Batch/Src/GeneratedProtocol/Models/Certificate.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateAddOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateAddParameter.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateCancelDeletionOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateDeleteOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/CertificateReference.cs
    	src/Batch/Src/GeneratedProtocol/Models/CloudJob.cs
    	src/Batch/Src/GeneratedProtocol/Models/CloudPool.cs
    	src/Batch/Src/GeneratedProtocol/Models/CloudTask.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeAddUserOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeDeleteUserOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeDisableSchedulingOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeEnableSchedulingOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeError.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeGetRemoteDesktopOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeGetRemoteLoginSettingsOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeRebootOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeReimageOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/ComputeNodeUpdateUserOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/DeleteCertificateError.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileDeleteFromComputeNodeOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileDeleteFromTaskOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileGetFromComputeNodeOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileGetFromTaskOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileGetNodeFilePropertiesFromComputeNodeOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileGetNodeFilePropertiesFromTaskOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileListFromComputeNodeNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileListFromComputeNodeOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileListFromTaskNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/FileListFromTaskOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobAddOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobAddParameter.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobDeleteOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobDisableOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobEnableOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobGetAllJobsLifetimeStatisticsOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobListFromJobScheduleNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobListFromJobScheduleOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobListPreparationAndReleaseTaskStatusOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobManagerTask.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobPatchOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobPatchParameter.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobReleaseTask.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleAddOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleDeleteOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleDisableOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleEnableOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleExistsOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobSchedulePatchOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleStatistics.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleTerminateOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobScheduleUpdateOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobSchedulingError.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobSpecification.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobStatistics.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobTerminateOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/JobUpdateOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolAddOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolAddParameter.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolDeleteOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolDisableAutoScaleOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolEnableAutoScaleOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolEvaluateAutoScaleOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolExistsOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolGetAllPoolsLifetimeStatisticsOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolListPoolUsageMetricsNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolListPoolUsageMetricsOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolPatchOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolRemoveNodesOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolResizeOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolStopResizeOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolUpdatePropertiesOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolUpgradeOSOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/PoolUsageMetrics.cs
    	src/Batch/Src/GeneratedProtocol/Models/ResizeError.cs
    	src/Batch/Src/GeneratedProtocol/Models/Schedule.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskAddCollectionOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskAddOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskAddParameter.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskDeleteOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskGetOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskListNextOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskListOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskListSubtasksOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskSchedulingError.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskStatistics.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskTerminateOptions.cs
    	src/Batch/Src/GeneratedProtocol/Models/TaskUpdateOptions.cs

commit 3e01884e53f3d581b98cedef5b8b521af8bde9cf
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Mon May 30 16:49:06 2016 +1200

    Job auto termination code generated code and unit tests added

commit d43eb9291281c3b60885a08a7cfcf2f92aba5009
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Wed May 25 14:44:32 2016 +1200

    Job auto termination all objects generating and mock tests working, still need to fix all the doc strings

commit 1ce64d2c6dd234b6096d8f89814cee3ca0d53a45
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Tue May 24 10:55:43 2016 +1200

    Job auto termination all objects generating, still need to fix read write access and docs.

commit 3ad10ca111acd11fac71a5e2c4922c7d3ceae4f6
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Mon May 23 14:28:58 2016 +1200

    Partial commit: Generated some of the OM code for exitConditions and add job

commit 7e8f3fdedc1b3cb4df9907b849cfea30d1fadc74
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Fri May 13 12:25:29 2016 +1200

    Updated generated files with the new /// comments, error codes also added to the generated files

commit 1d88be3207cf5b4ed5d72ff1f3a51960d1d67b17
Merge: 3650344 d5f52e5
Author: Matthew Rollitt <matthew.rollitt@gmail.com>
Date:   Thu May 12 15:20:26 2016 +1200

    Merge branch 'batch/develop' into batch/feature/job-autocomplete

* Documentation string consistency pass

* APR is only on CloudTask and JobManagerTask

* fixed /// comments and a few tests

* Updated a few doc strings and made a few small changes to the UnitTests

* Updated a few docs and tests

* Updating some doc strings

* A few small changes to the tests

* Small doc changes

* regenerated APR.cs

* more doc clean up and  some code changes

* reversed code path in /program.cs

* cleaning up test methods

* started working on int tests for APR on tasks

* Added integration tests.

* reverted spacing

* small clean up of tests before a CR

* code changes from a CR

* rename test name

* Refactoring a few tests

* void to async signatures

* Code review changes

* just a quick clean up

* WaitForJobStateAsync will now just throw an error if it goes over time

* Regenerated protocol layer from the vnext swagger branch

* Revert "Regenerated protocol layer from the vnext swagger branch"

This reverts commit 4e09b33ff630d1bb3e33155fea1c08c737280bd5.

* Regenerated protocol layer based on v0.17.0-Nightly20160629

* updated autorest version

* Fix RegenerateBatch script

* updated doc strings

* Apr on tasks tests

* Re-worked Integration tests

* A few CR changes

* fixing patch tests

* Small clean up

* cleaned up /// comment on JobAction.cs

* few changes based on matt-c suggestions

* removed commented out code

* Removed src/Batch/RegenerateBatch.cmd

* Regenerated the protocol layer from the swagger spec

* Fix integration tests and delete accidentally duplicated files

* Delete accidentally duplicated files

* Fix integration tests

* Regenerate protocol based on final Swagger spec

* Add license to top of cs files

* Remove SequentialDirectoryStaging.cs
  • Loading branch information
matthchr authored and Hovsep committed Jul 29, 2016
1 parent f3f12ad commit 0c67eb5
Show file tree
Hide file tree
Showing 783 changed files with 23,368 additions and 5,659 deletions.
34 changes: 33 additions & 1 deletion src/Batch/Batch.sln → src/Batch/Client/Batch.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Batch", "Src\Batch.csproj", "{3328FBBF-9C20-4775-B367-856C09DC13BF}"
EndProject
Expand Down Expand Up @@ -40,6 +40,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectModelCodeGenerator",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ObjectModelCodeGenerator", "ObjectModelCodeGenerator", "{380D5910-2411-4E93-AE2B-1533033A8D79}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ProxyLayerParser", "ProxyLayerParser", "{686EAF74-B419-4310-AFD8-3710E8E8061F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxyLayerParser", "Tools\ObjectModelCodeGeneration\RoslynParser\ProxyLayerParser.csproj", "{13A13BB2-684F-4A2B-BCF9-34A9F9616599}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ConfigureAwaitAnalyzer", "ConfigureAwaitAnalyzer", "{D007B9BF-D886-4B0A-87E0-AEB6EFB1390F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfigureAwaitAnalyzer", "Tools\ConfigureAwaitAnalyzer\ConfigureAwaitAnalyzer\ConfigureAwaitAnalyzer.csproj", "{48215D6D-DB21-48B8-AB03-1297A94DF696}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfigureAwaitAnalyzer.Tests", "Tools\ConfigureAwaitAnalyzer\ConfigureAwaitAnalyzer.Tests\ConfigureAwaitAnalyzer.Tests.csproj", "{5F8690AA-765A-4112-8C68-0BB00C322FDB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Net45-Debug|Any CPU = Net45-Debug|Any CPU
Expand Down Expand Up @@ -84,6 +94,23 @@ Global
{8734474A-543E-46C3-8E1B-6B37E4B97C78}.Net45-Release|Any CPU.ActiveCfg = Net45-Release|Any CPU
{8734474A-543E-46C3-8E1B-6B37E4B97C78}.Portable-Debug|Any CPU.ActiveCfg = Portable-Debug|Any CPU
{8734474A-543E-46C3-8E1B-6B37E4B97C78}.Portable-Release|Any CPU.ActiveCfg = Portable-Release|Any CPU
{13A13BB2-684F-4A2B-BCF9-34A9F9616599}.Net45-Debug|Any CPU.ActiveCfg = Net45-Debug|Any CPU
{13A13BB2-684F-4A2B-BCF9-34A9F9616599}.Net45-Debug|Any CPU.Build.0 = Net45-Debug|Any CPU
{13A13BB2-684F-4A2B-BCF9-34A9F9616599}.Net45-Release|Any CPU.ActiveCfg = Net45-Release|Any CPU
{13A13BB2-684F-4A2B-BCF9-34A9F9616599}.Net45-Release|Any CPU.Build.0 = Net45-Release|Any CPU
{13A13BB2-684F-4A2B-BCF9-34A9F9616599}.Portable-Debug|Any CPU.ActiveCfg = Portable-Debug|Any CPU
{13A13BB2-684F-4A2B-BCF9-34A9F9616599}.Portable-Release|Any CPU.ActiveCfg = Portable-Release|Any CPU
{48215D6D-DB21-48B8-AB03-1297A94DF696}.Net45-Debug|Any CPU.ActiveCfg = Net45-Debug|Any CPU
{48215D6D-DB21-48B8-AB03-1297A94DF696}.Net45-Debug|Any CPU.Build.0 = Net45-Debug|Any CPU
{48215D6D-DB21-48B8-AB03-1297A94DF696}.Net45-Release|Any CPU.ActiveCfg = Net45-Release|Any CPU
{48215D6D-DB21-48B8-AB03-1297A94DF696}.Net45-Release|Any CPU.Build.0 = Net45-Release|Any CPU
{48215D6D-DB21-48B8-AB03-1297A94DF696}.Portable-Debug|Any CPU.ActiveCfg = Portable-Debug|Any CPU
{48215D6D-DB21-48B8-AB03-1297A94DF696}.Portable-Release|Any CPU.ActiveCfg = Portable-Release|Any CPU
{5F8690AA-765A-4112-8C68-0BB00C322FDB}.Net45-Debug|Any CPU.ActiveCfg = Net45-Debug|Any CPU
{5F8690AA-765A-4112-8C68-0BB00C322FDB}.Net45-Debug|Any CPU.Build.0 = Net45-Debug|Any CPU
{5F8690AA-765A-4112-8C68-0BB00C322FDB}.Net45-Release|Any CPU.ActiveCfg = Net45-Release|Any CPU
{5F8690AA-765A-4112-8C68-0BB00C322FDB}.Portable-Debug|Any CPU.ActiveCfg = Portable-Debug|Any CPU
{5F8690AA-765A-4112-8C68-0BB00C322FDB}.Portable-Release|Any CPU.ActiveCfg = Portable-Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -105,5 +132,10 @@ Global
{64425AA2-0B20-46B6-8BC6-A4D64C1C50D0} = {CB71AF88-3513-4109-92D4-0BA8770BB454}
{8734474A-543E-46C3-8E1B-6B37E4B97C78} = {380D5910-2411-4E93-AE2B-1533033A8D79}
{380D5910-2411-4E93-AE2B-1533033A8D79} = {CB71AF88-3513-4109-92D4-0BA8770BB454}
{686EAF74-B419-4310-AFD8-3710E8E8061F} = {CB71AF88-3513-4109-92D4-0BA8770BB454}
{13A13BB2-684F-4A2B-BCF9-34A9F9616599} = {686EAF74-B419-4310-AFD8-3710E8E8061F}
{D007B9BF-D886-4B0A-87E0-AEB6EFB1390F} = {3DE96B66-463F-470B-92F2-7284A2DD022C}
{48215D6D-DB21-48B8-AB03-1297A94DF696} = {D007B9BF-D886-4B0A-87E0-AEB6EFB1390F}
{5F8690AA-765A-4112-8C68-0BB00C322FDB} = {D007B9BF-D886-4B0A-87E0-AEB6EFB1390F}
EndGlobalSection
EndGlobal
45 changes: 45 additions & 0 deletions src/Batch/Client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Azure Batch client developer guide
Batch.sln is your one stop shop for all things related to the Azure Batch C# client library. This solution file contains all of the projects affiliated with the Azure Batch client (including testing and tooling).

## Changing the Azure Batch client
Depending on the type of change you want to make, the work required varies. If you follow this process you shouldn't miss anything:

1. Update the Azure Batch Swagger specification, which resides in the [Azure/azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs) GitHub repository.
* Add new entity types into the Swagger specification.
* Add new APIs as path-verb pairs in the Swagger specification.
* Add/remove properties on existing entity types in the Swagger specification.
2. Regenerate the `src\GeneratedProtocol` folder using the steps [below](#the-srcgeneratedprotocol-folder).
3. Update the convenience layer specification file: `Tools\ObjectModelCodeGeneration\ObjectModelCodeGenerator\BatchProperties.json`.
* Add new entities that match the Swagger defined entities.
* Add/remove properties on existing entities as done in the Swagger specification.
4. Regenerate the `src\Generated` folder from the convenience layer specification file using the steps [below](#the-srcgenerated-folder).
5. Add any custom code on the `Generated` objects into `partial` classes located in the `src` directory.
* You might want to do this to add an `[Obsolete]` attribute or to add some helper factory methods.
6. If any APIs have changed, or if new APIs have been added, you must update the following places:
* The `src\IProtocolLayer.cs` interface.
* The `src\ProtocolLayer.cs` class.
* The corresponding operations class, for example `PoolOperations.cs`.
* The corresponding entity which the operation is performed on, for example `CloudPool.cs`.
7. Add tests for your new models and APIs into the correct test projects.
* `Azure.Batch.Unit.Tests` for unit tests. These tests do not have any external dependencies (they run entirely in-memory) and are used in the continuous integration job to validate checkins.
* `BatchClientIntegrationTests` for integration tests. These tests run against a live Azure Batch endpoint and do not run during CI.
* **Note:** You should prefer to add unit tests over integration tests where possible -- integration tests should be reserved for ensuring that the Batch Service accepts the Swagger requests. Testing service behavior should occur in a service test, not the client.

### The `src\GeneratedProtocol` folder
The GeneratedProtocol folder holds the code generated by the AutoRest tool from a Swagger specification. In order to regenerate this code, all you need to do is run: `RegenerateBatch.cmd <Path to Swagger file>`.

You can optionally edit the `RegenerateBatch.cmd` script to point to a newer version of AutoRest if you would like to take advantage of new AutoRest features.

### The `src\Generated` folder
This folder contains the convenience layer models for Azure Batch. It is generated from a custom tool. The custom tool reads a specification file located here: `Tools\ObjectModelCodeGeneration\ObjectModelCodeGenerator\BatchProperties.json`. The convenience layer models require more metadata than the Swagger specification provides, so this file is an extra mapping layer on top of Swagger which provides more detail. **Note:** The `BatchProperties.json` specification file just contains the entities; it doesn't have anything related to the actual APIs.

1. New entities defined in the Swagger specification have to be added here as well. See an existing entity for an example.
2. If the type or name of a property has changed in the underlying Swagger specification, it should be updated here as well.

There are a number of special flags which have meaning in the `BatchProperties.json` file. The easiest way to see a list of what flags are supported and at what level is to look at the backing code generation code:

1. For properties: `Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\PropertyData.cs`
2. For types: `Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\ObjectModelTypeData.cs`

Once `BatchProperties.json` is updated with your changes, mark the `ObjectModelCodeGenerator` as your startup project in Visual Studio and run it -- it will regenerate the contents of the `src\Generated` folder.

5 changes: 5 additions & 0 deletions src/Batch/Client/RegenerateBatch.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
setlocal

..\..\..\tools\autorest.gen.cmd %1 Microsoft.Azure.Batch.Protocol 0.17.0-Nightly20160629 .\src\GeneratedProtocol MICROSOFT_APACHE_NO_VERSION "-ft 1"

endlocal
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Threading;
using Microsoft.Azure.Batch.Common;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Microsoft.Azure.Batch
{
using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Microsoft.Azure.Batch
{
using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Collections;
using System.Collections.Generic;
Expand Down Expand Up @@ -72,7 +86,7 @@ internal BatchClient ParentBatchClient
/// Retrieval is non-atomic; applications are retrieved in pages during enumeration of the collection.</remarks>
public IPagedEnumerable<ApplicationSummary> ListApplicationSummaries(DetailLevel detailLevel = null, IEnumerable<BatchClientBehavior> additionalBehaviors = null)
{
// craft the bahavior manager for this call
// craft the behavior manager for this call
BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors);

PagedEnumerable<ApplicationSummary> enumerable = new PagedEnumerable<ApplicationSummary>(
Expand Down
21 changes: 21 additions & 0 deletions src/Batch/Client/Src/AssemblyAttributes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

using System.Runtime.CompilerServices;

#if CODESIGN
[assembly: InternalsVisibleTo("Azure.Batch.Unit.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
#else
[assembly: InternalsVisibleTo("Azure.Batch.Unit.Tests")]
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Microsoft.Azure.Batch
{
using System.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Microsoft.Azure.Batch
{
using System.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Microsoft.Azure.Batch
{
using System.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Microsoft.Azure.Batch
{
using System.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Microsoft.Azure.Batch
{
using System.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Microsoft.Azure.Batch
{
using System.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Microsoft.Azure.Batch
{
using System.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Microsoft.Azure.Batch
{
using System.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Microsoft.Azure.Batch
{
using System;
Expand Down

0 comments on commit 0c67eb5

Please sign in to comment.