Skip to content

Commit 7448539

Browse files
romahamuwyunchi-ms
andcommitted
Change StorageCache folder name to HPCCache and modify Upgrade cache cmdlet … (Azure#539)
* Change StorageCache folder name to HPCCache and modify Upgrade cache cmdlet. * Update Az.HPCCache.psd1 Co-authored-by: Yunchi Wang <[email protected]>
1 parent 609e1bf commit 7448539

File tree

79 files changed

+65
-53
lines changed

Some content is hidden

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

79 files changed

+65
-53
lines changed
File renamed without changes.

src/StorageCache/HPCCache/Az.HPCCache.psd1 renamed to src/HPCCache/HPCCache/Az.HPCCache.psd1

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# RootModule = ''
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.1.0'
15+
ModuleVersion = '0.1.1'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
@@ -57,28 +57,27 @@ RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '1.7.0'; })
5757
RequiredAssemblies = 'Microsoft.Azure.Management.StorageCache.dll'
5858

5959
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60-
#ScriptsToProcess = @()
60+
# ScriptsToProcess = @()
6161

6262
# Type files (.ps1xml) to be loaded when importing this module
6363
# TypesToProcess = @()
6464

6565
# Format files (.ps1xml) to be loaded when importing this module
66-
#FormatsToProcess = @()
66+
# FormatsToProcess = @()
6767

6868
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
6969
NestedModules = @('Microsoft.Azure.PowerShell.Cmdlets.HPCCache.dll')
7070

7171
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72-
#FunctionsToExport = @()
72+
FunctionsToExport = @()
7373

7474
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
75-
CmdletsToExport = 'Get-AzHpcCacheSku' , 'Get-AzHpcCacheUsageModel',
76-
'Get-AzHpcCache', 'New-AzHpcCache',
77-
'Remove-AzHpcCache', 'Set-AzHpcCache',
78-
'Start-AzHpcCache', 'Flush-AzHpcCache',
79-
'Stop-AzHpcCache', 'Upgrade-AzHpcCache',
80-
'Remove-AzHpcCacheStorageTarget', 'New-AzHpcCacheStorageTarget',
81-
'Get-AzHpcCacheStorageTarget', 'Set-AzHpcCacheStorageTarget'
75+
CmdletsToExport = 'Get-AzHpcCacheSku', 'Get-AzHpcCacheUsageModel', 'Get-AzHpcCache',
76+
'New-AzHpcCache', 'Remove-AzHpcCache', 'Set-AzHpcCache',
77+
'Start-AzHpcCache', 'Flush-AzHpcCache', 'Stop-AzHpcCache',
78+
'Update-AzHpcCache', 'Remove-AzHpcCacheStorageTarget',
79+
'New-AzHpcCacheStorageTarget', 'Get-AzHpcCacheStorageTarget',
80+
'Set-AzHpcCacheStorageTarget'
8281

