Skip to content

Commit 11567d2

Browse files
authored
Merge pull request #8612 from matthchr/feature/batch-jan-2019
Update Azure Batch cmdlets to latest SDK versions
2 parents 866ef22 + 822429e commit 11567d2

File tree

264 files changed

+12279
-16440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+12279
-16440
lines changed

src/Batch/Batch.Test/ApplicationPackages/GetBatchApplicationPackageCommandTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ public void GetBatchApplicationPackageTest()
4343
{
4444
string accountName = "account01";
4545
string resourceGroup = "resourceGroup";
46-
string applicationId = "test";
46+
string applicationName = "test";
4747
string applicationVersion = "foo";
4848

49-
PSApplicationPackage expected = new PSApplicationPackage() { Id = applicationId, Version = applicationVersion };
50-
batchClientMock.Setup(b => b.GetApplicationPackage(resourceGroup, accountName, applicationId, applicationVersion)).Returns(expected);
49+
PSApplicationPackage expected = new PSApplicationPackage() { Name = applicationVersion };
50+
batchClientMock.Setup(b => b.GetApplicationPackage(resourceGroup, accountName, applicationName, applicationVersion)).Returns(expected);
5151

5252
cmdlet.AccountName = accountName;
5353
cmdlet.ResourceGroupName = resourceGroup;
54-
cmdlet.ApplicationId = applicationId;
54+
cmdlet.ApplicationName = applicationName;
5555
cmdlet.ApplicationVersion = applicationVersion;
5656

5757
cmdlet.ExecuteCmdlet();

src/Batch/Batch.Test/ApplicationPackages/NewBatchApplicationPackageCommandTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ public void UploadBatchApplicationPackageTest()
4444
{
4545
string accountName = "account01";
4646
string resourceGroup = "resourceGroup";
47-
string applicationId = "applicationId";
47+
string applicationName = "applicationName";
4848
string filePath = "~/fake/filepath";
4949
string version = "version";
5050
string format = "zip";
5151

5252
PSApplicationPackage applicationPackageResponse = new PSApplicationPackage();
5353

54-
batchClientMock.Setup(b => b.UploadAndActivateApplicationPackage(resourceGroup, accountName, applicationId, version, filePath, format, false)).Returns(applicationPackageResponse);
54+
batchClientMock.Setup(b => b.UploadAndActivateApplicationPackage(resourceGroup, accountName, applicationName, version, filePath, format, false)).Returns(applicationPackageResponse);
5555

5656
cmdlet.AccountName = accountName;
5757
cmdlet.ResourceGroupName = resourceGroup;
58-
cmdlet.ApplicationId = applicationId;
58+
cmdlet.ApplicationName = applicationName;
5959
cmdlet.FilePath = filePath;
6060
cmdlet.ApplicationVersion = version;
6161
cmdlet.Format = format;
@@ -64,7 +64,7 @@ public void UploadBatchApplicationPackageTest()
6464
commandRuntimeMock.Setup(f => f.ShouldProcess(It.IsAny<string>(), It.IsAny<string>())).Returns(true);
6565
cmdlet.ExecuteCmdlet();
6666

67-
batchClientMock.Verify(b => b.UploadAndActivateApplicationPackage(resourceGroup, accountName, applicationId, version, filePath, format, false), Times.Once());
67+
batchClientMock.Verify(b => b.UploadAndActivateApplicationPackage(resourceGroup, accountName, applicationName, version, filePath, format, false), Times.Once());
6868
}
6969

7070
[Fact]
@@ -73,7 +73,7 @@ public void UploadBatchApplicationPackageNoFilePathProvidedTest()
7373
{
7474
string accountName = "account01";
7575
string resourceGroup = "resourceGroup";
76-
string applicationId = "applicationId";
76+
string applicationName = "applicationName";
7777
string version = "version";
7878
string format = "zip";
7979
string filePath = "";
@@ -82,7 +82,7 @@ public void UploadBatchApplicationPackageNoFilePathProvidedTest()
8282

8383
cmdlet.AccountName = accountName;
8484
cmdlet.ResourceGroupName = resourceGroup;
85-
cmdlet.ApplicationId = applicationId;
85+
cmdlet.ApplicationName = applicationName;
8686
cmdlet.ApplicationVersion = version;
8787
cmdlet.FilePath = filePath;
8888
cmdlet.Format = format;
@@ -98,17 +98,17 @@ public void ActivateApplicationPackageOnly()
9898
{
9999
string accountName = "account01";
100100
string resourceGroup = "resourceGroup";
101-
string applicationId = "applicationId";
101+
string applicationName = "applicationName";
102102
string version = "version";
103103
string format = "zip";
104104

105105
PSApplicationPackage applicationPackageResponse = new PSApplicationPackage();
106106

107-
batchClientMock.Setup(b => b.UploadAndActivateApplicationPackage(resourceGroup, accountName, applicationId, version, null, format, true)).Returns(applicationPackageResponse);
107+
batchClientMock.Setup(b => b.UploadAndActivateApplicationPackage(resourceGroup, accountName, applicationName, version, null, format, true)).Returns(applicationPackageResponse);
108108

109109
cmdlet.AccountName = accountName;
110110
cmdlet.ResourceGroupName = resourceGroup;
111-
cmdlet.ApplicationId = applicationId;
111+
cmdlet.ApplicationName = applicationName;
112112
cmdlet.ApplicationVersion = version;
113113
cmdlet.Format = format;
114114
cmdlet.ActivateOnly = true;
@@ -117,7 +117,7 @@ public void ActivateApplicationPackageOnly()
117117
commandRuntimeMock.Setup(f => f.ShouldProcess(It.IsAny<string>(), It.IsAny<string>())).Returns(true);
118118
cmdlet.ExecuteCmdlet();
119119

120-
batchClientMock.Verify(b => b.UploadAndActivateApplicationPackage(resourceGroup, accountName, applicationId, version, null, format, true), Times.Once());
120+
batchClientMock.Verify(b => b.UploadAndActivateApplicationPackage(resourceGroup, accountName, applicationName, version, null, format, true), Times.Once());
121121
}
122122
}
123123
}

