-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Azure Batch .Net SDK to meet API version 2018-03-01.6.1. (#4151)
* Regenerate protocol based on 2018-02 Swagger spec * Add object model layer for new APIs * Update MSBuild version for ProxyLayerParser * Add tests for new APIs * Update Batch version to 8.1.0 - Updated the changelog as well. * Update to latest swagger spec. * Add AzSdk.RP.props to source. * Move LogUpload test case to IaaS pool.
- Loading branch information
1 parent
8043406
commit 25d1754
Showing
139 changed files
with
3,533 additions
and
575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<!--This file and it's contents are updated at build time moving or editing might result in build failure. Take due deligence while editing this file--> | ||
<PropertyGroup> | ||
<AzureApiTag>BatchService_2018-03-01.6.1;</AzureApiTag> | ||
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
src/SDKs/Batch/DataPlane/Azure.Batch/AsyncListPoolNodeCounts.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.Azure.Batch | ||
{ | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Threading; | ||
using Models = Microsoft.Azure.Batch.Protocol.Models; | ||
|
||
internal class AsyncListPoolNodeCountsEnumerator : PagedEnumeratorBase<PoolNodeCounts> | ||
{ | ||
private readonly PoolOperations _parentPoolOperations; | ||
private readonly BehaviorManager _behaviorMgr; | ||
private readonly DetailLevel _detailLevel; | ||
|
||
#region // constructors | ||
|
||
internal AsyncListPoolNodeCountsEnumerator( | ||
PoolOperations parentPoolOperations, | ||
BehaviorManager behaviorMgr, | ||
DetailLevel detailLevel) | ||
{ | ||
_parentPoolOperations = parentPoolOperations; | ||
_behaviorMgr = behaviorMgr; | ||
_detailLevel = detailLevel; | ||
} | ||
|
||
#endregion // constructors | ||
|
||
public override PoolNodeCounts Current // for IPagedEnumerator<T> and IEnumerator<T> | ||
{ | ||
get | ||
{ | ||
// start with the current object off of base | ||
object curObj = base._currentBatch[base._currentIndex]; | ||
|
||
// it must be a protocol object from previous call | ||
Models.PoolNodeCounts protocolObj = curObj as Models.PoolNodeCounts; | ||
|
||
Debug.Assert(null != protocolObj); | ||
|
||
// wrap protocol object | ||
PoolNodeCounts wrapped = new PoolNodeCounts(protocolObj); | ||
|
||
return wrapped; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// fetch another batch of objects from the server | ||
/// </summary> | ||
protected override async System.Threading.Tasks.Task GetNextBatchFromServerAsync(SkipTokenHandler skipHandler, CancellationToken cancellationToken) | ||
{ | ||
do | ||
{ | ||
// start the protocol layer call | ||
var asyncTask = _parentPoolOperations.ParentBatchClient.ProtocolLayer.ListPoolNodeCounts( | ||
skipHandler.SkipToken, | ||
_behaviorMgr, | ||
_detailLevel, | ||
cancellationToken); | ||
|
||
var response = await asyncTask.ConfigureAwait(continueOnCapturedContext: false); | ||
|
||
// remember any skiptoken returned. This also sets the bool | ||
skipHandler.SkipToken = response.Body.NextPageLink; | ||
|
||
// remember the protocol tasks returned | ||
base._currentBatch = null; | ||
|
||
if (null != response.Body.GetEnumerator()) | ||
{ | ||
base._currentBatch = response.Body.ToArray(); | ||
} | ||
} | ||
// it is possible for there to be no results so we keep trying | ||
while (skipHandler.ThereIsMoreData && ((null == _currentBatch) || _currentBatch.Length <= 0)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.