8382
# Variables to export from this module
8483
# VariablesToExport = @()
@@ -101,7 +100,7 @@ PrivateData = @{
101100
PSData = @{
102101

103102
# Tags applied to this module. These help with module discovery in online galleries.
104-
Tags = 'Azure','ResourceManager','ARM','HPC','HPCCache', 'StorageCache'
103+
Tags = 'Azure','ResourceManager','ARM','HPC','HPCCache','StorageCache'
105104

106105
# A URL to the license for this module.
107106
LicenseUri = 'https://aka.ms/azps-license'
@@ -113,7 +112,7 @@ PrivateData = @{
113112
# IconUri = ''
114113

115114
# ReleaseNotes of this module
116-
ReleaseNotes = '* Update references in .psd1 to use relative path'
115+
ReleaseNotes = '* Preview of ''Az.HPCCache'' module'
117116

118117
# Prerelease string of this module
119118
Prerelease = 'preview'

src/StorageCache/HPCCache/ChangeLog.md renamed to src/HPCCache/HPCCache/ChangeLog.md

Lines changed: 2 additions & 0 deletions

src/StorageCache/HPCCache/Commands/UpgradeAzHpcCache.cs renamed to src/HPCCache/HPCCache/Commands/UpdateAzHpcCache.cs

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ namespace Microsoft.Azure.Commands.HPCCache
2121
using Microsoft.Azure.Management.StorageCache.Models;
2222
using Microsoft.Azure.PowerShell.Cmdlets.HPCCache.Models;
2323
using Microsoft.Rest.Azure;
24-
2524
/// <summary>
2625
/// Upgrade HPC Cache.
2726
/// </summary>
28-
[Cmdlet("Upgrade", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "HpcCache", DefaultParameterSetName = FieldsParameterSet, SupportsShouldProcess = true)]
27+
[Cmdlet("Update", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "HpcCache", DefaultParameterSetName = FieldsParameterSet, SupportsShouldProcess = true)]
2928
[OutputType(typeof(bool))]
30-
public class UpgradeAzHpcCache : HpcCacheBaseCmdlet
29+
public class UpdateAzHpcCache : HpcCacheBaseCmdlet
3130
{
3231
/// <summary>
3332
/// Gets or sets ResourceGroupName.
@@ -36,7 +35,6 @@ public class UpgradeAzHpcCache : HpcCacheBaseCmdlet
3635
[ResourceGroupCompleter]
3736
[ValidateNotNullOrEmpty]
3837
public string ResourceGroupName { get; set; }
39-
4038
/// <summary>
4139
/// Gets or sets Name.
4240
/// </summary>
@@ -45,40 +43,39 @@ public class UpgradeAzHpcCache : HpcCacheBaseCmdlet
4543
[ResourceNameCompleter("Microsoft.StorageCache/caches", nameof(ResourceGroupName))]
4644
[ValidateNotNullOrEmpty]
4745
public string Name { get; set; }
48-
4946
/// <summary>
5047
/// Gets or sets resource id of the cache.
5148
/// </summary>
5249
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource id of the Cache", ParameterSetName = ResourceIdParameterSet)]
5350
[ValidateNotNullOrEmpty]
5451
public string ResourceId { get; set; }
55-
52+
/// <summary>
53+
/// Gets or sets Upgrade Flag.
54+
/// </summary>
55+
[Parameter(Mandatory = false, HelpMessage = "Upgrade HpcCache.")]
56+
[ValidateNotNullOrEmpty]
57+
public SwitchParameter Upgrade { get; set; }
5658
/// <summary>
5759
/// Gets or sets cache object.
5860
/// </summary>
5961
[Parameter(ParameterSetName = ObjectParameterSet, Mandatory = true, ValueFromPipeline = true, HelpMessage = "The cache object to upgrade.")]
6062
[ValidateNotNullOrEmpty]
6163
public PSHPCCache InputObject { get; set; }
62-
6364
/// <summary>
6465
/// Gets or sets switch parameter force.
6566
/// </summary>
6667
[Parameter(Mandatory = false, HelpMessage = "Indicates that the cmdlet does not prompt you for confirmation. By default, this cmdlet prompts you to confirm that you want to upgrade the cache.")]
6768
public SwitchParameter Force { get; set; }
68-
6969
/// <summary>
7070
/// Gets or sets switch parameter passthru.
7171
/// </summary>
7272
[Parameter(Mandatory = false, HelpMessage = "Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.")]
7373
public SwitchParameter PassThru { get; set; }
74-
7574
/// <summary>
7675
/// Gets or sets Job to run job in background.
7776
/// </summary>
7877
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
79-
8078
public SwitchParameter AsJob { get; set; }
81-
8279
/// <summary>
8380
/// Execution Cmdlet.
8481
/// </summary>
@@ -95,7 +92,6 @@ public override void ExecuteCmdlet()
9592
this.ResourceGroupName = this.InputObject.ResourceGroupName;
9693
this.Name = this.InputObject.CacheName;
9794
}
98-
9995
this.ConfirmAction(
10096
this.Force.IsPresent,
10197
string.Format(Resources.ConfirmUpgradeHpcCache, this.Name),
@@ -106,34 +102,34 @@ public override void ExecuteCmdlet()
106102
this.UpgradeHpcCache();
107103
});
108104
}
109-
110105
/// <summary>
111-
/// Upgrade HPC Cache.
106+
/// Updates HPC Cache by doing upgrade.
112107
/// </summary>
113108
public void UpgradeHpcCache()
114109
{
115110
if (string.IsNullOrWhiteSpace(this.ResourceGroupName))
116111
{
117112
throw new PSArgumentNullException("ResourceGroupName");
118113
}
119-
120114
if (string.IsNullOrWhiteSpace(this.Name))
121115
{
122116
throw new PSArgumentNullException("CacheName");
123117
}
124-
125-
try
118+
if (this.Upgrade.IsPresent)
126119
{
127-
this.HpcCacheClient.Caches.UpgradeFirmware(this.ResourceGroupName, this.Name);
128-
if (this.PassThru)
120+
try
129121
{
130-
this.WriteObject(true);
122+
this.HpcCacheClient.Caches.UpgradeFirmware(this.ResourceGroupName, this.Name);
123+
if (this.PassThru)
124+
{
125+
this.WriteObject(true);
126+
}
127+
}
128+
catch (CloudErrorException ex)
129+
{
130+
throw new CloudException(string.Format("Exception: {0}", ex.Body.Error.Message));
131131
}
132-
}
133-
catch (CloudErrorException ex)
134-
{
135-
throw new CloudException(string.Format("Exception: {0}", ex.Body.Error.Message));
136132
}
137133
}
138134
}
139-
}
135+
}

src/StorageCache/HPCCache/Properties/AssemblyInfo.cs renamed to src/HPCCache/HPCCache/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
[assembly: ComVisible(false)]
2525
[assembly: CLSCompliant(false)]
2626
[assembly: Guid("77c1e905-4cc3-4a3d-bf4e-b42ad50bb2ba")]
27-
[assembly: AssemblyVersion("1.0.0")]
28-
[assembly: AssemblyFileVersion("1.0.0")]
27+
[assembly: AssemblyVersion("0.1.1")]
28+
[assembly: AssemblyFileVersion("0.1.1")]

src/StorageCache/HPCCache/help/Az.HPCCache.md renamed to src/HPCCache/HPCCache/help/Az.HPCCache.md

Lines changed: 2 additions & 2 deletions

src/StorageCache/HPCCache/help/Upgrade-AzHpcCache.md renamed to src/HPCCache/HPCCache/help/Update-AzHpcCache.md

Lines changed: 26 additions & 11 deletions

0 commit comments

Comments
 (0)