src/Batch/Batch.Test/ApplicationPackages/RemoveBatchApplicationPackageCommandTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ public void DeleteBatchApplicationPackageTest()
4343
{
4444
string accountName = "account01";
4545
string resourceGroup = "resourceGroup";
46-
string applicationId = "applicationId";
46+
string applicationName = "applicationName";
4747
string version = "version";
4848

4949
cmdlet.AccountName = accountName;
5050
cmdlet.ResourceGroupName = resourceGroup;
51-
cmdlet.ApplicationId = applicationId;
51+
cmdlet.ApplicationName = applicationName;
5252
cmdlet.ApplicationVersion = version;
5353

5454
commandRuntimeMock.Setup(f => f.ShouldProcess(It.IsAny<string>(), It.IsAny<string>())).Returns(true);
5555
cmdlet.ExecuteCmdlet();
5656

57-
batchClientMock.Verify(b => b.DeleteApplicationPackage(resourceGroup, accountName, applicationId, version), Times.Once());
57+
batchClientMock.Verify(b => b.DeleteApplicationPackage(resourceGroup, accountName, applicationName, version), Times.Once());
5858
}
5959
}
6060
}

src/Batch/Batch.Test/Applications/GetBatchApplicationCommandTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ public void GetBatchApplicationTest()
7171
{
7272
string accountName = "account01";
7373
string resourceGroup = "resourceGroup";
74-
string applicationId = "applicationId";
74+
string applicationName = "applicationName";
7575

7676
PSApplication expected = new PSApplication();
77-
batchClientMock.Setup(b => b.GetApplication(resourceGroup, accountName, applicationId)).Returns(expected);
77+
batchClientMock.Setup(b => b.GetApplication(resourceGroup, accountName, applicationName)).Returns(expected);
7878

7979
cmdlet.AccountName = accountName;
8080
cmdlet.ResourceGroupName = resourceGroup;
81-
cmdlet.ApplicationId = applicationId;
81+
cmdlet.ApplicationName = applicationName;
8282

8383
cmdlet.ExecuteCmdlet();
8484

src/Batch/Batch.Test/Applications/NewBatchApplicationCommandTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ public void AddBatchApplicationTest()
4444
{
4545
string accountName = "account01";
4646
string resourceGroup = "resourceGroup";
47-
string applicationId = "applicationId";
47+
string applicationName = "applicationName";
4848
string displayName = "displayName";
4949

5050
PSApplication expected = new PSApplication();
5151

52-
batchClientMock.Setup(b => b.AddApplication(resourceGroup, accountName, applicationId, true, displayName)).Returns(expected);
52+
batchClientMock.Setup(b => b.AddApplication(resourceGroup, accountName, applicationName, true, displayName)).Returns(expected);
5353

5454
cmdlet.ResourceGroupName = resourceGroup;
5555
cmdlet.AccountName = accountName;
56-
cmdlet.ApplicationId = applicationId;
56+
cmdlet.ApplicationName = applicationName;
5757
cmdlet.AllowUpdates = true;
5858
cmdlet.DisplayName = displayName;
5959

@@ -68,16 +68,16 @@ public void AddBatchApplicationTestWithoutAllowUpdates()
6868
{
6969
string accountName = "account01";
7070
string resourceGroup = "resourceGroup";
71-
string applicationId = "applicationId";
71+
string applicationName = "applicationName";
7272
string displayName = "displayName";
7373

7474
PSApplication expected = new PSApplication();
7575

76-
batchClientMock.Setup(b => b.AddApplication(resourceGroup, accountName, applicationId, null, displayName)).Returns(expected);
76+
batchClientMock.Setup(b => b.AddApplication(resourceGroup, accountName, applicationName, null, displayName)).Returns(expected);
7777

7878
cmdlet.ResourceGroupName = resourceGroup;
7979
cmdlet.AccountName = accountName;
80-
cmdlet.ApplicationId = applicationId;
80+
cmdlet.ApplicationName = applicationName;
8181

8282
cmdlet.DisplayName = displayName;
8383

src/Batch/Batch.Test/Applications/RemoveBatchApplicationCommandTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ public void DeleteBatchApplicationTest()
4343
{
4444
string accountName = "account01";
4545
string resourceGroup = "resourceGroup";
46-
string applicationId = "applicationId";
46+
string applicationName = "applicationName";
4747

4848
cmdlet.AccountName = accountName;
4949
cmdlet.ResourceGroupName = resourceGroup;
50-
cmdlet.ApplicationId = applicationId;
50+
cmdlet.ApplicationName = applicationName;
5151

5252
commandRuntimeMock.Setup(f => f.ShouldProcess(It.IsAny<string>(), It.IsAny<string>())).Returns(true);
5353
cmdlet.ExecuteCmdlet();
5454

55-
batchClientMock.Verify(b => b.DeleteApplication(resourceGroup, accountName, applicationId), Times.Once());
55+
batchClientMock.Verify(b => b.DeleteApplication(resourceGroup, accountName, applicationName), Times.Once());
5656
}
5757
}
5858
}

src/Batch/Batch.Test/Applications/SetBatchApplicationCommandTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@ public void UpdateBatchApplicationTest()
4343
{
4444
string accountName = "account01";
4545
string resourceGroup = "resourceGroup";
46-
string applicationId = "applicationId";
46+
string applicationName = "applicationName";
4747
string displayName = "name";
4848
string defaultVersion = "version";
4949

5050
cmdlet.AccountName = accountName;
5151
cmdlet.ResourceGroupName = resourceGroup;
52-
cmdlet.ApplicationId = applicationId;
52+
cmdlet.ApplicationName = applicationName;
5353
cmdlet.AllowUpdates = true;
5454
cmdlet.DefaultVersion = defaultVersion;
5555
cmdlet.DisplayName = displayName;
5656

5757
commandRuntimeMock.Setup(f => f.ShouldProcess(It.IsAny<string>(), It.IsAny<string>())).Returns(true);
5858
cmdlet.ExecuteCmdlet();
5959

60-
batchClientMock.Verify(b => b.UpdateApplication(resourceGroup, accountName, applicationId, true, defaultVersion, displayName), Times.Once());
60+
batchClientMock.Verify(b => b.UpdateApplication(resourceGroup, accountName, applicationName, true, defaultVersion, displayName), Times.Once());
6161
}
6262

6363
[Fact]
@@ -66,17 +66,17 @@ public void UpdateBatchApplicationAllowUpdatesOnlyTest()
6666
{
6767
string accountName = "account01";
6868
string resourceGroup = "resourceGroup";
69-
string applicationId = "applicationId";
69+
string applicationName = "applicationName";
7070

7171
cmdlet.AccountName = accountName;
7272
cmdlet.ResourceGroupName = resourceGroup;
73-
cmdlet.ApplicationId = applicationId;
73+
cmdlet.ApplicationName = applicationName;
7474
cmdlet.AllowUpdates = true;
7575

7676
commandRuntimeMock.Setup(f => f.ShouldProcess(It.IsAny<string>(), It.IsAny<string>())).Returns(true);
7777
cmdlet.ExecuteCmdlet();
7878

79-
batchClientMock.Verify(b => b.UpdateApplication(resourceGroup, accountName, applicationId, true, null, null), Times.Once());
79+
batchClientMock.Verify(b => b.UpdateApplication(resourceGroup, accountName, applicationName, true, null, null), Times.Once());
8080
}
8181

8282
[Fact]
@@ -85,16 +85,16 @@ public void UpdateBatchApplicationDefault()
8585
{
8686
string accountName = "account01";
8787
string resourceGroup = "resourceGroup";
88-
string applicationId = "applicationId";
88+
string applicationName = "applicationName";
8989

9090
cmdlet.AccountName = accountName;
9191
cmdlet.ResourceGroupName = resourceGroup;
92-
cmdlet.ApplicationId = applicationId;
92+
cmdlet.ApplicationName = applicationName;
9393

9494
commandRuntimeMock.Setup(f => f.ShouldProcess(It.IsAny<string>(), It.IsAny<string>())).Returns(true);
9595
cmdlet.ExecuteCmdlet();
9696

97-
batchClientMock.Verify(b => b.UpdateApplication(resourceGroup, accountName, applicationId, null, null, null), Times.Once());
97+
batchClientMock.Verify(b => b.UpdateApplication(resourceGroup, accountName, applicationName, null, null, null), Times.Once());
9898
}
9999
}
100100
}

