diff --git a/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj b/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj
index ad442753231e..85b805df9968 100644
--- a/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj
+++ b/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj
@@ -69,7 +69,7 @@
False
- ..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
False
diff --git a/src/Common/Commands.Common.Storage/packages.config b/src/Common/Commands.Common.Storage/packages.config
index 44fd74ae3f2e..d78b88c64d24 100644
--- a/src/Common/Commands.Common.Storage/packages.config
+++ b/src/Common/Commands.Common.Storage/packages.config
@@ -4,7 +4,7 @@
-
+
diff --git a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj
index cf9c91b8b8dd..d1360309f997 100644
--- a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj
+++ b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj
@@ -51,7 +51,7 @@
False
- ..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
..\..\packages\Microsoft.Azure.Test.Framework.1.0.5896.19355-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
diff --git a/src/Common/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj b/src/Common/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj
index 59487e95920e..eaef115a9298 100644
--- a/src/Common/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj
+++ b/src/Common/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj
@@ -66,7 +66,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5896.19355-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
diff --git a/src/Common/Storage/Commands.Storage/Commands.Storage.csproj b/src/Common/Storage/Commands.Storage/Commands.Storage.csproj
index 392777e2da2a..792c70a294a3 100644
--- a/src/Common/Storage/Commands.Storage/Commands.Storage.csproj
+++ b/src/Common/Storage/Commands.Storage/Commands.Storage.csproj
@@ -59,7 +59,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
False
diff --git a/src/Common/Storage/Commands.Storage/packages.config b/src/Common/Storage/Commands.Storage/packages.config
index 53fd826d967a..6d108f9d0d3f 100644
--- a/src/Common/Storage/Commands.Storage/packages.config
+++ b/src/Common/Storage/Commands.Storage/packages.config
@@ -4,7 +4,7 @@
-
+
diff --git a/src/ResourceManager.ForRefactoringOnly.sln b/src/ResourceManager.ForRefactoringOnly.sln
index 8aea0bdc591a..f271e9dc0a97 100644
--- a/src/ResourceManager.ForRefactoringOnly.sln
+++ b/src/ResourceManager.ForRefactoringOnly.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
-VisualStudioVersion = 12.0.40629.0
+VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8531411A-0137-4E27-9C5E-49E07C245048}"
ProjectSection(SolutionItems) = preProject
@@ -143,6 +143,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureStackStorage"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureStackStorage.Test", "ResourceManager\AzureStackStorage\Commands.AzureStackStorage.Tests\Commands.AzureStackStorage.Test.csproj", "{53ED0604-8774-4B46-BB26-6AA5A6327A7C}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.LogicApp.Test", "ResourceManager\LogicApp\Commands.LogicApp.Test\Commands.LogicApp.Test.csproj", "{F1F11BB1-592B-45A3-844C-7F8A585AD107}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.LogicApp", "ResourceManager\LogicApp\Commands.LogicApp\Commands.LogicApp.csproj", "{FFE4E475-B32C-4F89-9D52-F7CEBF709C74}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -413,6 +417,14 @@ Global
{53ED0604-8774-4B46-BB26-6AA5A6327A7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53ED0604-8774-4B46-BB26-6AA5A6327A7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53ED0604-8774-4B46-BB26-6AA5A6327A7C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F1F11BB1-592B-45A3-844C-7F8A585AD107}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F1F11BB1-592B-45A3-844C-7F8A585AD107}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F1F11BB1-592B-45A3-844C-7F8A585AD107}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F1F11BB1-592B-45A3-844C-7F8A585AD107}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FFE4E475-B32C-4F89-9D52-F7CEBF709C74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FFE4E475-B32C-4F89-9D52-F7CEBF709C74}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FFE4E475-B32C-4F89-9D52-F7CEBF709C74}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FFE4E475-B32C-4F89-9D52-F7CEBF709C74}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -446,5 +458,6 @@ Global
{B0D03ECF-9F25-499A-BE25-D668E0D208AA} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{E6122DB1-1466-47EE-8BA0-73F9CA90F826} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{53ED0604-8774-4B46-BB26-6AA5A6327A7C} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
+ {F1F11BB1-592B-45A3-844C-7F8A585AD107} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
EndGlobalSection
EndGlobal
diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj
index 7c9040d9712a..9dc5cbc19f67 100644
--- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj
+++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj
@@ -72,7 +72,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
False
diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/packages.config b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/packages.config
index d7f5ae61aee9..e5fb1436febc 100644
--- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/packages.config
+++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/packages.config
@@ -6,7 +6,7 @@
-
+
diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj
index 0632ec4c00c8..9396572e5adb 100644
--- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj
+++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj
@@ -65,7 +65,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
False
diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/ScenarioTests/ApiManagementTests.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/ScenarioTests/ApiManagementTests.cs
index ba56c90dd228..a94bf613d8ae 100644
--- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/ScenarioTests/ApiManagementTests.cs
+++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/ScenarioTests/ApiManagementTests.cs
@@ -156,8 +156,12 @@ private void RunPowerShellTest(params string[] scripts)
// "SubscriptionId=;Environment=");
#endif
Dictionary d = new Dictionary();
- d.Add("Microsoft.Authorization", "2014-07-01-preview");
- HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(false, d);
+ d.Add("Microsoft.Resources", null);
+ d.Add("Microsoft.Features", null);
+ d.Add("Microsoft.Authorization", null);
+ var providersToIgnore = new Dictionary();
+ providersToIgnore.Add("Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01");
+ HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);
using (var context = UndoContext.Current)
{
diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/packages.config b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/packages.config
index 6f6dec3b319b..fcd98e67a83d 100644
--- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/packages.config
+++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/packages.config
@@ -5,7 +5,7 @@
-
+
diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj b/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj
index b35416f56b64..2118d63c73ca 100644
--- a/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj
+++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj
@@ -68,7 +68,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
False
diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement/packages.config b/src/ResourceManager/ApiManagement/Commands.ApiManagement/packages.config
index d7f5ae61aee9..e5fb1436febc 100644
--- a/src/ResourceManager/ApiManagement/Commands.ApiManagement/packages.config
+++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement/packages.config
@@ -6,7 +6,7 @@
-
+
diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Commands.ApiManagement.ServiceManagement.Test.csproj b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Commands.ApiManagement.ServiceManagement.Test.csproj
index b84315d6e3dc..8de40d539bda 100644
--- a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Commands.ApiManagement.ServiceManagement.Test.csproj
+++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Commands.ApiManagement.ServiceManagement.Test.csproj
@@ -65,7 +65,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
False
diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/packages.config b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/packages.config
index b12f925d6336..157b94fd576e 100644
--- a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/packages.config
+++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/packages.config
@@ -6,7 +6,7 @@
-
+
diff --git a/src/ResourceManager/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj b/src/ResourceManager/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj
index baac20f06cec..f0994da89acc 100644
--- a/src/ResourceManager/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj
+++ b/src/ResourceManager/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj
@@ -64,7 +64,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
False
diff --git a/src/ResourceManager/Automation/Commands.Automation.Test/packages.config b/src/ResourceManager/Automation/Commands.Automation.Test/packages.config
index 5bacf249b68a..3a9b7b2bf715 100644
--- a/src/ResourceManager/Automation/Commands.Automation.Test/packages.config
+++ b/src/ResourceManager/Automation/Commands.Automation.Test/packages.config
@@ -3,7 +3,7 @@
-
+
diff --git a/src/ResourceManager/Automation/Commands.Automation/Commands.Automation.csproj b/src/ResourceManager/Automation/Commands.Automation/Commands.Automation.csproj
index fe1855d46396..204ad4ea595c 100644
--- a/src/ResourceManager/Automation/Commands.Automation/Commands.Automation.csproj
+++ b/src/ResourceManager/Automation/Commands.Automation/Commands.Automation.csproj
@@ -65,7 +65,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
diff --git a/src/ResourceManager/Automation/Commands.Automation/packages.config b/src/ResourceManager/Automation/Commands.Automation/packages.config
index 797e9d57dd6f..544192297b83 100644
--- a/src/ResourceManager/Automation/Commands.Automation/packages.config
+++ b/src/ResourceManager/Automation/Commands.Automation/packages.config
@@ -4,7 +4,7 @@
-
+
diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Commands.AzureBackup.Test.csproj b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Commands.AzureBackup.Test.csproj
index b2b62bdc097c..6a703e32a3b4 100644
--- a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Commands.AzureBackup.Test.csproj
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Commands.AzureBackup.Test.csproj
@@ -42,7 +42,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
..\..\..\packages\Hyak.Common.1.0.3\lib\portable-net403+win+wpa81\Hyak.Common.dll
diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/packages.config b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/packages.config
index ed1ab791a440..3d5dd8c72913 100644
--- a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/packages.config
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/packages.config
@@ -4,7 +4,7 @@
-
+
diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj
index c4de70a8c2c4..0d42fa3d996c 100644
--- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj
@@ -58,7 +58,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.18.206251556\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/packages.config b/src/ResourceManager/AzureBackup/Commands.AzureBackup/packages.config
index 08c86a055067..9d96552cc15f 100644
--- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/packages.config
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/packages.config
@@ -4,7 +4,7 @@
-
+
diff --git a/src/ResourceManager/AzureBatch/Commands.Batch.Test/Commands.Batch.Test.csproj b/src/ResourceManager/AzureBatch/Commands.Batch.Test/Commands.Batch.Test.csproj
index 061d92086ad1..6132a8200610 100644
--- a/src/ResourceManager/AzureBatch/Commands.Batch.Test/Commands.Batch.Test.csproj
+++ b/src/ResourceManager/AzureBatch/Commands.Batch.Test/Commands.Batch.Test.csproj
@@ -64,7 +64,7 @@
..\..\..\packages\Microsoft.Azure.Management.Batch.1.5.0\lib\net40\Microsoft.Azure.Management.Batch.dll
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
False
diff --git a/src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/BatchController.cs b/src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/BatchController.cs
index 1daa64b3a5f5..dd41d5473793 100644
--- a/src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/BatchController.cs
+++ b/src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/BatchController.cs
@@ -75,8 +75,13 @@ public void RunPsTestWorkflow(
string mockName)
{
Dictionary d = new Dictionary();
- d.Add("Microsoft.Authorization", "2014-07-01-preview");
- HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(false, d);
+ d.Add("Microsoft.Resources", null);
+ d.Add("Microsoft.Features", null);
+ d.Add("Microsoft.Authorization", null);
+ var providersToIgnore = new Dictionary();
+ providersToIgnore.Add("Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01");
+ HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);
+
using (UndoContext context = UndoContext.Current)
{
context.Start(callingClassType, mockName);
@@ -88,11 +93,11 @@ public void RunPsTestWorkflow(
var callingClassName = callingClassType
.Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries)
.Last();
- helper.SetupModules(AzureModule.AzureResourceManager,
- "ScenarioTests\\Common.ps1",
- "ScenarioTests\\" + callingClassName + ".ps1",
+ helper.SetupModules(AzureModule.AzureResourceManager,
+ "ScenarioTests\\Common.ps1",
+ "ScenarioTests\\" + callingClassName + ".ps1",
"Microsoft.Azure.Commands.Batch.Test.dll",
- helper.RMProfileModule,
+ helper.RMProfileModule,
helper.RMResourceModule,
helper.GetRMModulePath("AzureRM.Batch.psd1"));
diff --git a/src/ResourceManager/AzureBatch/Commands.Batch.Test/packages.config b/src/ResourceManager/AzureBatch/Commands.Batch.Test/packages.config
index 12de06b1b786..a5f1eb61a9d5 100644
--- a/src/ResourceManager/AzureBatch/Commands.Batch.Test/packages.config
+++ b/src/ResourceManager/AzureBatch/Commands.Batch.Test/packages.config
@@ -8,7 +8,7 @@
-
+
diff --git a/src/ResourceManager/AzureBatch/Commands.Batch/Commands.Batch.csproj b/src/ResourceManager/AzureBatch/Commands.Batch/Commands.Batch.csproj
index e9f788090696..ae925d5bcd4d 100644
--- a/src/ResourceManager/AzureBatch/Commands.Batch/Commands.Batch.csproj
+++ b/src/ResourceManager/AzureBatch/Commands.Batch/Commands.Batch.csproj
@@ -58,7 +58,7 @@
..\..\..\packages\Microsoft.Azure.Management.Batch.1.5.0\lib\net40\Microsoft.Azure.Management.Batch.dll
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
diff --git a/src/ResourceManager/AzureBatch/Commands.Batch/packages.config b/src/ResourceManager/AzureBatch/Commands.Batch/packages.config
index 7db956ba467d..7a6f18bce39a 100644
--- a/src/ResourceManager/AzureBatch/Commands.Batch/packages.config
+++ b/src/ResourceManager/AzureBatch/Commands.Batch/packages.config
@@ -6,7 +6,7 @@
-
+
diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin.Test/Commands.AzureStackAdmin.Test.csproj b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin.Test/Commands.AzureStackAdmin.Test.csproj
index e3292fe3d654..26f58c0310a0 100644
--- a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin.Test/Commands.AzureStackAdmin.Test.csproj
+++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin.Test/Commands.AzureStackAdmin.Test.csproj
@@ -75,7 +75,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.14-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
False
diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin.Test/Common/Commands.AzureStackAdmin.Test.Common.csproj b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin.Test/Common/Commands.AzureStackAdmin.Test.Common.csproj
index 11e375f946a7..32eca7b262cb 100644
--- a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin.Test/Common/Commands.AzureStackAdmin.Test.Common.csproj
+++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin.Test/Common/Commands.AzureStackAdmin.Test.Common.csproj
@@ -52,7 +52,7 @@
..\..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll
- ..\..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.14-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
..\..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.18.206251556\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/Commands.AzureStackStorage.Test.csproj b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/Commands.AzureStackStorage.Test.csproj
index 153e6ab00306..37801ca8f9ba 100644
--- a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/Commands.AzureStackStorage.Test.csproj
+++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/Commands.AzureStackStorage.Test.csproj
@@ -57,7 +57,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.14-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
False
diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/packages.config b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/packages.config
index ff450e8e28d4..683d878e6f36 100644
--- a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/packages.config
+++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/packages.config
@@ -3,7 +3,7 @@
-
+
diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Commands.AzureStackStorage.csproj b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Commands.AzureStackStorage.csproj
index d9434e32cfcb..36d4b3acd9c5 100644
--- a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Commands.AzureStackStorage.csproj
+++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Commands.AzureStackStorage.csproj
@@ -72,7 +72,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.14-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
False
diff --git a/src/ResourceManager/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj b/src/ResourceManager/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj
index 2cf2b374e48a..200e0af21f73 100644
--- a/src/ResourceManager/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj
+++ b/src/ResourceManager/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj
@@ -66,7 +66,7 @@
..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.16-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
True
diff --git a/src/ResourceManager/Common/Commands.ResourceManager.Common/packages.config b/src/ResourceManager/Common/Commands.ResourceManager.Common/packages.config
index 3634a840964a..232c36758457 100644
--- a/src/ResourceManager/Common/Commands.ResourceManager.Common/packages.config
+++ b/src/ResourceManager/Common/Commands.ResourceManager.Common/packages.config
@@ -5,7 +5,7 @@
-
+
diff --git a/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Commands.ScenarioTests.ResourceManager.Common.csproj b/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Commands.ScenarioTests.ResourceManager.Common.csproj
index 3a1d2e76c442..ef8b73a52b59 100644
--- a/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Commands.ScenarioTests.ResourceManager.Common.csproj
+++ b/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Commands.ScenarioTests.ResourceManager.Common.csproj
@@ -50,7 +50,7 @@
..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.14-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
True
diff --git a/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/EnvironmentSetupHelper.cs b/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/EnvironmentSetupHelper.cs
index fed88b9ad56d..e141f73500ab 100644
--- a/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/EnvironmentSetupHelper.cs
+++ b/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/EnvironmentSetupHelper.cs
@@ -64,7 +64,7 @@ public EnvironmentSetupHelper()
AzureRmProfileProvider.Instance.Profile = rmprofile;
}
- AzureSession.DataStore = datastore;
+ AzureSession.DataStore = datastore;
ProfileClient = new ProfileClient(profile);
// Ignore SSL errors
@@ -78,7 +78,7 @@ public string RMProfileModule
{
get
{
- return Path.Combine(this.PackageDirectory,
+ return Path.Combine(this.PackageDirectory,
@"ResourceManager\AzureResourceManager\AzureRM.Profile\AzureRM.Profile.psd1");
}
}
@@ -96,7 +96,7 @@ public string RMStorageModule
{
get
{
- return Path.Combine(this.PackageDirectory,
+ return Path.Combine(this.PackageDirectory,
@"ResourceManager\AzureResourceManager\AzureRM.Storage\AzureRM.Storage.psd1");
}
}
@@ -114,8 +114,8 @@ public string RMStorageDataPlaneModule
public string GetRMModulePath(string psd1FileName)
{
string basename = Path.GetFileNameWithoutExtension(psd1FileName);
- return Path.Combine(this.PackageDirectory,
- @"ResourceManager\AzureResourceManager\" + basename + @"\" + psd1FileName);
+ return Path.Combine(this.PackageDirectory,
+ @"ResourceManager\AzureResourceManager\" + basename + @"\" + psd1FileName);
}
///
/// Loads DummyManagementClientHelper with clients and throws exception if any client is missing.
@@ -148,7 +148,7 @@ private void SetupAzureEnvironmentFromEnvironmentVariables(AzureModule mode)
if (mode == AzureModule.AzureResourceManager)
{
currentEnvironment = new CSMTestEnvironmentFactory().GetTestEnvironment();
- }
+ }
else
{
currentEnvironment = new RDFETestEnvironmentFactory().GetTestEnvironment();
@@ -169,7 +169,7 @@ private void SetupAzureEnvironmentFromEnvironmentVariables(AzureModule mode)
environment.Endpoints[AzureEnvironment.Endpoint.ServiceManagement] = currentEnvironment.BaseUri.AbsoluteUri;
environment.Endpoints[AzureEnvironment.Endpoint.ResourceManager] = currentEnvironment.Endpoints.ResourceManagementUri.AbsoluteUri;
environment.Endpoints[AzureEnvironment.Endpoint.Graph] = currentEnvironment.Endpoints.GraphUri.AbsoluteUri;
- environment.Endpoints[AzureEnvironment.Endpoint.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix] = currentEnvironment.Endpoints.DataLakeAnalyticsJobAndCatalogServiceUri.OriginalString.Replace("https://",""); // because it is just a sufix
+ environment.Endpoints[AzureEnvironment.Endpoint.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix] = currentEnvironment.Endpoints.DataLakeAnalyticsJobAndCatalogServiceUri.OriginalString.Replace("https://", ""); // because it is just a sufix
environment.Endpoints[AzureEnvironment.Endpoint.AzureDataLakeStoreFileSystemEndpointSuffix] = currentEnvironment.Endpoints.DataLakeStoreServiceUri.OriginalString.Replace("https://", ""); // because it is just a sufix
if (!ProfileClient.Profile.Environments.ContainsKey(testEnvironmentName))
@@ -266,7 +266,7 @@ public void SetupModules(AzureModule mode, params string[] modules)
{
this.modules.Add(Path.Combine(PackageDirectory, @"ServiceManagement\Azure\Azure.psd1"));
}
-
+
this.modules.Add("Assert.ps1");
this.modules.Add("Common.ps1");
this.modules.AddRange(modules);
@@ -307,9 +307,18 @@ public void SetupModules(params string[] modules)
public virtual Collection RunPowerShellTest(params string[] scripts)
{
+ Dictionary d = new Dictionary();
+ d.Add("Microsoft.Resources", null);
+ d.Add("Microsoft.Features", null);
+ d.Add("Microsoft.Authorization", null);
+ d.Add("Microsoft.Compute", null);
+ var providersToIgnore = new Dictionary();
+ providersToIgnore.Add("Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01");
+ HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);
+
using (var powershell = System.Management.Automation.PowerShell.Create(RunspaceMode.NewRunspace))
{
- SetupPowerShellModules(powershell);
+ SetupPowerShellModules(powershell);
Collection output = null;
for (int i = 0; i < scripts.Length; ++i)
@@ -352,8 +361,8 @@ private void SetupPowerShellModules(System.Management.Automation.PowerShell powe
foreach (string moduleName in modules)
{
- powershell.AddScript(string.Format("Import-Module \"{0}\"",
- Path.Combine(AppDomain.CurrentDomain.BaseDirectory,moduleName)));
+ powershell.AddScript(string.Format("Import-Module \"{0}\"",
+ Path.Combine(AppDomain.CurrentDomain.BaseDirectory, moduleName)));
}
powershell.AddScript(
diff --git a/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/PermissiveRecordMatcherWithApiExclusion.cs b/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/PermissiveRecordMatcherWithApiExclusion.cs
index f7b3046c2ada..31658f02d8e5 100644
--- a/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/PermissiveRecordMatcherWithApiExclusion.cs
+++ b/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/PermissiveRecordMatcherWithApiExclusion.cs
@@ -106,7 +106,14 @@ public string GetMatchingKey(RecordEntry recordEntry)
private bool ContainsIgnoredProvider(string requestUri, out string version)
{
- if (_ignoreGenericResource && !requestUri.Contains("providers"))
+ if (_ignoreGenericResource &&
+ !requestUri.Contains("providers") &&
+ !requestUri.StartsWith("/certificates?", StringComparison.InvariantCultureIgnoreCase) &&
+ !requestUri.StartsWith("/pools", StringComparison.InvariantCultureIgnoreCase) &&
+ !requestUri.StartsWith("/jobs", StringComparison.InvariantCultureIgnoreCase) &&
+ !requestUri.StartsWith("/jobschedules", StringComparison.InvariantCultureIgnoreCase) &&
+ !requestUri.Contains("/applications?") &&
+ !requestUri.Contains("/servicePrincipals?"))
{
version = String.Empty;
return true;
diff --git a/src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj b/src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj
index ffe17dcb32d9..76e3e0b75fdd 100644
--- a/src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj
+++ b/src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj
@@ -76,7 +76,7 @@
..\..\..\packages\Microsoft.Azure.Management.Storage.3.0.0\lib\net40\Microsoft.Azure.Management.Storage.dll
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
+ ..\..\..\packages\Microsoft.Azure.Management.Resources.2.19.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5896.19355-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
diff --git a/src/ResourceManager/Compute/Commands.Compute.Test/Common/ComputeTestController.cs b/src/ResourceManager/Compute/Commands.Compute.Test/Common/ComputeTestController.cs
index 0b64df0253cc..3b54e6c3316b 100644
--- a/src/ResourceManager/Compute/Commands.Compute.Test/Common/ComputeTestController.cs
+++ b/src/ResourceManager/Compute/Commands.Compute.Test/Common/ComputeTestController.cs
@@ -100,8 +100,13 @@ public void RunPsTestWorkflow(
string mockName)
{
Dictionary d = new Dictionary();
+ d.Add("Microsoft.Resources", null);
+ d.Add("Microsoft.Features", null);
d.Add("Microsoft.Authorization", null);
- HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(false, d);
+ d.Add("Microsoft.Compute", null);
+ var providersToIgnore = new Dictionary();
+ providersToIgnore.Add("Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01");
+ HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);
HttpMockServer.RecordsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SessionRecords");
using (RestTestFramework.MockContext context = RestTestFramework.MockContext.Start(callingClassType, mockName))
diff --git a/src/ResourceManager/Compute/Commands.Compute/Generated/cli.js b/src/ResourceManager/Compute/Commands.Compute/Generated/cli.js
index 5095a029a73b..fe87223beb22 100644
--- a/src/ResourceManager/Compute/Commands.Compute/Generated/cli.js
+++ b/src/ResourceManager/Compute/Commands.Compute/Generated/cli.js
@@ -337,7 +337,7 @@ exports.init = function (cli) {
.description($('Set virtual-machine-scale-set in config string or files, e.g. \r\n{\r\n "sku":{\r\n "name":"",\r\n "tier":"",\r\n "capacity":null\r\n },\r\n "upgradePolicy":{\r\n "mode":""\r\n },\r\n "virtualMachineProfile":{\r\n "osProfile":{\r\n "computerNamePrefix":"",\r\n "adminUsername":"",\r\n "adminPassword":"",\r\n "customData":"",\r\n "windowsConfiguration":{\r\n "provisionVMAgent":null,\r\n "enableAutomaticUpdates":null,\r\n "timeZone":"",\r\n "additionalUnattendContent":[\r\n {\r\n "passName":"",\r\n "componentName":"",\r\n "settingName":"",\r\n "content":""\r\n }\r\n ],\r\n "winRM":{\r\n "listeners":[\r\n {\r\n "protocol":"",\r\n "certificateUrl":""\r\n }\r\n ]\r\n }\r\n },\r\n "linuxConfiguration":{\r\n "disablePasswordAuthentication":null,\r\n "ssh":{\r\n "publicKeys":[\r\n {\r\n "path":"",\r\n "keyData":""\r\n }\r\n ]\r\n }\r\n },\r\n "secrets":[\r\n {\r\n "sourceVault":{\r\n "id":""\r\n },\r\n "vaultCertificates":[\r\n {\r\n "certificateUrl":"",\r\n "certificateStore":""\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n "storageProfile":{\r\n "imageReference":{\r\n "publisher":"",\r\n "offer":"",\r\n "sku":"",\r\n "version":""\r\n },\r\n "osDisk":{\r\n "name":"",\r\n "caching":"",\r\n "createOption":"",\r\n "osType":"",\r\n "image":{\r\n "uri":""\r\n },\r\n "vhdContainers":[\r\n ""\r\n ]\r\n }\r\n },\r\n "networkProfile":{\r\n "networkInterfaceConfigurations":[\r\n {\r\n "name":"",\r\n "primary":null,\r\n "ipConfigurations":[\r\n {\r\n "name":"",\r\n "subnet":{\r\n "id":""\r\n },\r\n "loadBalancerBackendAddressPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "loadBalancerInboundNatPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ]\r\n },\r\n "extensionProfile":{\r\n "extensions":[\r\n {\r\n "name":"",\r\n "publisher":"",\r\n "virtualMachineScaleSetExtensionType":"",\r\n "typeHandlerVersion":"",\r\n "autoUpgradeMinorVersion":null,\r\n "settings":{\r\n },\r\n "protectedSettings":{\r\n },\r\n "provisioningState":"",\r\n "id":""\r\n }\r\n ]\r\n }\r\n },\r\n "provisioningState":"",\r\n "id":null,\r\n "name":null,\r\n "type":null,\r\n "location":"",\r\n "tags":{\r\n }\r\n}\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--sku ', $('Set the sku value.'))
.option('--upgrade-policy ', $('Set the upgrade-policy value.'))
.option('--virtual-machine-profile ', $('Set the virtual-machine-profile value.'))
@@ -349,10 +349,10 @@ exports.init = function (cli) {
.option('--tags ', $('Set the tags value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -363,90 +363,99 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '';
var paramPath = options.path + '/' + 'sku';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.sku) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.sku);
+ cli.output.verbose('================================================');
if (options.parse && options.sku) {
options.sku = JSON.parse(options.sku);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.sku}]);
}
paramPath = options.path + '/' + 'upgradePolicy';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.upgradePolicy) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.upgradePolicy);
+ cli.output.verbose('================================================');
if (options.parse && options.upgradePolicy) {
options.upgradePolicy = JSON.parse(options.upgradePolicy);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.upgradePolicy}]);
}
paramPath = options.path + '/' + 'virtualMachineProfile';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.virtualMachineProfile) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.virtualMachineProfile);
+ cli.output.verbose('================================================');
if (options.parse && options.virtualMachineProfile) {
options.virtualMachineProfile = JSON.parse(options.virtualMachineProfile);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.virtualMachineProfile}]);
}
paramPath = options.path + '/' + 'provisioningState';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.provisioningState) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.provisioningState);
+ cli.output.verbose('================================================');
if (options.parse && options.provisioningState) {
options.provisioningState = JSON.parse(options.provisioningState);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.provisioningState}]);
}
paramPath = options.path + '/' + 'id';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.id) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.id);
+ cli.output.verbose('================================================');
if (options.parse && options.id) {
options.id = JSON.parse(options.id);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.id}]);
}
paramPath = options.path + '/' + 'name';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.name) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.name);
+ cli.output.verbose('================================================');
if (options.parse && options.name) {
options.name = JSON.parse(options.name);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.name}]);
}
paramPath = options.path + '/' + 'type';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.type) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.type);
+ cli.output.verbose('================================================');
if (options.parse && options.type) {
options.type = JSON.parse(options.type);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.type}]);
}
paramPath = options.path + '/' + 'location';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.location) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.location);
+ cli.output.verbose('================================================');
if (options.parse && options.location) {
options.location = JSON.parse(options.location);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.location}]);
}
paramPath = options.path + '/' + 'tags';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.tags) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.tags);
+ cli.output.verbose('================================================');
if (options.parse && options.tags) {
options.tags = JSON.parse(options.tags);
}
@@ -484,6 +493,10 @@ exports.init = function (cli) {
.option('--tags', $('Remove the tags value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -547,146 +560,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add virtual-machine-scale-set
- var catparametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineScaleSet2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineScaleSet2 = catparametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineScaleSet2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineScaleSet2 = parametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineScaleSet2.category('virtual-machine-scale-set')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineScaleSet2.command('add')
- .description($('Add virtual-machine-scale-set in config string or files, e.g. \r\n{\r\n "sku":{\r\n "name":"",\r\n "tier":"",\r\n "capacity":null\r\n },\r\n "upgradePolicy":{\r\n "mode":""\r\n },\r\n "virtualMachineProfile":{\r\n "osProfile":{\r\n "computerNamePrefix":"",\r\n "adminUsername":"",\r\n "adminPassword":"",\r\n "customData":"",\r\n "windowsConfiguration":{\r\n "provisionVMAgent":null,\r\n "enableAutomaticUpdates":null,\r\n "timeZone":"",\r\n "additionalUnattendContent":[\r\n {\r\n "passName":"",\r\n "componentName":"",\r\n "settingName":"",\r\n "content":""\r\n }\r\n ],\r\n "winRM":{\r\n "listeners":[\r\n {\r\n "protocol":"",\r\n "certificateUrl":""\r\n }\r\n ]\r\n }\r\n },\r\n "linuxConfiguration":{\r\n "disablePasswordAuthentication":null,\r\n "ssh":{\r\n "publicKeys":[\r\n {\r\n "path":"",\r\n "keyData":""\r\n }\r\n ]\r\n }\r\n },\r\n "secrets":[\r\n {\r\n "sourceVault":{\r\n "id":""\r\n },\r\n "vaultCertificates":[\r\n {\r\n "certificateUrl":"",\r\n "certificateStore":""\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n "storageProfile":{\r\n "imageReference":{\r\n "publisher":"",\r\n "offer":"",\r\n "sku":"",\r\n "version":""\r\n },\r\n "osDisk":{\r\n "name":"",\r\n "caching":"",\r\n "createOption":"",\r\n "osType":"",\r\n "image":{\r\n "uri":""\r\n },\r\n "vhdContainers":[\r\n ""\r\n ]\r\n }\r\n },\r\n "networkProfile":{\r\n "networkInterfaceConfigurations":[\r\n {\r\n "name":"",\r\n "primary":null,\r\n "ipConfigurations":[\r\n {\r\n "name":"",\r\n "subnet":{\r\n "id":""\r\n },\r\n "loadBalancerBackendAddressPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "loadBalancerInboundNatPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ]\r\n },\r\n "extensionProfile":{\r\n "extensions":[\r\n {\r\n "name":"",\r\n "publisher":"",\r\n "virtualMachineScaleSetExtensionType":"",\r\n "typeHandlerVersion":"",\r\n "autoUpgradeMinorVersion":null,\r\n "settings":{\r\n },\r\n "protectedSettings":{\r\n },\r\n "provisioningState":"",\r\n "id":""\r\n }\r\n ]\r\n }\r\n },\r\n "provisioningState":"",\r\n "id":null,\r\n "name":null,\r\n "type":null,\r\n "location":"",\r\n "tags":{\r\n }\r\n}\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--sku ', $('Add the sku value.'))
- .option('--upgrade-policy ', $('Add the upgrade-policy value.'))
- .option('--virtual-machine-profile ', $('Add the virtual-machine-profile value.'))
- .option('--provisioning-state ', $('Add the provisioning-state value.'))
- .option('--id ', $('Add the id value.'))
- .option('--name ', $('Add the name value.'))
- .option('--type ', $('Add the type value.'))
- .option('--location ', $('Add the location value.'))
- .option('--tags ', $('Add the tags value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '' + '/' + 'sku';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.sku) {
- if (options.parse && options.sku) {
- options.sku = JSON.parse(options.sku);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.sku}]);
- }
- paramPath = '' + '/' + 'upgradePolicy';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.upgradePolicy) {
- if (options.parse && options.upgradePolicy) {
- options.upgradePolicy = JSON.parse(options.upgradePolicy);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.upgradePolicy}]);
- }
- paramPath = '' + '/' + 'virtualMachineProfile';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.virtualMachineProfile) {
- if (options.parse && options.virtualMachineProfile) {
- options.virtualMachineProfile = JSON.parse(options.virtualMachineProfile);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.virtualMachineProfile}]);
- }
- paramPath = '' + '/' + 'provisioningState';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.provisioningState) {
- if (options.parse && options.provisioningState) {
- options.provisioningState = JSON.parse(options.provisioningState);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.provisioningState}]);
- }
- paramPath = '' + '/' + 'id';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.id) {
- if (options.parse && options.id) {
- options.id = JSON.parse(options.id);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.id}]);
- }
- paramPath = '' + '/' + 'name';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.name) {
- if (options.parse && options.name) {
- options.name = JSON.parse(options.name);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.name}]);
- }
- paramPath = '' + '/' + 'type';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.type) {
- if (options.parse && options.type) {
- options.type = JSON.parse(options.type);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.type}]);
- }
- paramPath = '' + '/' + 'location';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.location) {
- if (options.parse && options.location) {
- options.location = JSON.parse(options.location);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.location}]);
- }
- paramPath = '' + '/' + 'tags';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.tags) {
- if (options.parse && options.tags) {
- options.tags = JSON.parse(options.tags);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.tags}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set sku
var catparametersCreateOrUpdateVirtualMachineScaleSetsSku0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsSku0 = catparametersCreateOrUpdateVirtualMachineScaleSetsSku0.category('config')
@@ -697,16 +570,16 @@ exports.init = function (cli) {
.description($('Set sku in config string or files, e.g. \r\n {\r\n ...\r\n "sku" : {\r\n "name":"",\r\n "tier":"",\r\n "capacity":null\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--name ', $('Set the name value.'))
.option('--tier ', $('Set the tier value.'))
.option('--capacity ', $('Set the capacity value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -717,34 +590,37 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/sku';
var paramPath = options.path + '/' + 'name';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.name) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.name);
+ cli.output.verbose('================================================');
if (options.parse && options.name) {
options.name = JSON.parse(options.name);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.name}]);
}
paramPath = options.path + '/' + 'tier';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.tier) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.tier);
+ cli.output.verbose('================================================');
if (options.parse && options.tier) {
options.tier = JSON.parse(options.tier);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.tier}]);
}
paramPath = options.path + '/' + 'capacity';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.capacity) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.capacity);
+ cli.output.verbose('================================================');
if (options.parse && options.capacity) {
options.capacity = JSON.parse(options.capacity);
}
- options.capacity = JSON.parse(options.capacity);
+ options.capacity = JSON.parse(options.capacity);
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.capacity}]);
}
var updatedContent = JSON.stringify(parametersObj);
@@ -773,6 +649,10 @@ exports.init = function (cli) {
.option('--capacity', $('Remove the capacity value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -812,81 +692,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add sku
- var catparametersCreateOrUpdateVirtualMachineScaleSetsSku2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsSku2 = catparametersCreateOrUpdateVirtualMachineScaleSetsSku2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsSku2 = parametersCreateOrUpdateVirtualMachineScaleSetsSku2.category('sku')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsSku2.command('add')
- .description($('Add sku in config string or files, e.g. \r\n {\r\n ...\r\n "sku" : {\r\n "name":"",\r\n "tier":"",\r\n "capacity":null\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--name ', $('Add the name value.'))
- .option('--tier ', $('Add the tier value.'))
- .option('--capacity ', $('Add the capacity value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/sku' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/sku' + '/' + 'name';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.name) {
- if (options.parse && options.name) {
- options.name = JSON.parse(options.name);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.name}]);
- }
- paramPath = '/sku' + '/' + 'tier';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.tier) {
- if (options.parse && options.tier) {
- options.tier = JSON.parse(options.tier);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.tier}]);
- }
- paramPath = '/sku' + '/' + 'capacity';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.capacity) {
- if (options.parse && options.capacity) {
- options.capacity = JSON.parse(options.capacity);
- }
- options.capacity = JSON.parse(options.capacity);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.capacity}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set upgrade-policy
var catparametersCreateOrUpdateVirtualMachineScaleSetsUpgradePolicy0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsUpgradePolicy0 = catparametersCreateOrUpdateVirtualMachineScaleSetsUpgradePolicy0.category('config')
@@ -897,14 +702,14 @@ exports.init = function (cli) {
.description($('Set upgrade-policy in config string or files, e.g. \r\n {\r\n ...\r\n "upgradePolicy" : {\r\n "mode":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--mode ', $('Set the mode value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -915,10 +720,11 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/upgradePolicy';
var paramPath = options.path + '/' + 'mode';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.mode) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.mode);
+ cli.output.verbose('================================================');
if (options.parse && options.mode) {
options.mode = JSON.parse(options.mode);
}
@@ -948,6 +754,10 @@ exports.init = function (cli) {
.option('--mode', $('Remove the mode value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -979,26 +789,27 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add upgrade-policy
- var catparametersCreateOrUpdateVirtualMachineScaleSetsUpgradePolicy2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsUpgradePolicy2 = catparametersCreateOrUpdateVirtualMachineScaleSetsUpgradePolicy2.category('config')
+ //config set virtual-machine-profile
+ var catparametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineProfile0 = cli.category('vmss');
+ var parametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineProfile0 = catparametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineProfile0.category('config')
.description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsUpgradePolicy2 = parametersCreateOrUpdateVirtualMachineScaleSetsUpgradePolicy2.category('upgrade-policy')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsUpgradePolicy2.command('add')
- .description($('Add upgrade-policy in config string or files, e.g. \r\n {\r\n ...\r\n "upgradePolicy" : {\r\n "mode":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
+ var setparametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineProfile0 = parametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineProfile0.category('virtual-machine-profile')
+ .description($('Commands to set components of virtual-machine-scale-sets in config file.'));
+ setparametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineProfile0.command('set')
+ .description($('Set virtual-machine-profile in config string or files, e.g. \r\n {\r\n ...\r\n "virtualMachineProfile" : {\r\n "osProfile":{\r\n "computerNamePrefix":"",\r\n "adminUsername":"",\r\n "adminPassword":"",\r\n "customData":"",\r\n "windowsConfiguration":{\r\n "provisionVMAgent":null,\r\n "enableAutomaticUpdates":null,\r\n "timeZone":"",\r\n "additionalUnattendContent":[\r\n {\r\n "passName":"",\r\n "componentName":"",\r\n "settingName":"",\r\n "content":""\r\n }\r\n ],\r\n "winRM":{\r\n "listeners":[\r\n {\r\n "protocol":"",\r\n "certificateUrl":""\r\n }\r\n ]\r\n }\r\n },\r\n "linuxConfiguration":{\r\n "disablePasswordAuthentication":null,\r\n "ssh":{\r\n "publicKeys":[\r\n {\r\n "path":"",\r\n "keyData":""\r\n }\r\n ]\r\n }\r\n },\r\n "secrets":[\r\n {\r\n "sourceVault":{\r\n "id":""\r\n },\r\n "vaultCertificates":[\r\n {\r\n "certificateUrl":"",\r\n "certificateStore":""\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n "storageProfile":{\r\n "imageReference":{\r\n "publisher":"",\r\n "offer":"",\r\n "sku":"",\r\n "version":""\r\n },\r\n "osDisk":{\r\n "name":"",\r\n "caching":"",\r\n "createOption":"",\r\n "osType":"",\r\n "image":{\r\n "uri":""\r\n },\r\n "vhdContainers":[\r\n ""\r\n ]\r\n }\r\n },\r\n "networkProfile":{\r\n "networkInterfaceConfigurations":[\r\n {\r\n "name":"",\r\n "primary":null,\r\n "ipConfigurations":[\r\n {\r\n "name":"",\r\n "subnet":{\r\n "id":""\r\n },\r\n "loadBalancerBackendAddressPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "loadBalancerInboundNatPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ]\r\n },\r\n "extensionProfile":{\r\n "extensions":[\r\n {\r\n "name":"",\r\n "publisher":"",\r\n "virtualMachineScaleSetExtensionType":"",\r\n "typeHandlerVersion":"",\r\n "autoUpgradeMinorVersion":null,\r\n "settings":{\r\n },\r\n "protectedSettings":{\r\n },\r\n "provisioningState":"",\r\n "id":""\r\n }\r\n ]\r\n }\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--mode ', $('Add the mode value.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
+ .option('--os-profile ', $('Set the os-profile value.'))
+ .option('--storage-profile ', $('Set the storage-profile value.'))
+ .option('--network-profile ', $('Set the network-profile value.'))
+ .option('--extension-profile ', $('Set the extension-profile value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -1006,19 +817,51 @@ exports.init = function (cli) {
var parametersObj = JSON.parse(fileContent);
cli.output.verbose('JSON object:');
cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/upgradePolicy' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/upgradePolicy' + '/' + 'mode';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.mode) {
- if (options.parse && options.mode) {
- options.mode = JSON.parse(options.mode);
+ options.operation = 'replace';
+ options.path = '/virtualMachineProfile';
+ var paramPath = options.path + '/' + 'osProfile';
+ if (options.osProfile) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.osProfile);
+ cli.output.verbose('================================================');
+ if (options.parse && options.osProfile) {
+ options.osProfile = JSON.parse(options.osProfile);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.mode}]);
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.osProfile}]);
+ }
+ paramPath = options.path + '/' + 'storageProfile';
+ if (options.storageProfile) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.storageProfile);
+ cli.output.verbose('================================================');
+ if (options.parse && options.storageProfile) {
+ options.storageProfile = JSON.parse(options.storageProfile);
+ }
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.storageProfile}]);
+ }
+ paramPath = options.path + '/' + 'networkProfile';
+ if (options.networkProfile) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.networkProfile);
+ cli.output.verbose('================================================');
+ if (options.parse && options.networkProfile) {
+ options.networkProfile = JSON.parse(options.networkProfile);
+ }
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.networkProfile}]);
+ }
+ paramPath = options.path + '/' + 'extensionProfile';
+ if (options.extensionProfile) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.extensionProfile);
+ cli.output.verbose('================================================');
+ if (options.parse && options.extensionProfile) {
+ options.extensionProfile = JSON.parse(options.extensionProfile);
+ }
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.extensionProfile}]);
}
var updatedContent = JSON.stringify(parametersObj);
cli.output.verbose('=====================================');
@@ -1047,6 +890,10 @@ exports.init = function (cli) {
.option('--extension-profile', $('Remove the extension-profile value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -1090,91 +937,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add virtual-machine-profile
- var catparametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineProfile2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineProfile2 = catparametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineProfile2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineProfile2 = parametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineProfile2.category('virtual-machine-profile')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsVirtualMachineProfile2.command('add')
- .description($('Add virtual-machine-profile in config string or files, e.g. \r\n {\r\n ...\r\n "virtualMachineProfile" : {\r\n "osProfile":{\r\n "computerNamePrefix":"",\r\n "adminUsername":"",\r\n "adminPassword":"",\r\n "customData":"",\r\n "windowsConfiguration":{\r\n "provisionVMAgent":null,\r\n "enableAutomaticUpdates":null,\r\n "timeZone":"",\r\n "additionalUnattendContent":[\r\n {\r\n "passName":"",\r\n "componentName":"",\r\n "settingName":"",\r\n "content":""\r\n }\r\n ],\r\n "winRM":{\r\n "listeners":[\r\n {\r\n "protocol":"",\r\n "certificateUrl":""\r\n }\r\n ]\r\n }\r\n },\r\n "linuxConfiguration":{\r\n "disablePasswordAuthentication":null,\r\n "ssh":{\r\n "publicKeys":[\r\n {\r\n "path":"",\r\n "keyData":""\r\n }\r\n ]\r\n }\r\n },\r\n "secrets":[\r\n {\r\n "sourceVault":{\r\n "id":""\r\n },\r\n "vaultCertificates":[\r\n {\r\n "certificateUrl":"",\r\n "certificateStore":""\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n "storageProfile":{\r\n "imageReference":{\r\n "publisher":"",\r\n "offer":"",\r\n "sku":"",\r\n "version":""\r\n },\r\n "osDisk":{\r\n "name":"",\r\n "caching":"",\r\n "createOption":"",\r\n "osType":"",\r\n "image":{\r\n "uri":""\r\n },\r\n "vhdContainers":[\r\n ""\r\n ]\r\n }\r\n },\r\n "networkProfile":{\r\n "networkInterfaceConfigurations":[\r\n {\r\n "name":"",\r\n "primary":null,\r\n "ipConfigurations":[\r\n {\r\n "name":"",\r\n "subnet":{\r\n "id":""\r\n },\r\n "loadBalancerBackendAddressPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "loadBalancerInboundNatPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ]\r\n },\r\n "extensionProfile":{\r\n "extensions":[\r\n {\r\n "name":"",\r\n "publisher":"",\r\n "virtualMachineScaleSetExtensionType":"",\r\n "typeHandlerVersion":"",\r\n "autoUpgradeMinorVersion":null,\r\n "settings":{\r\n },\r\n "protectedSettings":{\r\n },\r\n "provisioningState":"",\r\n "id":""\r\n }\r\n ]\r\n }\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--os-profile ', $('Add the os-profile value.'))
- .option('--storage-profile ', $('Add the storage-profile value.'))
- .option('--network-profile ', $('Add the network-profile value.'))
- .option('--extension-profile ', $('Add the extension-profile value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile' + '/' + 'osProfile';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.osProfile) {
- if (options.parse && options.osProfile) {
- options.osProfile = JSON.parse(options.osProfile);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.osProfile}]);
- }
- paramPath = '/virtualMachineProfile' + '/' + 'storageProfile';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.storageProfile) {
- if (options.parse && options.storageProfile) {
- options.storageProfile = JSON.parse(options.storageProfile);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.storageProfile}]);
- }
- paramPath = '/virtualMachineProfile' + '/' + 'networkProfile';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.networkProfile) {
- if (options.parse && options.networkProfile) {
- options.networkProfile = JSON.parse(options.networkProfile);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.networkProfile}]);
- }
- paramPath = '/virtualMachineProfile' + '/' + 'extensionProfile';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.extensionProfile) {
- if (options.parse && options.extensionProfile) {
- options.extensionProfile = JSON.parse(options.extensionProfile);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.extensionProfile}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set os-profile
var catparametersCreateOrUpdateVirtualMachineScaleSetsOsProfile0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsOsProfile0 = catparametersCreateOrUpdateVirtualMachineScaleSetsOsProfile0.category('config')
@@ -1185,7 +947,7 @@ exports.init = function (cli) {
.description($('Set os-profile in config string or files, e.g. \r\n {\r\n ...\r\n "osProfile" : {\r\n "computerNamePrefix":"",\r\n "adminUsername":"",\r\n "adminPassword":"",\r\n "customData":"",\r\n "windowsConfiguration":{\r\n "provisionVMAgent":null,\r\n "enableAutomaticUpdates":null,\r\n "timeZone":"",\r\n "additionalUnattendContent":[\r\n {\r\n "passName":"",\r\n "componentName":"",\r\n "settingName":"",\r\n "content":""\r\n }\r\n ],\r\n "winRM":{\r\n "listeners":[\r\n {\r\n "protocol":"",\r\n "certificateUrl":""\r\n }\r\n ]\r\n }\r\n },\r\n "linuxConfiguration":{\r\n "disablePasswordAuthentication":null,\r\n "ssh":{\r\n "publicKeys":[\r\n {\r\n "path":"",\r\n "keyData":""\r\n }\r\n ]\r\n }\r\n },\r\n "secrets":[\r\n {\r\n "sourceVault":{\r\n "id":""\r\n },\r\n "vaultCertificates":[\r\n {\r\n "certificateUrl":"",\r\n "certificateStore":""\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--computer-name-prefix ', $('Set the computer-name-prefix value.'))
.option('--admin-username ', $('Set the admin-username value.'))
.option('--admin-password ', $('Set the admin-password value.'))
@@ -1195,10 +957,10 @@ exports.init = function (cli) {
.option('--secrets ', $('Set the secrets value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -1209,70 +971,77 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/osProfile';
var paramPath = options.path + '/' + 'computerNamePrefix';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.computerNamePrefix) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.computerNamePrefix);
+ cli.output.verbose('================================================');
if (options.parse && options.computerNamePrefix) {
options.computerNamePrefix = JSON.parse(options.computerNamePrefix);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.computerNamePrefix}]);
}
paramPath = options.path + '/' + 'adminUsername';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.adminUsername) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.adminUsername);
+ cli.output.verbose('================================================');
if (options.parse && options.adminUsername) {
options.adminUsername = JSON.parse(options.adminUsername);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.adminUsername}]);
}
paramPath = options.path + '/' + 'adminPassword';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.adminPassword) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.adminPassword);
+ cli.output.verbose('================================================');
if (options.parse && options.adminPassword) {
options.adminPassword = JSON.parse(options.adminPassword);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.adminPassword}]);
}
paramPath = options.path + '/' + 'customData';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.customData) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.customData);
+ cli.output.verbose('================================================');
if (options.parse && options.customData) {
options.customData = JSON.parse(options.customData);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.customData}]);
}
paramPath = options.path + '/' + 'windowsConfiguration';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.windowsConfiguration) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.windowsConfiguration);
+ cli.output.verbose('================================================');
if (options.parse && options.windowsConfiguration) {
options.windowsConfiguration = JSON.parse(options.windowsConfiguration);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.windowsConfiguration}]);
}
paramPath = options.path + '/' + 'linuxConfiguration';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.linuxConfiguration) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.linuxConfiguration);
+ cli.output.verbose('================================================');
if (options.parse && options.linuxConfiguration) {
options.linuxConfiguration = JSON.parse(options.linuxConfiguration);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.linuxConfiguration}]);
}
paramPath = options.path + '/' + 'secrets';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.secrets) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.secrets);
+ cli.output.verbose('================================================');
if (options.parse && options.secrets) {
options.secrets = JSON.parse(options.secrets);
}
@@ -1308,6 +1077,10 @@ exports.init = function (cli) {
.option('--secrets', $('Remove the secrets value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -1363,146 +1136,28 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add os-profile
- var catparametersCreateOrUpdateVirtualMachineScaleSetsOsProfile2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsOsProfile2 = catparametersCreateOrUpdateVirtualMachineScaleSetsOsProfile2.category('config')
+ //config set windows-configuration
+ var catparametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration0 = cli.category('vmss');
+ var parametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration0 = catparametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration0.category('config')
.description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsOsProfile2 = parametersCreateOrUpdateVirtualMachineScaleSetsOsProfile2.category('os-profile')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsOsProfile2.command('add')
- .description($('Add os-profile in config string or files, e.g. \r\n {\r\n ...\r\n "osProfile" : {\r\n "computerNamePrefix":"",\r\n "adminUsername":"",\r\n "adminPassword":"",\r\n "customData":"",\r\n "windowsConfiguration":{\r\n "provisionVMAgent":null,\r\n "enableAutomaticUpdates":null,\r\n "timeZone":"",\r\n "additionalUnattendContent":[\r\n {\r\n "passName":"",\r\n "componentName":"",\r\n "settingName":"",\r\n "content":""\r\n }\r\n ],\r\n "winRM":{\r\n "listeners":[\r\n {\r\n "protocol":"",\r\n "certificateUrl":""\r\n }\r\n ]\r\n }\r\n },\r\n "linuxConfiguration":{\r\n "disablePasswordAuthentication":null,\r\n "ssh":{\r\n "publicKeys":[\r\n {\r\n "path":"",\r\n "keyData":""\r\n }\r\n ]\r\n }\r\n },\r\n "secrets":[\r\n {\r\n "sourceVault":{\r\n "id":""\r\n },\r\n "vaultCertificates":[\r\n {\r\n "certificateUrl":"",\r\n "certificateStore":""\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
+ var setparametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration0 = parametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration0.category('windows-configuration')
+ .description($('Commands to set components of virtual-machine-scale-sets in config file.'));
+ setparametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration0.command('set')
+ .description($('Set windows-configuration in config string or files, e.g. \r\n {\r\n ...\r\n "windowsConfiguration" : {\r\n "provisionVMAgent":null,\r\n "enableAutomaticUpdates":null,\r\n "timeZone":"",\r\n "additionalUnattendContent":[\r\n {\r\n "passName":"",\r\n "componentName":"",\r\n "settingName":"",\r\n "content":""\r\n }\r\n ],\r\n "winRM":{\r\n "listeners":[\r\n {\r\n "protocol":"",\r\n "certificateUrl":""\r\n }\r\n ]\r\n }\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--computer-name-prefix ', $('Add the computer-name-prefix value.'))
- .option('--admin-username ', $('Add the admin-username value.'))
- .option('--admin-password ', $('Add the admin-password value.'))
- .option('--custom-data ', $('Add the custom-data value.'))
- .option('--windows-configuration ', $('Add the windows-configuration value.'))
- .option('--linux-configuration ', $('Add the linux-configuration value.'))
- .option('--secrets ', $('Add the secrets value.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
+ .option('--provision-vm-agent ', $('Set the provision-vm-agent value.'))
+ .option('--enable-automatic-updates ', $('Set the enable-automatic-updates value.'))
+ .option('--time-zone ', $('Set the time-zone value.'))
+ .option('--additional-unattend-content ', $('Set the additional-unattend-content value.'))
+ .option('--win-rm ', $('Set the win-rm value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/osProfile' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/osProfile' + '/' + 'computerNamePrefix';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.computerNamePrefix) {
- if (options.parse && options.computerNamePrefix) {
- options.computerNamePrefix = JSON.parse(options.computerNamePrefix);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.computerNamePrefix}]);
- }
- paramPath = '/virtualMachineProfile/osProfile' + '/' + 'adminUsername';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.adminUsername) {
- if (options.parse && options.adminUsername) {
- options.adminUsername = JSON.parse(options.adminUsername);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.adminUsername}]);
- }
- paramPath = '/virtualMachineProfile/osProfile' + '/' + 'adminPassword';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.adminPassword) {
- if (options.parse && options.adminPassword) {
- options.adminPassword = JSON.parse(options.adminPassword);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.adminPassword}]);
- }
- paramPath = '/virtualMachineProfile/osProfile' + '/' + 'customData';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.customData) {
- if (options.parse && options.customData) {
- options.customData = JSON.parse(options.customData);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.customData}]);
- }
- paramPath = '/virtualMachineProfile/osProfile' + '/' + 'windowsConfiguration';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.windowsConfiguration) {
- if (options.parse && options.windowsConfiguration) {
- options.windowsConfiguration = JSON.parse(options.windowsConfiguration);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.windowsConfiguration}]);
- }
- paramPath = '/virtualMachineProfile/osProfile' + '/' + 'linuxConfiguration';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.linuxConfiguration) {
- if (options.parse && options.linuxConfiguration) {
- options.linuxConfiguration = JSON.parse(options.linuxConfiguration);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.linuxConfiguration}]);
- }
- paramPath = '/virtualMachineProfile/osProfile' + '/' + 'secrets';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.secrets) {
- if (options.parse && options.secrets) {
- options.secrets = JSON.parse(options.secrets);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.secrets}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
- //config set windows-configuration
- var catparametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration0 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration0 = catparametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration0.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var setparametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration0 = parametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration0.category('windows-configuration')
- .description($('Commands to set components of virtual-machine-scale-sets in config file.'));
- setparametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration0.command('set')
- .description($('Set windows-configuration in config string or files, e.g. \r\n {\r\n ...\r\n "windowsConfiguration" : {\r\n "provisionVMAgent":null,\r\n "enableAutomaticUpdates":null,\r\n "timeZone":"",\r\n "additionalUnattendContent":[\r\n {\r\n "passName":"",\r\n "componentName":"",\r\n "settingName":"",\r\n "content":""\r\n }\r\n ],\r\n "winRM":{\r\n "listeners":[\r\n {\r\n "protocol":"",\r\n "certificateUrl":""\r\n }\r\n ]\r\n }\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--provision-vm-agent ', $('Set the provision-vm-agent value.'))
- .option('--enable-automatic-updates ', $('Set the enable-automatic-updates value.'))
- .option('--time-zone ', $('Set the time-zone value.'))
- .option('--additional-unattend-content ', $('Set the additional-unattend-content value.'))
- .option('--win-rm ', $('Set the win-rm value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -1513,52 +1168,57 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/osProfile/windowsConfiguration';
var paramPath = options.path + '/' + 'provisionVMAgent';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.provisionVMAgent) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.provisionVMAgent);
+ cli.output.verbose('================================================');
if (options.parse && options.provisionVMAgent) {
options.provisionVMAgent = JSON.parse(options.provisionVMAgent);
}
- options.provisionVMAgent = JSON.parse(options.provisionVMAgent);
+ options.provisionVMAgent = JSON.parse(options.provisionVMAgent);
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.provisionVMAgent}]);
}
paramPath = options.path + '/' + 'enableAutomaticUpdates';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.enableAutomaticUpdates) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.enableAutomaticUpdates);
+ cli.output.verbose('================================================');
if (options.parse && options.enableAutomaticUpdates) {
options.enableAutomaticUpdates = JSON.parse(options.enableAutomaticUpdates);
}
- options.enableAutomaticUpdates = JSON.parse(options.enableAutomaticUpdates);
+ options.enableAutomaticUpdates = JSON.parse(options.enableAutomaticUpdates);
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.enableAutomaticUpdates}]);
}
paramPath = options.path + '/' + 'timeZone';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.timeZone) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.timeZone);
+ cli.output.verbose('================================================');
if (options.parse && options.timeZone) {
options.timeZone = JSON.parse(options.timeZone);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.timeZone}]);
}
paramPath = options.path + '/' + 'additionalUnattendContent';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.additionalUnattendContent) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.additionalUnattendContent);
+ cli.output.verbose('================================================');
if (options.parse && options.additionalUnattendContent) {
options.additionalUnattendContent = JSON.parse(options.additionalUnattendContent);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.additionalUnattendContent}]);
}
paramPath = options.path + '/' + 'winRM';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.winRM) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.winRM);
+ cli.output.verbose('================================================');
if (options.parse && options.winRM) {
options.winRM = JSON.parse(options.winRM);
}
@@ -1592,6 +1252,10 @@ exports.init = function (cli) {
.option('--win-rm', $('Remove the win-rm value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -1639,104 +1303,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add windows-configuration
- var catparametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration2 = catparametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration2 = parametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration2.category('windows-configuration')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsWindowsConfiguration2.command('add')
- .description($('Add windows-configuration in config string or files, e.g. \r\n {\r\n ...\r\n "windowsConfiguration" : {\r\n "provisionVMAgent":null,\r\n "enableAutomaticUpdates":null,\r\n "timeZone":"",\r\n "additionalUnattendContent":[\r\n {\r\n "passName":"",\r\n "componentName":"",\r\n "settingName":"",\r\n "content":""\r\n }\r\n ],\r\n "winRM":{\r\n "listeners":[\r\n {\r\n "protocol":"",\r\n "certificateUrl":""\r\n }\r\n ]\r\n }\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--provision-vm-agent ', $('Add the provision-vm-agent value.'))
- .option('--enable-automatic-updates ', $('Add the enable-automatic-updates value.'))
- .option('--time-zone ', $('Add the time-zone value.'))
- .option('--additional-unattend-content ', $('Add the additional-unattend-content value.'))
- .option('--win-rm ', $('Add the win-rm value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/osProfile/windowsConfiguration' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/osProfile/windowsConfiguration' + '/' + 'provisionVMAgent';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.provisionVMAgent) {
- if (options.parse && options.provisionVMAgent) {
- options.provisionVMAgent = JSON.parse(options.provisionVMAgent);
- }
- options.provisionVMAgent = JSON.parse(options.provisionVMAgent);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.provisionVMAgent}]);
- }
- paramPath = '/virtualMachineProfile/osProfile/windowsConfiguration' + '/' + 'enableAutomaticUpdates';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.enableAutomaticUpdates) {
- if (options.parse && options.enableAutomaticUpdates) {
- options.enableAutomaticUpdates = JSON.parse(options.enableAutomaticUpdates);
- }
- options.enableAutomaticUpdates = JSON.parse(options.enableAutomaticUpdates);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.enableAutomaticUpdates}]);
- }
- paramPath = '/virtualMachineProfile/osProfile/windowsConfiguration' + '/' + 'timeZone';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.timeZone) {
- if (options.parse && options.timeZone) {
- options.timeZone = JSON.parse(options.timeZone);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.timeZone}]);
- }
- paramPath = '/virtualMachineProfile/osProfile/windowsConfiguration' + '/' + 'additionalUnattendContent';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.additionalUnattendContent) {
- if (options.parse && options.additionalUnattendContent) {
- options.additionalUnattendContent = JSON.parse(options.additionalUnattendContent);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.additionalUnattendContent}]);
- }
- paramPath = '/virtualMachineProfile/osProfile/windowsConfiguration' + '/' + 'winRM';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.winRM) {
- if (options.parse && options.winRM) {
- options.winRM = JSON.parse(options.winRM);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.winRM}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set additional-unattend-content
var catparametersCreateOrUpdateVirtualMachineScaleSetsAdditionalUnattendContent0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsAdditionalUnattendContent0 = catparametersCreateOrUpdateVirtualMachineScaleSetsAdditionalUnattendContent0.category('config')
@@ -1749,17 +1315,17 @@ exports.init = function (cli) {
.option('--parameter-file ', $('The parameter file path.'))
.option('--index ', $('Indexer: index.'))
.option('--value ', $('The input string value for the indexed item.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--pass-name ', $('Set the pass-name value.'))
.option('--component-name ', $('Set the component-name value.'))
.option('--setting-name ', $('Set the setting-name value.'))
.option('--content ', $('Set the content value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -1770,43 +1336,48 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/osProfile/windowsConfiguration/additionalUnattendContent' + (options.index ? ('/' + options.index) : '');
if (options.value) {
+ cli.output.verbose(options.value);
jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
}
var paramPath = options.path + '/' + 'passName';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.passName) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.passName);
+ cli.output.verbose('================================================');
if (options.parse && options.passName) {
options.passName = JSON.parse(options.passName);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.passName}]);
}
paramPath = options.path + '/' + 'componentName';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.componentName) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.componentName);
+ cli.output.verbose('================================================');
if (options.parse && options.componentName) {
options.componentName = JSON.parse(options.componentName);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.componentName}]);
}
paramPath = options.path + '/' + 'settingName';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.settingName) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.settingName);
+ cli.output.verbose('================================================');
if (options.parse && options.settingName) {
options.settingName = JSON.parse(options.settingName);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.settingName}]);
}
paramPath = options.path + '/' + 'content';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.content) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.content);
+ cli.output.verbose('================================================');
if (options.parse && options.content) {
options.content = JSON.parse(options.content);
}
@@ -1840,6 +1411,10 @@ exports.init = function (cli) {
.option('--content', $('Remove the content value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -1883,29 +1458,24 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add additional-unattend-content
- var catparametersCreateOrUpdateVirtualMachineScaleSetsAdditionalUnattendContent2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsAdditionalUnattendContent2 = catparametersCreateOrUpdateVirtualMachineScaleSetsAdditionalUnattendContent2.category('config')
+ //config set win-rm
+ var catparametersCreateOrUpdateVirtualMachineScaleSetsWinRM0 = cli.category('vmss');
+ var parametersCreateOrUpdateVirtualMachineScaleSetsWinRM0 = catparametersCreateOrUpdateVirtualMachineScaleSetsWinRM0.category('config')
.description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsAdditionalUnattendContent2 = parametersCreateOrUpdateVirtualMachineScaleSetsAdditionalUnattendContent2.category('additional-unattend-content')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsAdditionalUnattendContent2.command('add')
- .description($('Add additional-unattend-content in config string or files, e.g. \r\n {\r\n ...\r\n "additionalUnattendContent" : {\r\n "passName":"",\r\n "componentName":"",\r\n "settingName":"",\r\n "content":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
+ var setparametersCreateOrUpdateVirtualMachineScaleSetsWinRM0 = parametersCreateOrUpdateVirtualMachineScaleSetsWinRM0.category('win-rm')
+ .description($('Commands to set components of virtual-machine-scale-sets in config file.'));
+ setparametersCreateOrUpdateVirtualMachineScaleSetsWinRM0.command('set')
+ .description($('Set win-rm in config string or files, e.g. \r\n {\r\n ...\r\n "winRM" : {\r\n "listeners":[\r\n {\r\n "protocol":"",\r\n "certificateUrl":""\r\n }\r\n ]\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--pass-name ', $('Add the pass-name value.'))
- .option('--component-name ', $('Add the component-name value.'))
- .option('--setting-name ', $('Add the setting-name value.'))
- .option('--content ', $('Add the content value.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
+ .option('--listeners ', $('Set the listeners value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -1913,49 +1483,18 @@ exports.init = function (cli) {
var parametersObj = JSON.parse(fileContent);
cli.output.verbose('JSON object:');
cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/osProfile/windowsConfiguration/additionalUnattendContent' + (options.index ? ('/' + options.index) : '') + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/osProfile/windowsConfiguration/additionalUnattendContent' + (options.index ? ('/' + options.index) : '') + '/' + 'passName';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.passName) {
- if (options.parse && options.passName) {
- options.passName = JSON.parse(options.passName);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.passName}]);
- }
- paramPath = '/virtualMachineProfile/osProfile/windowsConfiguration/additionalUnattendContent' + (options.index ? ('/' + options.index) : '') + '/' + 'componentName';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.componentName) {
- if (options.parse && options.componentName) {
- options.componentName = JSON.parse(options.componentName);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.componentName}]);
- }
- paramPath = '/virtualMachineProfile/osProfile/windowsConfiguration/additionalUnattendContent' + (options.index ? ('/' + options.index) : '') + '/' + 'settingName';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.settingName) {
- if (options.parse && options.settingName) {
- options.settingName = JSON.parse(options.settingName);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.settingName}]);
- }
- paramPath = '/virtualMachineProfile/osProfile/windowsConfiguration/additionalUnattendContent' + (options.index ? ('/' + options.index) : '') + '/' + 'content';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.content) {
- if (options.parse && options.content) {
- options.content = JSON.parse(options.content);
+ options.operation = 'replace';
+ options.path = '/virtualMachineProfile/osProfile/windowsConfiguration/winRM';
+ var paramPath = options.path + '/' + 'listeners';
+ if (options.listeners) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.listeners);
+ cli.output.verbose('================================================');
+ if (options.parse && options.listeners) {
+ options.listeners = JSON.parse(options.listeners);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.content}]);
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.listeners}]);
}
var updatedContent = JSON.stringify(parametersObj);
cli.output.verbose('=====================================');
@@ -1981,6 +1520,10 @@ exports.init = function (cli) {
.option('--listeners', $('Remove the listeners value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2012,58 +1555,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add win-rm
- var catparametersCreateOrUpdateVirtualMachineScaleSetsWinRM2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsWinRM2 = catparametersCreateOrUpdateVirtualMachineScaleSetsWinRM2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsWinRM2 = parametersCreateOrUpdateVirtualMachineScaleSetsWinRM2.category('win-rm')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsWinRM2.command('add')
- .description($('Add win-rm in config string or files, e.g. \r\n {\r\n ...\r\n "winRM" : {\r\n "listeners":[\r\n {\r\n "protocol":"",\r\n "certificateUrl":""\r\n }\r\n ]\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--listeners ', $('Add the listeners value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/osProfile/windowsConfiguration/winRM' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/osProfile/windowsConfiguration/winRM' + '/' + 'listeners';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.listeners) {
- if (options.parse && options.listeners) {
- options.listeners = JSON.parse(options.listeners);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.listeners}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set listeners
var catparametersCreateOrUpdateVirtualMachineScaleSetsListeners0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsListeners0 = catparametersCreateOrUpdateVirtualMachineScaleSetsListeners0.category('config')
@@ -2076,15 +1567,15 @@ exports.init = function (cli) {
.option('--parameter-file ', $('The parameter file path.'))
.option('--index ', $('Indexer: index.'))
.option('--value ', $('The input string value for the indexed item.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--protocol ', $('Set the protocol value.'))
.option('--certificate-url ', $('Set the certificate-url value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2095,23 +1586,26 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/osProfile/windowsConfiguration/winRM/listeners' + (options.index ? ('/' + options.index) : '');
if (options.value) {
+ cli.output.verbose(options.value);
jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
}
var paramPath = options.path + '/' + 'protocol';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.protocol) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.protocol);
+ cli.output.verbose('================================================');
if (options.parse && options.protocol) {
options.protocol = JSON.parse(options.protocol);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.protocol}]);
}
paramPath = options.path + '/' + 'certificateUrl';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.certificateUrl) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.certificateUrl);
+ cli.output.verbose('================================================');
if (options.parse && options.certificateUrl) {
options.certificateUrl = JSON.parse(options.certificateUrl);
}
@@ -2143,6 +1637,10 @@ exports.init = function (cli) {
.option('--certificate-url', $('Remove the certificate-url value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2178,69 +1676,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add listeners
- var catparametersCreateOrUpdateVirtualMachineScaleSetsListeners2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsListeners2 = catparametersCreateOrUpdateVirtualMachineScaleSetsListeners2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsListeners2 = parametersCreateOrUpdateVirtualMachineScaleSetsListeners2.category('listeners')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsListeners2.command('add')
- .description($('Add listeners in config string or files, e.g. \r\n {\r\n ...\r\n "listeners" : {\r\n "protocol":"",\r\n "certificateUrl":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--protocol ', $('Add the protocol value.'))
- .option('--certificate-url ', $('Add the certificate-url value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/osProfile/windowsConfiguration/winRM/listeners' + (options.index ? ('/' + options.index) : '') + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/osProfile/windowsConfiguration/winRM/listeners' + (options.index ? ('/' + options.index) : '') + '/' + 'protocol';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.protocol) {
- if (options.parse && options.protocol) {
- options.protocol = JSON.parse(options.protocol);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.protocol}]);
- }
- paramPath = '/virtualMachineProfile/osProfile/windowsConfiguration/winRM/listeners' + (options.index ? ('/' + options.index) : '') + '/' + 'certificateUrl';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.certificateUrl) {
- if (options.parse && options.certificateUrl) {
- options.certificateUrl = JSON.parse(options.certificateUrl);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.certificateUrl}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set linux-configuration
var catparametersCreateOrUpdateVirtualMachineScaleSetsLinuxConfiguration0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsLinuxConfiguration0 = catparametersCreateOrUpdateVirtualMachineScaleSetsLinuxConfiguration0.category('config')
@@ -2251,15 +1686,15 @@ exports.init = function (cli) {
.description($('Set linux-configuration in config string or files, e.g. \r\n {\r\n ...\r\n "linuxConfiguration" : {\r\n "disablePasswordAuthentication":null,\r\n "ssh":{\r\n "publicKeys":[\r\n {\r\n "path":"",\r\n "keyData":""\r\n }\r\n ]\r\n }\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--disable-password-authentication ', $('Set the disable-password-authentication value.'))
.option('--ssh ', $('Set the ssh value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2270,21 +1705,23 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/osProfile/linuxConfiguration';
var paramPath = options.path + '/' + 'disablePasswordAuthentication';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.disablePasswordAuthentication) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.disablePasswordAuthentication);
+ cli.output.verbose('================================================');
if (options.parse && options.disablePasswordAuthentication) {
options.disablePasswordAuthentication = JSON.parse(options.disablePasswordAuthentication);
}
- options.disablePasswordAuthentication = JSON.parse(options.disablePasswordAuthentication);
+ options.disablePasswordAuthentication = JSON.parse(options.disablePasswordAuthentication);
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.disablePasswordAuthentication}]);
}
paramPath = options.path + '/' + 'ssh';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.ssh) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.ssh);
+ cli.output.verbose('================================================');
if (options.parse && options.ssh) {
options.ssh = JSON.parse(options.ssh);
}
@@ -2315,6 +1752,10 @@ exports.init = function (cli) {
.option('--ssh', $('Remove the ssh value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2350,27 +1791,24 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add linux-configuration
- var catparametersCreateOrUpdateVirtualMachineScaleSetsLinuxConfiguration2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsLinuxConfiguration2 = catparametersCreateOrUpdateVirtualMachineScaleSetsLinuxConfiguration2.category('config')
+ //config set ssh
+ var catparametersCreateOrUpdateVirtualMachineScaleSetsSsh0 = cli.category('vmss');
+ var parametersCreateOrUpdateVirtualMachineScaleSetsSsh0 = catparametersCreateOrUpdateVirtualMachineScaleSetsSsh0.category('config')
.description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsLinuxConfiguration2 = parametersCreateOrUpdateVirtualMachineScaleSetsLinuxConfiguration2.category('linux-configuration')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsLinuxConfiguration2.command('add')
- .description($('Add linux-configuration in config string or files, e.g. \r\n {\r\n ...\r\n "linuxConfiguration" : {\r\n "disablePasswordAuthentication":null,\r\n "ssh":{\r\n "publicKeys":[\r\n {\r\n "path":"",\r\n "keyData":""\r\n }\r\n ]\r\n }\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
+ var setparametersCreateOrUpdateVirtualMachineScaleSetsSsh0 = parametersCreateOrUpdateVirtualMachineScaleSetsSsh0.category('ssh')
+ .description($('Commands to set components of virtual-machine-scale-sets in config file.'));
+ setparametersCreateOrUpdateVirtualMachineScaleSetsSsh0.command('set')
+ .description($('Set ssh in config string or files, e.g. \r\n {\r\n ...\r\n "ssh" : {\r\n "publicKeys":[\r\n {\r\n "path":"",\r\n "keyData":""\r\n }\r\n ]\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--disable-password-authentication ', $('Add the disable-password-authentication value.'))
- .option('--ssh ', $('Add the ssh value.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
+ .option('--public-keys ', $('Set the public-keys value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2378,30 +1816,18 @@ exports.init = function (cli) {
var parametersObj = JSON.parse(fileContent);
cli.output.verbose('JSON object:');
cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/osProfile/linuxConfiguration' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/osProfile/linuxConfiguration' + '/' + 'disablePasswordAuthentication';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.disablePasswordAuthentication) {
- if (options.parse && options.disablePasswordAuthentication) {
- options.disablePasswordAuthentication = JSON.parse(options.disablePasswordAuthentication);
- }
- options.disablePasswordAuthentication = JSON.parse(options.disablePasswordAuthentication);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.disablePasswordAuthentication}]);
- }
- paramPath = '/virtualMachineProfile/osProfile/linuxConfiguration' + '/' + 'ssh';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.ssh) {
- if (options.parse && options.ssh) {
- options.ssh = JSON.parse(options.ssh);
+ options.operation = 'replace';
+ options.path = '/virtualMachineProfile/osProfile/linuxConfiguration/ssh';
+ var paramPath = options.path + '/' + 'publicKeys';
+ if (options.publicKeys) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.publicKeys);
+ cli.output.verbose('================================================');
+ if (options.parse && options.publicKeys) {
+ options.publicKeys = JSON.parse(options.publicKeys);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.ssh}]);
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.publicKeys}]);
}
var updatedContent = JSON.stringify(parametersObj);
cli.output.verbose('=====================================');
@@ -2427,6 +1853,10 @@ exports.init = function (cli) {
.option('--public-keys', $('Remove the public-keys value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2458,58 +1888,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add ssh
- var catparametersCreateOrUpdateVirtualMachineScaleSetsSsh2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsSsh2 = catparametersCreateOrUpdateVirtualMachineScaleSetsSsh2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsSsh2 = parametersCreateOrUpdateVirtualMachineScaleSetsSsh2.category('ssh')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsSsh2.command('add')
- .description($('Add ssh in config string or files, e.g. \r\n {\r\n ...\r\n "ssh" : {\r\n "publicKeys":[\r\n {\r\n "path":"",\r\n "keyData":""\r\n }\r\n ]\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--public-keys ', $('Add the public-keys value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/osProfile/linuxConfiguration/ssh' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/osProfile/linuxConfiguration/ssh' + '/' + 'publicKeys';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.publicKeys) {
- if (options.parse && options.publicKeys) {
- options.publicKeys = JSON.parse(options.publicKeys);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.publicKeys}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set public-keys
var catparametersCreateOrUpdateVirtualMachineScaleSetsPublicKeys0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsPublicKeys0 = catparametersCreateOrUpdateVirtualMachineScaleSetsPublicKeys0.category('config')
@@ -2522,15 +1900,15 @@ exports.init = function (cli) {
.option('--parameter-file ', $('The parameter file path.'))
.option('--index ', $('Indexer: index.'))
.option('--value ', $('The input string value for the indexed item.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--path ', $('Set the path value.'))
.option('--key-data ', $('Set the key-data value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2541,23 +1919,26 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/osProfile/linuxConfiguration/ssh/publicKeys' + (options.index ? ('/' + options.index) : '');
if (options.value) {
+ cli.output.verbose(options.value);
jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
}
var paramPath = options.path + '/' + 'path';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.path) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.path);
+ cli.output.verbose('================================================');
if (options.parse && options.path) {
options.path = JSON.parse(options.path);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.path}]);
}
paramPath = options.path + '/' + 'keyData';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.keyData) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.keyData);
+ cli.output.verbose('================================================');
if (options.parse && options.keyData) {
options.keyData = JSON.parse(options.keyData);
}
@@ -2589,6 +1970,10 @@ exports.init = function (cli) {
.option('--key-data', $('Remove the key-data value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2624,27 +2009,27 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add public-keys
- var catparametersCreateOrUpdateVirtualMachineScaleSetsPublicKeys2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsPublicKeys2 = catparametersCreateOrUpdateVirtualMachineScaleSetsPublicKeys2.category('config')
+ //config set secrets
+ var catparametersCreateOrUpdateVirtualMachineScaleSetsSecrets0 = cli.category('vmss');
+ var parametersCreateOrUpdateVirtualMachineScaleSetsSecrets0 = catparametersCreateOrUpdateVirtualMachineScaleSetsSecrets0.category('config')
.description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsPublicKeys2 = parametersCreateOrUpdateVirtualMachineScaleSetsPublicKeys2.category('public-keys')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsPublicKeys2.command('add')
- .description($('Add public-keys in config string or files, e.g. \r\n {\r\n ...\r\n "publicKeys" : {\r\n "path":"",\r\n "keyData":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
+ var setparametersCreateOrUpdateVirtualMachineScaleSetsSecrets0 = parametersCreateOrUpdateVirtualMachineScaleSetsSecrets0.category('secrets')
+ .description($('Commands to set components of virtual-machine-scale-sets in config file.'));
+ setparametersCreateOrUpdateVirtualMachineScaleSetsSecrets0.command('set')
+ .description($('Set secrets in config string or files, e.g. \r\n {\r\n ...\r\n "secrets" : {\r\n "sourceVault":{\r\n "id":""\r\n },\r\n "vaultCertificates":[\r\n {\r\n "certificateUrl":"",\r\n "certificateStore":""\r\n }\r\n ]\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--path ', $('Add the path value.'))
- .option('--key-data ', $('Add the key-data value.'))
+ .option('--index ', $('Indexer: index.'))
+ .option('--value ', $('The input string value for the indexed item.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
+ .option('--source-vault ', $('Set the source-vault value.'))
+ .option('--vault-certificates ', $('Set the vault-certificates value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2652,29 +2037,33 @@ exports.init = function (cli) {
var parametersObj = JSON.parse(fileContent);
cli.output.verbose('JSON object:');
cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/osProfile/linuxConfiguration/ssh/publicKeys' + (options.index ? ('/' + options.index) : '') + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/osProfile/linuxConfiguration/ssh/publicKeys' + (options.index ? ('/' + options.index) : '') + '/' + 'path';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.path) {
- if (options.parse && options.path) {
- options.path = JSON.parse(options.path);
+ options.operation = 'replace';
+ options.path = '/virtualMachineProfile/osProfile/secrets' + (options.index ? ('/' + options.index) : '');
+ if (options.value) {
+ cli.output.verbose(options.value);
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
+ }
+ var paramPath = options.path + '/' + 'sourceVault';
+ if (options.sourceVault) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.sourceVault);
+ cli.output.verbose('================================================');
+ if (options.parse && options.sourceVault) {
+ options.sourceVault = JSON.parse(options.sourceVault);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.path}]);
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.sourceVault}]);
}
- paramPath = '/virtualMachineProfile/osProfile/linuxConfiguration/ssh/publicKeys' + (options.index ? ('/' + options.index) : '') + '/' + 'keyData';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.keyData) {
- if (options.parse && options.keyData) {
- options.keyData = JSON.parse(options.keyData);
+ paramPath = options.path + '/' + 'vaultCertificates';
+ if (options.vaultCertificates) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.vaultCertificates);
+ cli.output.verbose('================================================');
+ if (options.parse && options.vaultCertificates) {
+ options.vaultCertificates = JSON.parse(options.vaultCertificates);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.keyData}]);
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.vaultCertificates}]);
}
var updatedContent = JSON.stringify(parametersObj);
cli.output.verbose('=====================================');
@@ -2702,62 +2091,10 @@ exports.init = function (cli) {
.option('--vault-certificates', $('Remove the vault-certificates value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'remove';
- options.path = '/virtualMachineProfile/osProfile/secrets' + (options.index ? ('/' + options.index) : '');
- var anySubItem = false || options.sourceVault || options.vaultCertificates;
- if (anySubItem) {
- var subItemPath = null;
- if (options.sourceVault) {
- subItemPath = options.path + '/sourceVault';
- jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
- }
- if (options.vaultCertificates) {
- subItemPath = options.path + '/vaultCertificates';
- jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
- }
- }
- else {
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path}]);
- }
-
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
- //config add secrets
- var catparametersCreateOrUpdateVirtualMachineScaleSetsSecrets2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsSecrets2 = catparametersCreateOrUpdateVirtualMachineScaleSetsSecrets2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsSecrets2 = parametersCreateOrUpdateVirtualMachineScaleSetsSecrets2.category('secrets')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsSecrets2.command('add')
- .description($('Add secrets in config string or files, e.g. \r\n {\r\n ...\r\n "secrets" : {\r\n "sourceVault":{\r\n "id":""\r\n },\r\n "vaultCertificates":[\r\n {\r\n "certificateUrl":"",\r\n "certificateStore":""\r\n }\r\n ]\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--source-vault ', $('Add the source-vault value.'))
- .option('--vault-certificates ', $('Add the vault-certificates value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2765,30 +2102,24 @@ exports.init = function (cli) {
var parametersObj = JSON.parse(fileContent);
cli.output.verbose('JSON object:');
cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/osProfile/secrets' + (options.index ? ('/' + options.index) : '') + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/osProfile/secrets' + (options.index ? ('/' + options.index) : '') + '/' + 'sourceVault';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.sourceVault) {
- if (options.parse && options.sourceVault) {
- options.sourceVault = JSON.parse(options.sourceVault);
+ options.operation = 'remove';
+ options.path = '/virtualMachineProfile/osProfile/secrets' + (options.index ? ('/' + options.index) : '');
+ var anySubItem = false || options.sourceVault || options.vaultCertificates;
+ if (anySubItem) {
+ var subItemPath = null;
+ if (options.sourceVault) {
+ subItemPath = options.path + '/sourceVault';
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.sourceVault}]);
- }
- paramPath = '/virtualMachineProfile/osProfile/secrets' + (options.index ? ('/' + options.index) : '') + '/' + 'vaultCertificates';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.vaultCertificates) {
- if (options.parse && options.vaultCertificates) {
- options.vaultCertificates = JSON.parse(options.vaultCertificates);
+ if (options.vaultCertificates) {
+ subItemPath = options.path + '/vaultCertificates';
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.vaultCertificates}]);
}
+ else {
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path}]);
+ }
+
var updatedContent = JSON.stringify(parametersObj);
cli.output.verbose('=====================================');
cli.output.verbose('JSON object (updated):');
@@ -2799,7 +2130,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
-
//config set source-vault
var catparametersCreateOrUpdateVirtualMachineScaleSetsSourceVault0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsSourceVault0 = catparametersCreateOrUpdateVirtualMachineScaleSetsSourceVault0.category('config')
@@ -2811,14 +2141,14 @@ exports.init = function (cli) {
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
.option('--secrets-index ', $('Indexer: secrets-index.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--id ', $('Set the id value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2829,10 +2159,11 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/osProfile/secrets/' + options.secretsIndex + '/sourceVault';
var paramPath = options.path + '/' + 'id';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.id) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.id);
+ cli.output.verbose('================================================');
if (options.parse && options.id) {
options.id = JSON.parse(options.id);
}
@@ -2863,6 +2194,10 @@ exports.init = function (cli) {
.option('--id', $('Remove the id value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2894,58 +2229,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add source-vault
- var catparametersCreateOrUpdateVirtualMachineScaleSetsSourceVault2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsSourceVault2 = catparametersCreateOrUpdateVirtualMachineScaleSetsSourceVault2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsSourceVault2 = parametersCreateOrUpdateVirtualMachineScaleSetsSourceVault2.category('source-vault')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsSourceVault2.command('add')
- .description($('Add source-vault in config string or files, e.g. \r\n {\r\n ...\r\n "sourceVault" : {\r\n "id":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--id ', $('Add the id value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/osProfile/secrets/' + options.secretsIndex + '/sourceVault' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/osProfile/secrets/' + options.secretsIndex + '/sourceVault' + '/' + 'id';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.id) {
- if (options.parse && options.id) {
- options.id = JSON.parse(options.id);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.id}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set vault-certificates
var catparametersCreateOrUpdateVirtualMachineScaleSetsVaultCertificates0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsVaultCertificates0 = catparametersCreateOrUpdateVirtualMachineScaleSetsVaultCertificates0.category('config')
@@ -2959,15 +2242,15 @@ exports.init = function (cli) {
.option('--index ', $('Indexer: index.'))
.option('--secrets-index ', $('Indexer: secrets-index.'))
.option('--value ', $('The input string value for the indexed item.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--certificate-url ', $('Set the certificate-url value.'))
.option('--certificate-store ', $('Set the certificate-store value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -2978,23 +2261,26 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/osProfile/secrets/' + options.secretsIndex + '/vaultCertificates' + (options.index ? ('/' + options.index) : '');
if (options.value) {
+ cli.output.verbose(options.value);
jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
}
var paramPath = options.path + '/' + 'certificateUrl';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.certificateUrl) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.certificateUrl);
+ cli.output.verbose('================================================');
if (options.parse && options.certificateUrl) {
options.certificateUrl = JSON.parse(options.certificateUrl);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.certificateUrl}]);
}
paramPath = options.path + '/' + 'certificateStore';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.certificateStore) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.certificateStore);
+ cli.output.verbose('================================================');
if (options.parse && options.certificateStore) {
options.certificateStore = JSON.parse(options.certificateStore);
}
@@ -3027,6 +2313,10 @@ exports.init = function (cli) {
.option('--certificate-store', $('Remove the certificate-store value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -3062,27 +2352,25 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add vault-certificates
- var catparametersCreateOrUpdateVirtualMachineScaleSetsVaultCertificates2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsVaultCertificates2 = catparametersCreateOrUpdateVirtualMachineScaleSetsVaultCertificates2.category('config')
+ //config set storage-profile
+ var catparametersCreateOrUpdateVirtualMachineScaleSetsStorageProfile0 = cli.category('vmss');
+ var parametersCreateOrUpdateVirtualMachineScaleSetsStorageProfile0 = catparametersCreateOrUpdateVirtualMachineScaleSetsStorageProfile0.category('config')
.description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsVaultCertificates2 = parametersCreateOrUpdateVirtualMachineScaleSetsVaultCertificates2.category('vault-certificates')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsVaultCertificates2.command('add')
- .description($('Add vault-certificates in config string or files, e.g. \r\n {\r\n ...\r\n "vaultCertificates" : {\r\n "certificateUrl":"",\r\n "certificateStore":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
+ var setparametersCreateOrUpdateVirtualMachineScaleSetsStorageProfile0 = parametersCreateOrUpdateVirtualMachineScaleSetsStorageProfile0.category('storage-profile')
+ .description($('Commands to set components of virtual-machine-scale-sets in config file.'));
+ setparametersCreateOrUpdateVirtualMachineScaleSetsStorageProfile0.command('set')
+ .description($('Set storage-profile in config string or files, e.g. \r\n {\r\n ...\r\n "storageProfile" : {\r\n "imageReference":{\r\n "publisher":"",\r\n "offer":"",\r\n "sku":"",\r\n "version":""\r\n },\r\n "osDisk":{\r\n "name":"",\r\n "caching":"",\r\n "createOption":"",\r\n "osType":"",\r\n "image":{\r\n "uri":""\r\n },\r\n "vhdContainers":[\r\n ""\r\n ]\r\n }\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--certificate-url ', $('Add the certificate-url value.'))
- .option('--certificate-store ', $('Add the certificate-store value.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
+ .option('--image-reference ', $('Set the image-reference value.'))
+ .option('--os-disk ', $('Set the os-disk value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -3090,29 +2378,29 @@ exports.init = function (cli) {
var parametersObj = JSON.parse(fileContent);
cli.output.verbose('JSON object:');
cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/osProfile/secrets/' + options.secretsIndex + '/vaultCertificates' + (options.index ? ('/' + options.index) : '') + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/osProfile/secrets/' + options.secretsIndex + '/vaultCertificates' + (options.index ? ('/' + options.index) : '') + '/' + 'certificateUrl';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.certificateUrl) {
- if (options.parse && options.certificateUrl) {
- options.certificateUrl = JSON.parse(options.certificateUrl);
+ options.operation = 'replace';
+ options.path = '/virtualMachineProfile/storageProfile';
+ var paramPath = options.path + '/' + 'imageReference';
+ if (options.imageReference) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.imageReference);
+ cli.output.verbose('================================================');
+ if (options.parse && options.imageReference) {
+ options.imageReference = JSON.parse(options.imageReference);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.certificateUrl}]);
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.imageReference}]);
}
- paramPath = '/virtualMachineProfile/osProfile/secrets/' + options.secretsIndex + '/vaultCertificates' + (options.index ? ('/' + options.index) : '') + '/' + 'certificateStore';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.certificateStore) {
- if (options.parse && options.certificateStore) {
- options.certificateStore = JSON.parse(options.certificateStore);
+ paramPath = options.path + '/' + 'osDisk';
+ if (options.osDisk) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.osDisk);
+ cli.output.verbose('================================================');
+ if (options.parse && options.osDisk) {
+ options.osDisk = JSON.parse(options.osDisk);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.certificateStore}]);
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.osDisk}]);
}
var updatedContent = JSON.stringify(parametersObj);
cli.output.verbose('=====================================');
@@ -3139,6 +2427,10 @@ exports.init = function (cli) {
.option('--os-disk', $('Remove the os-disk value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -3174,69 +2466,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add storage-profile
- var catparametersCreateOrUpdateVirtualMachineScaleSetsStorageProfile2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsStorageProfile2 = catparametersCreateOrUpdateVirtualMachineScaleSetsStorageProfile2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsStorageProfile2 = parametersCreateOrUpdateVirtualMachineScaleSetsStorageProfile2.category('storage-profile')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsStorageProfile2.command('add')
- .description($('Add storage-profile in config string or files, e.g. \r\n {\r\n ...\r\n "storageProfile" : {\r\n "imageReference":{\r\n "publisher":"",\r\n "offer":"",\r\n "sku":"",\r\n "version":""\r\n },\r\n "osDisk":{\r\n "name":"",\r\n "caching":"",\r\n "createOption":"",\r\n "osType":"",\r\n "image":{\r\n "uri":""\r\n },\r\n "vhdContainers":[\r\n ""\r\n ]\r\n }\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--image-reference ', $('Add the image-reference value.'))
- .option('--os-disk ', $('Add the os-disk value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/storageProfile' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/storageProfile' + '/' + 'imageReference';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.imageReference) {
- if (options.parse && options.imageReference) {
- options.imageReference = JSON.parse(options.imageReference);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.imageReference}]);
- }
- paramPath = '/virtualMachineProfile/storageProfile' + '/' + 'osDisk';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.osDisk) {
- if (options.parse && options.osDisk) {
- options.osDisk = JSON.parse(options.osDisk);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.osDisk}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set image-reference
var catparametersCreateOrUpdateVirtualMachineScaleSetsImageReference0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsImageReference0 = catparametersCreateOrUpdateVirtualMachineScaleSetsImageReference0.category('config')
@@ -3247,17 +2476,17 @@ exports.init = function (cli) {
.description($('Set image-reference in config string or files, e.g. \r\n {\r\n ...\r\n "imageReference" : {\r\n "publisher":"",\r\n "offer":"",\r\n "sku":"",\r\n "version":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--publisher ', $('Set the publisher value.'))
.option('--offer ', $('Set the offer value.'))
.option('--sku ', $('Set the sku value.'))
.option('--version ', $('Set the version value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -3268,40 +2497,44 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/storageProfile/imageReference';
var paramPath = options.path + '/' + 'publisher';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.publisher) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.publisher);
+ cli.output.verbose('================================================');
if (options.parse && options.publisher) {
options.publisher = JSON.parse(options.publisher);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.publisher}]);
}
paramPath = options.path + '/' + 'offer';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.offer) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.offer);
+ cli.output.verbose('================================================');
if (options.parse && options.offer) {
options.offer = JSON.parse(options.offer);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.offer}]);
}
paramPath = options.path + '/' + 'sku';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.sku) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.sku);
+ cli.output.verbose('================================================');
if (options.parse && options.sku) {
options.sku = JSON.parse(options.sku);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.sku}]);
}
paramPath = options.path + '/' + 'version';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.version) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.version);
+ cli.output.verbose('================================================');
if (options.parse && options.version) {
options.version = JSON.parse(options.version);
}
@@ -3334,6 +2567,10 @@ exports.init = function (cli) {
.option('--version', $('Remove the version value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -3377,91 +2614,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add image-reference
- var catparametersCreateOrUpdateVirtualMachineScaleSetsImageReference2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsImageReference2 = catparametersCreateOrUpdateVirtualMachineScaleSetsImageReference2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsImageReference2 = parametersCreateOrUpdateVirtualMachineScaleSetsImageReference2.category('image-reference')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsImageReference2.command('add')
- .description($('Add image-reference in config string or files, e.g. \r\n {\r\n ...\r\n "imageReference" : {\r\n "publisher":"",\r\n "offer":"",\r\n "sku":"",\r\n "version":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--publisher ', $('Add the publisher value.'))
- .option('--offer ', $('Add the offer value.'))
- .option('--sku ', $('Add the sku value.'))
- .option('--version ', $('Add the version value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/storageProfile/imageReference' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/storageProfile/imageReference' + '/' + 'publisher';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.publisher) {
- if (options.parse && options.publisher) {
- options.publisher = JSON.parse(options.publisher);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.publisher}]);
- }
- paramPath = '/virtualMachineProfile/storageProfile/imageReference' + '/' + 'offer';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.offer) {
- if (options.parse && options.offer) {
- options.offer = JSON.parse(options.offer);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.offer}]);
- }
- paramPath = '/virtualMachineProfile/storageProfile/imageReference' + '/' + 'sku';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.sku) {
- if (options.parse && options.sku) {
- options.sku = JSON.parse(options.sku);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.sku}]);
- }
- paramPath = '/virtualMachineProfile/storageProfile/imageReference' + '/' + 'version';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.version) {
- if (options.parse && options.version) {
- options.version = JSON.parse(options.version);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.version}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set os-disk
var catparametersCreateOrUpdateVirtualMachineScaleSetsOsDisk0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsOsDisk0 = catparametersCreateOrUpdateVirtualMachineScaleSetsOsDisk0.category('config')
@@ -3472,7 +2624,7 @@ exports.init = function (cli) {
.description($('Set os-disk in config string or files, e.g. \r\n {\r\n ...\r\n "osDisk" : {\r\n "name":"",\r\n "caching":"",\r\n "createOption":"",\r\n "osType":"",\r\n "image":{\r\n "uri":""\r\n },\r\n "vhdContainers":[\r\n ""\r\n ]\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--name ', $('Set the name value.'))
.option('--caching ', $('Set the caching value.'))
.option('--create-option ', $('Set the create-option value.'))
@@ -3481,10 +2633,10 @@ exports.init = function (cli) {
.option('--vhd-containers ', $('Set the vhd-containers value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -3495,60 +2647,66 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/storageProfile/osDisk';
var paramPath = options.path + '/' + 'name';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.name) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.name);
+ cli.output.verbose('================================================');
if (options.parse && options.name) {
options.name = JSON.parse(options.name);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.name}]);
}
paramPath = options.path + '/' + 'caching';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.caching) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.caching);
+ cli.output.verbose('================================================');
if (options.parse && options.caching) {
options.caching = JSON.parse(options.caching);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.caching}]);
}
paramPath = options.path + '/' + 'createOption';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.createOption) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.createOption);
+ cli.output.verbose('================================================');
if (options.parse && options.createOption) {
options.createOption = JSON.parse(options.createOption);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.createOption}]);
}
paramPath = options.path + '/' + 'osType';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.osType) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.osType);
+ cli.output.verbose('================================================');
if (options.parse && options.osType) {
options.osType = JSON.parse(options.osType);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.osType}]);
}
paramPath = options.path + '/' + 'image';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.image) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.image);
+ cli.output.verbose('================================================');
if (options.parse && options.image) {
options.image = JSON.parse(options.image);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.image}]);
}
paramPath = options.path + '/' + 'vhdContainers';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.vhdContainers) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.vhdContainers);
+ cli.output.verbose('================================================');
if (options.parse && options.vhdContainers) {
options.vhdContainers = JSON.parse(options.vhdContainers);
}
@@ -3583,6 +2741,10 @@ exports.init = function (cli) {
.option('--vhd-containers', $('Remove the vhd-containers value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -3592,144 +2754,38 @@ exports.init = function (cli) {
cli.output.verbose(JSON.stringify(parametersObj));
options.operation = 'remove';
options.path = '/virtualMachineProfile/storageProfile/osDisk';
- var anySubItem = false || options.name || options.caching || options.createOption || options.osType || options.image || options.vhdContainers;
- if (anySubItem) {
- var subItemPath = null;
- if (options.name) {
- subItemPath = options.path + '/name';
- jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
- }
- if (options.caching) {
- subItemPath = options.path + '/caching';
- jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
- }
- if (options.createOption) {
- subItemPath = options.path + '/createOption';
- jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
- }
- if (options.osType) {
- subItemPath = options.path + '/osType';
- jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
- }
- if (options.image) {
- subItemPath = options.path + '/image';
- jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
- }
- if (options.vhdContainers) {
- subItemPath = options.path + '/vhdContainers';
- jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
- }
- }
- else {
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path}]);
- }
-
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
- //config add os-disk
- var catparametersCreateOrUpdateVirtualMachineScaleSetsOsDisk2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsOsDisk2 = catparametersCreateOrUpdateVirtualMachineScaleSetsOsDisk2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsOsDisk2 = parametersCreateOrUpdateVirtualMachineScaleSetsOsDisk2.category('os-disk')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsOsDisk2.command('add')
- .description($('Add os-disk in config string or files, e.g. \r\n {\r\n ...\r\n "osDisk" : {\r\n "name":"",\r\n "caching":"",\r\n "createOption":"",\r\n "osType":"",\r\n "image":{\r\n "uri":""\r\n },\r\n "vhdContainers":[\r\n ""\r\n ]\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--name ', $('Add the name value.'))
- .option('--caching ', $('Add the caching value.'))
- .option('--create-option ', $('Add the create-option value.'))
- .option('--os-type ', $('Add the os-type value.'))
- .option('--image ', $('Add the image value.'))
- .option('--vhd-containers ', $('Add the vhd-containers value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/storageProfile/osDisk' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/storageProfile/osDisk' + '/' + 'name';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.name) {
- if (options.parse && options.name) {
- options.name = JSON.parse(options.name);
+ var anySubItem = false || options.name || options.caching || options.createOption || options.osType || options.image || options.vhdContainers;
+ if (anySubItem) {
+ var subItemPath = null;
+ if (options.name) {
+ subItemPath = options.path + '/name';
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.name}]);
- }
- paramPath = '/virtualMachineProfile/storageProfile/osDisk' + '/' + 'caching';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.caching) {
- if (options.parse && options.caching) {
- options.caching = JSON.parse(options.caching);
+ if (options.caching) {
+ subItemPath = options.path + '/caching';
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.caching}]);
- }
- paramPath = '/virtualMachineProfile/storageProfile/osDisk' + '/' + 'createOption';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.createOption) {
- if (options.parse && options.createOption) {
- options.createOption = JSON.parse(options.createOption);
+ if (options.createOption) {
+ subItemPath = options.path + '/createOption';
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.createOption}]);
- }
- paramPath = '/virtualMachineProfile/storageProfile/osDisk' + '/' + 'osType';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.osType) {
- if (options.parse && options.osType) {
- options.osType = JSON.parse(options.osType);
+ if (options.osType) {
+ subItemPath = options.path + '/osType';
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.osType}]);
- }
- paramPath = '/virtualMachineProfile/storageProfile/osDisk' + '/' + 'image';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.image) {
- if (options.parse && options.image) {
- options.image = JSON.parse(options.image);
+ if (options.image) {
+ subItemPath = options.path + '/image';
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.image}]);
- }
- paramPath = '/virtualMachineProfile/storageProfile/osDisk' + '/' + 'vhdContainers';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.vhdContainers) {
- if (options.parse && options.vhdContainers) {
- options.vhdContainers = JSON.parse(options.vhdContainers);
+ if (options.vhdContainers) {
+ subItemPath = options.path + '/vhdContainers';
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.vhdContainers}]);
}
+ else {
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path}]);
+ }
+
var updatedContent = JSON.stringify(parametersObj);
cli.output.verbose('=====================================');
cli.output.verbose('JSON object (updated):');
@@ -3740,7 +2796,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
-
//config set image
var catparametersCreateOrUpdateVirtualMachineScaleSetsImage0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsImage0 = catparametersCreateOrUpdateVirtualMachineScaleSetsImage0.category('config')
@@ -3751,14 +2806,14 @@ exports.init = function (cli) {
.description($('Set image in config string or files, e.g. \r\n {\r\n ...\r\n "image" : {\r\n "uri":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--uri ', $('Set the uri value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -3769,10 +2824,11 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/storageProfile/osDisk/image';
var paramPath = options.path + '/' + 'uri';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.uri) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.uri);
+ cli.output.verbose('================================================');
if (options.parse && options.uri) {
options.uri = JSON.parse(options.uri);
}
@@ -3802,6 +2858,10 @@ exports.init = function (cli) {
.option('--uri', $('Remove the uri value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -3833,58 +2893,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add image
- var catparametersCreateOrUpdateVirtualMachineScaleSetsImage2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsImage2 = catparametersCreateOrUpdateVirtualMachineScaleSetsImage2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsImage2 = parametersCreateOrUpdateVirtualMachineScaleSetsImage2.category('image')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsImage2.command('add')
- .description($('Add image in config string or files, e.g. \r\n {\r\n ...\r\n "image" : {\r\n "uri":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--uri ', $('Add the uri value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/storageProfile/osDisk/image' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/storageProfile/osDisk/image' + '/' + 'uri';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.uri) {
- if (options.parse && options.uri) {
- options.uri = JSON.parse(options.uri);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.uri}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set vhd-containers
var catparametersCreateOrUpdateVirtualMachineScaleSetsVhdContainers0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsVhdContainers0 = catparametersCreateOrUpdateVirtualMachineScaleSetsVhdContainers0.category('config')
@@ -3897,13 +2905,13 @@ exports.init = function (cli) {
.option('--parameter-file ', $('The parameter file path.'))
.option('--index ', $('Indexer: index.'))
.option('--value ', $('The input string value for the indexed item.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -3914,6 +2922,7 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/storageProfile/osDisk/vhdContainers' + (options.index ? ('/' + options.index) : '');
if (options.value) {
+ cli.output.verbose(options.value);
jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
}
var updatedContent = JSON.stringify(parametersObj);
@@ -3940,6 +2949,10 @@ exports.init = function (cli) {
.option('--index ', $('Indexer: index.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -3961,25 +2974,24 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add vhd-containers
- var catparametersCreateOrUpdateVirtualMachineScaleSetsVhdContainers2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsVhdContainers2 = catparametersCreateOrUpdateVirtualMachineScaleSetsVhdContainers2.category('config')
+ //config set network-profile
+ var catparametersCreateOrUpdateVirtualMachineScaleSetsNetworkProfile0 = cli.category('vmss');
+ var parametersCreateOrUpdateVirtualMachineScaleSetsNetworkProfile0 = catparametersCreateOrUpdateVirtualMachineScaleSetsNetworkProfile0.category('config')
.description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsVhdContainers2 = parametersCreateOrUpdateVirtualMachineScaleSetsVhdContainers2.category('vhd-containers')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsVhdContainers2.command('add')
- .description($('Add vhd-containers in config string or files, e.g. \r\n {\r\n ...\r\n "vhdContainers" : ""\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
+ var setparametersCreateOrUpdateVirtualMachineScaleSetsNetworkProfile0 = parametersCreateOrUpdateVirtualMachineScaleSetsNetworkProfile0.category('network-profile')
+ .description($('Commands to set components of virtual-machine-scale-sets in config file.'));
+ setparametersCreateOrUpdateVirtualMachineScaleSetsNetworkProfile0.command('set')
+ .description($('Set network-profile in config string or files, e.g. \r\n {\r\n ...\r\n "networkProfile" : {\r\n "networkInterfaceConfigurations":[\r\n {\r\n "name":"",\r\n "primary":null,\r\n "ipConfigurations":[\r\n {\r\n "name":"",\r\n "subnet":{\r\n "id":""\r\n },\r\n "loadBalancerBackendAddressPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "loadBalancerInboundNatPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ]\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
.usage('[options]')
.option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
+ .option('--network-interface-configurations ', $('Set the network-interface-configurations value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -3987,10 +2999,19 @@ exports.init = function (cli) {
var parametersObj = JSON.parse(fileContent);
cli.output.verbose('JSON object:');
cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/storageProfile/osDisk/vhdContainers' + (options.index ? ('/' + options.index) : '') + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
+ options.operation = 'replace';
+ options.path = '/virtualMachineProfile/networkProfile';
+ var paramPath = options.path + '/' + 'networkInterfaceConfigurations';
+ if (options.networkInterfaceConfigurations) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.networkInterfaceConfigurations);
+ cli.output.verbose('================================================');
+ if (options.parse && options.networkInterfaceConfigurations) {
+ options.networkInterfaceConfigurations = JSON.parse(options.networkInterfaceConfigurations);
+ }
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.networkInterfaceConfigurations}]);
+ }
var updatedContent = JSON.stringify(parametersObj);
cli.output.verbose('=====================================');
cli.output.verbose('JSON object (updated):');
@@ -4015,6 +3036,10 @@ exports.init = function (cli) {
.option('--network-interface-configurations', $('Remove the network-interface-configurations value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -4046,58 +3071,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add network-profile
- var catparametersCreateOrUpdateVirtualMachineScaleSetsNetworkProfile2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsNetworkProfile2 = catparametersCreateOrUpdateVirtualMachineScaleSetsNetworkProfile2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsNetworkProfile2 = parametersCreateOrUpdateVirtualMachineScaleSetsNetworkProfile2.category('network-profile')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsNetworkProfile2.command('add')
- .description($('Add network-profile in config string or files, e.g. \r\n {\r\n ...\r\n "networkProfile" : {\r\n "networkInterfaceConfigurations":[\r\n {\r\n "name":"",\r\n "primary":null,\r\n "ipConfigurations":[\r\n {\r\n "name":"",\r\n "subnet":{\r\n "id":""\r\n },\r\n "loadBalancerBackendAddressPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "loadBalancerInboundNatPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ]\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--network-interface-configurations ', $('Add the network-interface-configurations value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/networkProfile' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/networkProfile' + '/' + 'networkInterfaceConfigurations';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.networkInterfaceConfigurations) {
- if (options.parse && options.networkInterfaceConfigurations) {
- options.networkInterfaceConfigurations = JSON.parse(options.networkInterfaceConfigurations);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.networkInterfaceConfigurations}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set network-interface-configurations
var catparametersCreateOrUpdateVirtualMachineScaleSetsNetworkInterfaceConfigurations0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsNetworkInterfaceConfigurations0 = catparametersCreateOrUpdateVirtualMachineScaleSetsNetworkInterfaceConfigurations0.category('config')
@@ -4110,17 +3083,17 @@ exports.init = function (cli) {
.option('--parameter-file ', $('The parameter file path.'))
.option('--index ', $('Indexer: index.'))
.option('--value ', $('The input string value for the indexed item.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--name ', $('Set the name value.'))
.option('--primary ', $('Set the primary value.'))
.option('--ip-configurations ', $('Set the ip-configurations value.'))
.option('--id ', $('Set the id value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -4131,44 +3104,49 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations' + (options.index ? ('/' + options.index) : '');
if (options.value) {
+ cli.output.verbose(options.value);
jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
}
var paramPath = options.path + '/' + 'name';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.name) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.name);
+ cli.output.verbose('================================================');
if (options.parse && options.name) {
options.name = JSON.parse(options.name);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.name}]);
}
paramPath = options.path + '/' + 'primary';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.primary) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.primary);
+ cli.output.verbose('================================================');
if (options.parse && options.primary) {
options.primary = JSON.parse(options.primary);
}
- options.primary = JSON.parse(options.primary);
+ options.primary = JSON.parse(options.primary);
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.primary}]);
}
paramPath = options.path + '/' + 'ipConfigurations';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.ipConfigurations) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.ipConfigurations);
+ cli.output.verbose('================================================');
if (options.parse && options.ipConfigurations) {
options.ipConfigurations = JSON.parse(options.ipConfigurations);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.ipConfigurations}]);
}
paramPath = options.path + '/' + 'id';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.id) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.id);
+ cli.output.verbose('================================================');
if (options.parse && options.id) {
options.id = JSON.parse(options.id);
}
@@ -4202,6 +3180,10 @@ exports.init = function (cli) {
.option('--id', $('Remove the id value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -4245,92 +3227,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add network-interface-configurations
- var catparametersCreateOrUpdateVirtualMachineScaleSetsNetworkInterfaceConfigurations2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsNetworkInterfaceConfigurations2 = catparametersCreateOrUpdateVirtualMachineScaleSetsNetworkInterfaceConfigurations2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsNetworkInterfaceConfigurations2 = parametersCreateOrUpdateVirtualMachineScaleSetsNetworkInterfaceConfigurations2.category('network-interface-configurations')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsNetworkInterfaceConfigurations2.command('add')
- .description($('Add network-interface-configurations in config string or files, e.g. \r\n {\r\n ...\r\n "networkInterfaceConfigurations" : {\r\n "name":"",\r\n "primary":null,\r\n "ipConfigurations":[\r\n {\r\n "name":"",\r\n "subnet":{\r\n "id":""\r\n },\r\n "loadBalancerBackendAddressPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "loadBalancerInboundNatPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--name ', $('Add the name value.'))
- .option('--primary ', $('Add the primary value.'))
- .option('--ip-configurations ', $('Add the ip-configurations value.'))
- .option('--id ', $('Add the id value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations' + (options.index ? ('/' + options.index) : '') + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations' + (options.index ? ('/' + options.index) : '') + '/' + 'name';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.name) {
- if (options.parse && options.name) {
- options.name = JSON.parse(options.name);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.name}]);
- }
- paramPath = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations' + (options.index ? ('/' + options.index) : '') + '/' + 'primary';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.primary) {
- if (options.parse && options.primary) {
- options.primary = JSON.parse(options.primary);
- }
- options.primary = JSON.parse(options.primary);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.primary}]);
- }
- paramPath = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations' + (options.index ? ('/' + options.index) : '') + '/' + 'ipConfigurations';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.ipConfigurations) {
- if (options.parse && options.ipConfigurations) {
- options.ipConfigurations = JSON.parse(options.ipConfigurations);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.ipConfigurations}]);
- }
- paramPath = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations' + (options.index ? ('/' + options.index) : '') + '/' + 'id';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.id) {
- if (options.parse && options.id) {
- options.id = JSON.parse(options.id);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.id}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set ip-configurations
var catparametersCreateOrUpdateVirtualMachineScaleSetsIpConfigurations0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsIpConfigurations0 = catparametersCreateOrUpdateVirtualMachineScaleSetsIpConfigurations0.category('config')
@@ -4344,7 +3240,7 @@ exports.init = function (cli) {
.option('--index ', $('Indexer: index.'))
.option('--network-interface-configurations-index ', $('Indexer: network-interface-configurations-index.'))
.option('--value ', $('The input string value for the indexed item.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--name ', $('Set the name value.'))
.option('--subnet ', $('Set the subnet value.'))
.option('--load-balancer-backend-address-pools ', $('Set the load-balancer-backend-address-pools value.'))
@@ -4352,10 +3248,10 @@ exports.init = function (cli) {
.option('--id ', $('Set the id value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -4366,53 +3262,59 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations/' + options.networkInterfaceConfigurationsIndex + '/ipConfigurations' + (options.index ? ('/' + options.index) : '');
if (options.value) {
+ cli.output.verbose(options.value);
jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
}
var paramPath = options.path + '/' + 'name';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.name) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.name);
+ cli.output.verbose('================================================');
if (options.parse && options.name) {
options.name = JSON.parse(options.name);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.name}]);
}
paramPath = options.path + '/' + 'subnet';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.subnet) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.subnet);
+ cli.output.verbose('================================================');
if (options.parse && options.subnet) {
options.subnet = JSON.parse(options.subnet);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.subnet}]);
}
paramPath = options.path + '/' + 'loadBalancerBackendAddressPools';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.loadBalancerBackendAddressPools) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.loadBalancerBackendAddressPools);
+ cli.output.verbose('================================================');
if (options.parse && options.loadBalancerBackendAddressPools) {
options.loadBalancerBackendAddressPools = JSON.parse(options.loadBalancerBackendAddressPools);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.loadBalancerBackendAddressPools}]);
}
paramPath = options.path + '/' + 'loadBalancerInboundNatPools';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.loadBalancerInboundNatPools) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.loadBalancerInboundNatPools);
+ cli.output.verbose('================================================');
if (options.parse && options.loadBalancerInboundNatPools) {
options.loadBalancerInboundNatPools = JSON.parse(options.loadBalancerInboundNatPools);
}
jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.loadBalancerInboundNatPools}]);
}
paramPath = options.path + '/' + 'id';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.id) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.id);
+ cli.output.verbose('================================================');
if (options.parse && options.id) {
options.id = JSON.parse(options.id);
}
@@ -4448,6 +3350,10 @@ exports.init = function (cli) {
.option('--id', $('Remove the id value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -4464,122 +3370,27 @@ exports.init = function (cli) {
subItemPath = options.path + '/name';
jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- if (options.subnet) {
- subItemPath = options.path + '/subnet';
- jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
- }
- if (options.loadBalancerBackendAddressPools) {
- subItemPath = options.path + '/loadBalancerBackendAddressPools';
- jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
- }
- if (options.loadBalancerInboundNatPools) {
- subItemPath = options.path + '/loadBalancerInboundNatPools';
- jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
- }
- if (options.id) {
- subItemPath = options.path + '/id';
- jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
- }
- }
- else {
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path}]);
- }
-
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
- //config add ip-configurations
- var catparametersCreateOrUpdateVirtualMachineScaleSetsIpConfigurations2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsIpConfigurations2 = catparametersCreateOrUpdateVirtualMachineScaleSetsIpConfigurations2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsIpConfigurations2 = parametersCreateOrUpdateVirtualMachineScaleSetsIpConfigurations2.category('ip-configurations')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsIpConfigurations2.command('add')
- .description($('Add ip-configurations in config string or files, e.g. \r\n {\r\n ...\r\n "ipConfigurations" : {\r\n "name":"",\r\n "subnet":{\r\n "id":""\r\n },\r\n "loadBalancerBackendAddressPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "loadBalancerInboundNatPools":[\r\n {\r\n "id":""\r\n }\r\n ],\r\n "id":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--name ', $('Add the name value.'))
- .option('--subnet ', $('Add the subnet value.'))
- .option('--load-balancer-backend-address-pools ', $('Add the load-balancer-backend-address-pools value.'))
- .option('--load-balancer-inbound-nat-pools ', $('Add the load-balancer-inbound-nat-pools value.'))
- .option('--id ', $('Add the id value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations/' + options.networkInterfaceConfigurationsIndex + '/ipConfigurations' + (options.index ? ('/' + options.index) : '') + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations/' + options.networkInterfaceConfigurationsIndex + '/ipConfigurations' + (options.index ? ('/' + options.index) : '') + '/' + 'name';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.name) {
- if (options.parse && options.name) {
- options.name = JSON.parse(options.name);
+ if (options.subnet) {
+ subItemPath = options.path + '/subnet';
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.name}]);
- }
- paramPath = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations/' + options.networkInterfaceConfigurationsIndex + '/ipConfigurations' + (options.index ? ('/' + options.index) : '') + '/' + 'subnet';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.subnet) {
- if (options.parse && options.subnet) {
- options.subnet = JSON.parse(options.subnet);
+ if (options.loadBalancerBackendAddressPools) {
+ subItemPath = options.path + '/loadBalancerBackendAddressPools';
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.subnet}]);
- }
- paramPath = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations/' + options.networkInterfaceConfigurationsIndex + '/ipConfigurations' + (options.index ? ('/' + options.index) : '') + '/' + 'loadBalancerBackendAddressPools';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.loadBalancerBackendAddressPools) {
- if (options.parse && options.loadBalancerBackendAddressPools) {
- options.loadBalancerBackendAddressPools = JSON.parse(options.loadBalancerBackendAddressPools);
+ if (options.loadBalancerInboundNatPools) {
+ subItemPath = options.path + '/loadBalancerInboundNatPools';
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.loadBalancerBackendAddressPools}]);
- }
- paramPath = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations/' + options.networkInterfaceConfigurationsIndex + '/ipConfigurations' + (options.index ? ('/' + options.index) : '') + '/' + 'loadBalancerInboundNatPools';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.loadBalancerInboundNatPools) {
- if (options.parse && options.loadBalancerInboundNatPools) {
- options.loadBalancerInboundNatPools = JSON.parse(options.loadBalancerInboundNatPools);
+ if (options.id) {
+ subItemPath = options.path + '/id';
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: subItemPath}]);
}
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.loadBalancerInboundNatPools}]);
}
- paramPath = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations/' + options.networkInterfaceConfigurationsIndex + '/ipConfigurations' + (options.index ? ('/' + options.index) : '') + '/' + 'id';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.id) {
- if (options.parse && options.id) {
- options.id = JSON.parse(options.id);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.id}]);
+ else {
+ jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path}]);
}
+
var updatedContent = JSON.stringify(parametersObj);
cli.output.verbose('=====================================');
cli.output.verbose('JSON object (updated):');
@@ -4590,7 +3401,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
-
//config set subnet
var catparametersCreateOrUpdateVirtualMachineScaleSetsSubnet0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsSubnet0 = catparametersCreateOrUpdateVirtualMachineScaleSetsSubnet0.category('config')
@@ -4603,14 +3413,14 @@ exports.init = function (cli) {
.option('--parameter-file ', $('The parameter file path.'))
.option('--ip-configurations-index ', $('Indexer: ip-configurations-index.'))
.option('--network-interface-configurations-index ', $('Indexer: network-interface-configurations-index.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--id ', $('Set the id value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -4621,10 +3431,11 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations/' + options.networkInterfaceConfigurationsIndex + '/ipConfigurations/' + options.ipConfigurationsIndex + '/subnet';
var paramPath = options.path + '/' + 'id';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.id) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.id);
+ cli.output.verbose('================================================');
if (options.parse && options.id) {
options.id = JSON.parse(options.id);
}
@@ -4656,6 +3467,10 @@ exports.init = function (cli) {
.option('--id', $('Remove the id value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -4687,58 +3502,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add subnet
- var catparametersCreateOrUpdateVirtualMachineScaleSetsSubnet2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsSubnet2 = catparametersCreateOrUpdateVirtualMachineScaleSetsSubnet2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsSubnet2 = parametersCreateOrUpdateVirtualMachineScaleSetsSubnet2.category('subnet')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsSubnet2.command('add')
- .description($('Add subnet in config string or files, e.g. \r\n {\r\n ...\r\n "subnet" : {\r\n "id":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value ', $('The JSON value.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
- .option('--id ', $('Add the id value.'))
- .execute(function(options, _) {
- cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
- }
- cli.output.verbose(options.value);
- cli.output.verbose('=====================================');
- cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
- cli.output.verbose('=====================================');
- var fileContent = fs.readFileSync(options.parameterFile, 'utf8');
- var parametersObj = JSON.parse(fileContent);
- cli.output.verbose('JSON object:');
- cli.output.verbose(JSON.stringify(parametersObj));
- options.operation = 'add';
- options.path = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations/' + options.networkInterfaceConfigurationsIndex + '/ipConfigurations/' + options.ipConfigurationsIndex + '/subnet' + '/' + options.key;
- cli.output.verbose('options.path = ' + options.path);
- jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
- var paramPath = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations/' + options.networkInterfaceConfigurationsIndex + '/ipConfigurations/' + options.ipConfigurationsIndex + '/subnet' + '/' + 'id';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
- if (options.id) {
- if (options.parse && options.id) {
- options.id = JSON.parse(options.id);
- }
- jsonpatch.apply(parametersObj, [{op: options.operation, path: paramPath, value: options.id}]);
- }
- var updatedContent = JSON.stringify(parametersObj);
- cli.output.verbose('=====================================');
- cli.output.verbose('JSON object (updated):');
- cli.output.verbose(JSON.stringify(parametersObj));
- cli.output.verbose('=====================================');
- fs.writeFileSync(options.parameterFile, beautify(updatedContent));
- cli.output.verbose('=====================================');
- cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
- cli.output.verbose('=====================================');
- });
-
//config set load-balancer-backend-address-pools
var catparametersCreateOrUpdateVirtualMachineScaleSetsLoadBalancerBackendAddressPools0 = cli.category('vmss');
var parametersCreateOrUpdateVirtualMachineScaleSetsLoadBalancerBackendAddressPools0 = catparametersCreateOrUpdateVirtualMachineScaleSetsLoadBalancerBackendAddressPools0.category('config')
@@ -4753,14 +3516,14 @@ exports.init = function (cli) {
.option('--ip-configurations-index ', $('Indexer: ip-configurations-index.'))
.option('--network-interface-configurations-index ', $('Indexer: network-interface-configurations-index.'))
.option('--value ', $('The input string value for the indexed item.'))
- .option('--parse', $('Parse the input value string to a JSON object.'))
+ .option('--parse', $('Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).'))
.option('--id ', $('Set the id value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
- if (options.parse && options.value) {
- options.value = JSON.parse(options.value);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
}
- cli.output.verbose(options.value);
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -4771,13 +3534,15 @@ exports.init = function (cli) {
options.operation = 'replace';
options.path = '/virtualMachineProfile/networkProfile/networkInterfaceConfigurations/' + options.networkInterfaceConfigurationsIndex + '/ipConfigurations/' + options.ipConfigurationsIndex + '/loadBalancerBackendAddressPools' + (options.index ? ('/' + options.index) : '');
if (options.value) {
+ cli.output.verbose(options.value);
jsonpatch.apply(parametersObj, [{op: options.operation, path: options.path, value: options.value}]);
}
var paramPath = options.path + '/' + 'id';
- cli.output.verbose('================================================');
- cli.output.verbose('JSON Parameters Path:' + paramPath);
- cli.output.verbose('================================================');
if (options.id) {
+ cli.output.verbose('================================================');
+ cli.output.verbose('Path : ' + paramPath);
+ cli.output.verbose('Value : ' + options.id);
+ cli.output.verbose('================================================');
if (options.parse && options.id) {
options.id = JSON.parse(options.id);
}
@@ -4810,6 +3575,10 @@ exports.init = function (cli) {
.option('--id', $('Remove the id value.'))
.execute(function(options, _) {
cli.output.verbose(JSON.stringify(options), _);
+ if (!options.parameterFile) {
+ options.parameterFile = cli.interaction.promptIfNotGiven($('parameter-file : '), options.parameterFile, _);
+ }
+
cli.output.verbose('=====================================');
cli.output.verbose('Reading file content from: \"' + options.parameterFile + '\"');
cli.output.verbose('=====================================');
@@ -4841,58 +3610,6 @@ exports.init = function (cli) {
cli.output.verbose('Parameter file updated at: ' + options.parameterFile);
cli.output.verbose('=====================================');
});
- //config add load-balancer-backend-address-pools
- var catparametersCreateOrUpdateVirtualMachineScaleSetsLoadBalancerBackendAddressPools2 = cli.category('vmss');
- var parametersCreateOrUpdateVirtualMachineScaleSetsLoadBalancerBackendAddressPools2 = catparametersCreateOrUpdateVirtualMachineScaleSetsLoadBalancerBackendAddressPools2.category('config')
- .description($('Commands to manage configuration of virtual-machine-scale-sets in the parameter file.'));
- var addparametersCreateOrUpdateVirtualMachineScaleSetsLoadBalancerBackendAddressPools2 = parametersCreateOrUpdateVirtualMachineScaleSetsLoadBalancerBackendAddressPools2.category('load-balancer-backend-address-pools')
- .description($('Commands to add components of virtual-machine-scale-sets in config file.'));
- addparametersCreateOrUpdateVirtualMachineScaleSetsLoadBalancerBackendAddressPools2.command('add')
- .description($('Add load-balancer-backend-address-pools in config string or files, e.g. \r\n {\r\n ...\r\n "loadBalancerBackendAddressPools" : {\r\n "id":""\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, \'vmss get/list/stop\' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas \'vmss config * generate/set/remove/add\' commands \r\n are used to configure the input parameter file. The \'vmss create-or-update\' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.'))
- .usage('[options]')
- .option('--parameter-file ', $('The parameter file path.'))
- .option('--key ', $('The JSON key.'))
- .option('--value