-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Azure Batch .Net SDK to meet API version 2018-03-01.6.1. #4151
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7dabe3b
Regenerate protocol based on 2018-02 Swagger spec
matthchr e96ba1b
Add object model layer for new APIs
matthchr 64bf723
Update MSBuild version for ProxyLayerParser
matthchr 60e6471
Add tests for new APIs
matthchr 4af0ce7
Update Batch version to 8.1.0
matthchr be75985
Update to latest swagger spec.
xingwu1 9498968
Add AzSdk.RP.props to source.
xingwu1 b8616fc
Move LogUpload test case to IaaS pool.
xingwu1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xingwu1 add package release notes for this new version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shahabhijeet I am not sure about where is the release notes you reference. We did update the changelog.md with this PR.