src/Batch/Batch.Test/Batch.Test.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<PsModuleName>Batch</PsModuleName>
@@ -14,9 +14,8 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.Azure.Batch" Version="9.0.1" />
18-
<PackageReference Include="Microsoft.Azure.Management.Batch" Version="4.2.1" />
19-
<PackageReference Include="Microsoft.Extensions.Primitives" Version="2.1.1" />
17+
<PackageReference Include="Microsoft.Azure.Batch" Version="10.1.0" />
18+
<PackageReference Include="Microsoft.Azure.Management.Batch" Version="7.0.0" />
2019
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />
2120
</ItemGroup>
2221

src/Batch/Batch.Test/BatchTestHelpers.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public static BatchAccount CreateAccountResource(string accountName, string reso
5959
string id = string.Format("id/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Batch/batchAccounts/abc", subscription, resourceGroup);
6060

6161
BatchAccount resource = new BatchAccount(
62-
coreQuota: DefaultQuotaCount,
62+
dedicatedCoreQuota: DefaultQuotaCount,
63+
lowPriorityCoreQuota: DefaultQuotaCount,
6364
poolQuota: DefaultQuotaCount,
6465
activeJobAndJobScheduleQuota: DefaultQuotaCount,
6566
accountEndpoint: endpoint,

0 commit comments

Comments
 (0)