Skip to content

Commit 30ba2a7

Browse files
authored
Merge pull request Azure#79 from zyxyoshine/SRPfix
Update Storage Admin for issues
2 parents 37666df + b255cbf commit 30ba2a7

14 files changed

+179
-215
lines changed

src/Azs.Storage.Admin/custom/Remove-AzsStorageQuota.ps1

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -122,44 +122,22 @@ param(
122122
[Microsoft.Azure.PowerShell.Cmdlets.StorageAdmin.Category('Runtime')]
123123
[System.Management.Automation.SwitchParameter]
124124
# Use the default credentials for the proxy
125-
${ProxyUseDefaultCredentials},
126-
127-
[Parameter()]
128-
[Microsoft.Azure.PowerShell.Cmdlets.StorageAdmin.Category('Runtime')]
129-
[System.Management.Automation.SwitchParameter]
130-
# Don't ask for confirmation
131-
$Force
125+
${ProxyUseDefaultCredentials}
132126
)
133127

134128
process {
135129
$quotaName = $Name
136130

137-
if ('DeleteViaIdentity' -eq $PsCmdlet.ParameterSetName)
138-
{
139-
$quotaName = $InputObject.Name
140-
}
141-
142131
if ($null -ne $quotaName -and $quotaName.Contains('/'))
143132
{
144133
$quotaName = $quotaName.Split("/")[-1]
145134
}
146135

147-
if ($PSCmdlet.ShouldProcess("$quotaName" , "Delete the storage quota"))
136+
if ($PSBoundParameters.ContainsKey('Name'))
148137
{
149-
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Delete the storage quota?", "Performing operation delete $quotaName."))
150-
{
151-
if ($PSBoundParameters.ContainsKey('Force'))
152-
{
153-
$null = $PSBoundParameters.Remove('Force')
154-
}
155-
156-
if ($PSBoundParameters.ContainsKey('Name'))
157-
{
158-
$PSBoundParameters['Name'] = $quotaName
159-
}
160-
161-
Azs.Storage.Admin.internal\Remove-AzsStorageQuota @PSBoundParameters
162-
}
138+
$PSBoundParameters['Name'] = $quotaName
163139
}
140+
141+
Azs.Storage.Admin.internal\Remove-AzsStorageQuota @PSBoundParameters
164142
}
165143
}

src/Azs.Storage.Admin/custom/Update-AzsStorageSettings.ps1 renamed to src/Azs.Storage.Admin/custom/Set-AzsStorageSettings.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ To view examples, please use the -Online parameter with Get-Help or navigate to:
2222
.Outputs
2323
Microsoft.Azure.PowerShell.Cmdlets.StorageAdmin.Models.Api201908Preview.ISettings
2424
.Link
25-
https://docs.microsoft.com/en-us/powershell/module/azs.storage.admin/update-azsstoragesettings
25+
https://docs.microsoft.com/en-us/powershell/module/azs.storage.admin/set-azsstoragesettings
2626
#>
27-
function Update-AzsStorageSettings {
27+
function Set-AzsStorageSettings {
2828
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorageAdmin.Models.Api201908Preview.ISettings])]
2929
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
3030
param(
@@ -112,8 +112,8 @@ process {
112112
$null = $PSBoundParameters.Remove('Force')
113113
}
114114

115-
Azs.Storage.Admin.internal\Update-AzsStorageSettings @PSBoundParameters
115+
Azs.Storage.Admin.internal\Set-AzsStorageSettings @PSBoundParameters
116116
}
117117
}
118118
}
119-
}
119+
}

src/Azs.Storage.Admin/docs/Azs.Storage.Admin.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Azs.Storage.Admin
3-
Module Guid: 319a9e5b-a1f4-4b66-955d-082f6741d418
3+
Module Guid: 14ee1f9d-3505-45eb-a128-ec91a0ebe410
44
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azs.storage.admin
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -35,9 +35,9 @@ Returns the storage resource provider settings.
3535
### [Set-AzsStorageQuota](Set-AzsStorageQuota.md)
3636

3737

38-
### [Start-AzsReclaimStorageCapacity](Start-AzsReclaimStorageCapacity.md)
38+
### [Set-AzsStorageSettings](Set-AzsStorageSettings.md)
3939

4040

41-
### [Update-AzsStorageSettings](Update-AzsStorageSettings.md)
41+
### [Start-AzsReclaimStorageCapacity](Start-AzsReclaimStorageCapacity.md)
4242

4343

src/Azs.Storage.Admin/docs/Remove-AzsStorageQuota.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ schema: 2.0.0
1515
### Delete (Default)
1616
```
1717
Remove-AzsStorageQuota -Name <String> [-Location <String>] [-SubscriptionId <String>]
18-
[-DefaultProfile <PSObject>] [-Force] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
18+
[-DefaultProfile <PSObject>] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
1919
```
2020

2121
### DeleteViaIdentity
2222
```
23-
Remove-AzsStorageQuota -InputObject <IStorageAdminIdentity> [-DefaultProfile <PSObject>] [-Force] [-PassThru]
23+
Remove-AzsStorageQuota -InputObject <IStorageAdminIdentity> [-DefaultProfile <PSObject>] [-PassThru]
2424
[-Confirm] [-WhatIf] [<CommonParameters>]
2525
```
2626

@@ -61,22 +61,6 @@ Accept wildcard characters: False
6161
Dynamic: False
6262
```
6363
64-
### -Force
65-
66-
67-
```yaml
68-
Type: System.Management.Automation.SwitchParameter
69-
Parameter Sets: (All)
70-
Aliases:
71-
72-
Required: False
73-
Position: Named
74-
Default value: None
75-
Accept pipeline input: False
76-
Accept wildcard characters: False
77-
Dynamic: False
78-
```
79-
8064
### -InputObject
8165
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8266

src/Azs.Storage.Admin/docs/Update-AzsStorageSettings.md renamed to src/Azs.Storage.Admin/docs/Set-AzsStorageSettings.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
external help file:
33
Module Name: Azs.Storage.Admin
4-
online version: https://docs.microsoft.com/en-us/powershell/module/azs.storage.admin/update-azsstoragesettings
4+
online version: https://docs.microsoft.com/en-us/powershell/module/azs.storage.admin/set-azsstoragesettings
55
schema: 2.0.0
66
---
77

8-
# Update-AzsStorageSettings
8+
# Set-AzsStorageSettings
99

1010
## SYNOPSIS
1111

1212

1313
## SYNTAX
1414

1515
```
16-
Update-AzsStorageSettings -RetentionPeriodForDeletedStorageAccountsInDays <Int32> [-Location <String>]
16+
Set-AzsStorageSettings -RetentionPeriodForDeletedStorageAccountsInDays <Int32> [-Location <String>]
1717
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]
1818
```
1919

@@ -24,7 +24,7 @@ Update-AzsStorageSettings -RetentionPeriodForDeletedStorageAccountsInDays <Int32
2424

2525
### Example 1:
2626
```powershell
27-
PS C:\> Update-AzsStorageSettings -RetentionPeriodForDeletedStorageAccountsInDays 1
27+
PS C:\> Set-AzsStorageSettings -RetentionPeriodForDeletedStorageAccountsInDays 1
2828
```
2929

3030
Update the storage settings.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### Example 1:
2+
```powershell
3+
PS C:\> Set-AzsStorageSettings -RetentionPeriodForDeletedStorageAccountsInDays 1
4+
```
5+
6+
Update the storage settings.

src/Azs.Storage.Admin/examples/Update-AzsStorageSettings.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/Azs.Storage.Admin/readme.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ directive:
100100
set:
101101
verb: Get
102102
subject: StorageSettings
103-
# Rename Set-AzsStorageSetting to Update-AzsStorageSettings
103+
# Rename Set-AzsStorageSetting to Set-AzsStorageSettings
104104
- where:
105105
verb: Set
106106
subject: StorageSetting
107107
set:
108-
verb: Update
108+
verb: Set
109109
subject: StorageSettings
110110

111111
# Rename cmdlet parameter name and set default value in StorageAccount
@@ -177,16 +177,16 @@ directive:
177177
variant: ReclaimViaIdentity
178178
remove: true
179179

180-
# Remove Update parameter set in Update-AzsStorageSettings
180+
# Remove Update parameter set in Set-AzsStorageSettings
181181
- where:
182-
verb: Update
182+
verb: Set
183183
subject: StorageSettings
184184
variant: Update
185185
remove: true
186186

187-
# Remove UpdateViaIdentity parameter set in Update-AzsStorageSettings
187+
# Remove UpdateViaIdentity parameter set in Set-AzsStorageSettings
188188
- where:
189-
verb: Update
189+
verb: Set
190190
subject: StorageSettings
191191
variant: ^UpdateViaIdentity(.*)
192192
remove: true
@@ -258,9 +258,9 @@ directive:
258258
subject: ReclaimStorageCapacity
259259
hide: true
260260

261-
# Hide the auto-generated Update-AzsStorageSettings and expose it through customized one
261+
# Hide the auto-generated Set-AzsStorageSettings and expose it through customized one
262262
- where:
263-
verb: Update
263+
verb: Set
264264
subject: StorageSettings
265265
hide: true
266266

src/Azs.Storage.Admin/test/New-AzsStorageQuota.Recording.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"New-AzsStorageQuota+[NoContext]+TestCreateStorageQuota+$PUT+https://adminmanagement.redmond.ext-s31r1803.masd.stbtest.microsoft.com/subscriptions/624575d6-5820-4528-8d07-53b5748f2fcc/providers/Microsoft.Storage.Admin/locations/redmond/quotas/TestCreateQuota?api-version=2019-08-08-preview+1": {
2+
"New-AzsStorageQuota+[NoContext]+TestCreateStorageQuota+$PUT+https://adminmanagement.redmond.ext-s31r1801.masd.stbtest.microsoft.com/subscriptions/627fecef-520e-4c18-94e0-8f0665ba86a7/providers/Microsoft.Storage.Admin/locations/redmond/quotas/TestCreateQuota?api-version=2019-08-08-preview+1": {
33
"Request": {
44
"Method": "PUT",
5-
"RequestUri": "https://adminmanagement.redmond.ext-s31r1803.masd.stbtest.microsoft.com/subscriptions/624575d6-5820-4528-8d07-53b5748f2fcc/providers/Microsoft.Storage.Admin/locations/redmond/quotas/TestCreateQuota?api-version=2019-08-08-preview",
5+
"RequestUri": "https://adminmanagement.redmond.ext-s31r1801.masd.stbtest.microsoft.com/subscriptions/627fecef-520e-4c18-94e0-8f0665ba86a7/providers/Microsoft.Storage.Admin/locations/redmond/quotas/TestCreateQuota?api-version=2019-08-08-preview",
66
"Content": "{\r\n \"properties\": {\r\n \"capacityInGb\": 100000000,\r\n \"numberOfStorageAccounts\": 1000000000\r\n }\r\n}",
77
"Headers": {
8-
"x-ms-unique-id": [ "95" ],
9-
"x-ms-client-request-id": [ "553aec00-8b9d-45c3-986d-594009b5856d" ],
8+
"x-ms-unique-id": [ "171" ],
9+
"x-ms-client-request-id": [ "6d7a2c44-00ca-4b5f-99e1-50803b093e31" ],
1010
"CommandName": [ "Azs.Storage.Admin.internal\\New-AzsStorageQuota" ],
1111
"FullCommandName": [ "New-AzsStorageQuota_CreateExpanded" ],
1212
"ParameterSetName": [ "__AllParameterSets" ],
@@ -22,33 +22,33 @@
2222
"StatusCode": 200,
2323
"Headers": {
2424
"Pragma": [ "no-cache" ],
25-
"x-ms-correlation-request-id": [ "892b586d-28fa-4c14-9df5-0eb6c07783a3" ],
26-
"x-ms-ratelimit-remaining-subscription-writes": [ "1199" ],
27-
"x-ms-request-id": [ "892b586d-28fa-4c14-9df5-0eb6c07783a3" ],
28-
"x-ms-routing-request-id": [ "REDMOND:20200214T085522Z:892b586d-28fa-4c14-9df5-0eb6c07783a3" ],
25+
"x-ms-correlation-request-id": [ "7a30ede5-9a03-403c-9ad4-ee27cbfac135" ],
26+
"x-ms-ratelimit-remaining-subscription-writes": [ "1181" ],
27+
"x-ms-request-id": [ "7a30ede5-9a03-403c-9ad4-ee27cbfac135" ],
28+
"x-ms-routing-request-id": [ "REDMOND:20200221T103018Z:7a30ede5-9a03-403c-9ad4-ee27cbfac135" ],
2929
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
3030
"X-Content-Type-Options": [ "nosniff" ],
3131
"Cache-Control": [ "no-cache" ],
32-
"Date": [ "Fri, 14 Feb 2020 08:55:22 GMT" ],
32+
"Date": [ "Fri, 21 Feb 2020 10:30:18 GMT" ],
3333
"Server": [ "Microsoft-HTTPAPI/2.0" ],
34-
"WWW-Authenticate": [ "oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvVodPgDUX0tIDzTWR25Cy+FdeWJpI0yvRbl4hNyuv8P6ixPDLkYoKvM8MZAE7rkQIfMwib/De5K+7BlPiJ/irTNNRLVXuuGcSJUze3vS7SUEEa4GV3imAhru1aK42BBRiZ0X4RaWHYpcNyBQ8pVZO" ]
34+
"WWW-Authenticate": [ "oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvgldmXWHw+ueyBfPuFjo90R4Ox2OMGr0hOW4oNHOA71ivTcWxzCHAtsJa01ogGRGhmgzWlEXGNUfHlTPhoJXqfeWhAZK9c2qcVobiyFdX8m17gQmp5qiJ50u5TN3bTPOXzGt3zZMu6G5eI2p0JOu9" ]
3535
},
3636
"ContentHeaders": {
3737
"Content-Length": [ "361" ],
3838
"Content-Type": [ "application/json" ],
3939
"Expires": [ "-1" ]
4040
},
41-
"Content": "{\r\n \"id\": \"/subscriptions/624575d6-5820-4528-8d07-53b5748f2fcc/providers/Microsoft.Storage.Admin/locations/redmond/quotas/TestCreateQuota\",\r\n \"name\": \"redmond/TestCreateQuota\",\r\n \"type\": \"Microsoft.Storage.Admin/locations/quotas\",\r\n \"location\": \"redmond\",\r\n \"properties\": {\r\n \"numberOfStorageAccounts\": 1000000000,\r\n \"capacityInGb\": 100000000\r\n }\r\n}"
41+
"Content": "{\r\n \"id\": \"/subscriptions/627fecef-520e-4c18-94e0-8f0665ba86a7/providers/Microsoft.Storage.Admin/locations/redmond/quotas/TestCreateQuota\",\r\n \"name\": \"redmond/TestCreateQuota\",\r\n \"type\": \"Microsoft.Storage.Admin/locations/quotas\",\r\n \"location\": \"redmond\",\r\n \"properties\": {\r\n \"numberOfStorageAccounts\": 1000000000,\r\n \"capacityInGb\": 100000000\r\n }\r\n}"
4242
}
4343
},
44-
"New-AzsStorageQuota+[NoContext]+TestCreateStorageQuota+$DELETE+https://adminmanagement.redmond.ext-s31r1803.masd.stbtest.microsoft.com/subscriptions/624575d6-5820-4528-8d07-53b5748f2fcc/providers/Microsoft.Storage.Admin/locations/redmond/quotas/TestCreateQuota?api-version=2019-08-08-preview+2": {
44+
"New-AzsStorageQuota+[NoContext]+TestCreateStorageQuota+$DELETE+https://adminmanagement.redmond.ext-s31r1801.masd.stbtest.microsoft.com/subscriptions/627fecef-520e-4c18-94e0-8f0665ba86a7/providers/Microsoft.Storage.Admin/locations/redmond/quotas/TestCreateQuota?api-version=2019-08-08-preview+2": {
4545
"Request": {
4646
"Method": "DELETE",
47-
"RequestUri": "https://adminmanagement.redmond.ext-s31r1803.masd.stbtest.microsoft.com/subscriptions/624575d6-5820-4528-8d07-53b5748f2fcc/providers/Microsoft.Storage.Admin/locations/redmond/quotas/TestCreateQuota?api-version=2019-08-08-preview",
47+
"RequestUri": "https://adminmanagement.redmond.ext-s31r1801.masd.stbtest.microsoft.com/subscriptions/627fecef-520e-4c18-94e0-8f0665ba86a7/providers/Microsoft.Storage.Admin/locations/redmond/quotas/TestCreateQuota?api-version=2019-08-08-preview",
4848
"Content": null,
4949
"Headers": {
50-
"x-ms-unique-id": [ "96" ],
51-
"x-ms-client-request-id": [ "d144ba1c-47aa-4547-bd4f-ac295f76205d" ],
50+
"x-ms-unique-id": [ "172" ],
51+
"x-ms-client-request-id": [ "6129454d-c71e-49ae-b718-a824055c6e92" ],
5252
"CommandName": [ "Azs.Storage.Admin.internal\\Remove-AzsStorageQuota" ],
5353
"FullCommandName": [ "Remove-AzsStorageQuota_Delete" ],
5454
"ParameterSetName": [ "__AllParameterSets" ],
@@ -62,16 +62,16 @@
6262
"StatusCode": 200,
6363
"Headers": {
6464
"Pragma": [ "no-cache" ],
65-
"x-ms-correlation-request-id": [ "cbe1eb6a-6302-47dc-86a9-0228a2931c8f" ],
66-
"x-ms-ratelimit-remaining-subscription-deletes": [ "14999" ],
67-
"x-ms-request-id": [ "cbe1eb6a-6302-47dc-86a9-0228a2931c8f" ],
68-
"x-ms-routing-request-id": [ "REDMOND:20200214T085522Z:cbe1eb6a-6302-47dc-86a9-0228a2931c8f" ],
65+
"x-ms-correlation-request-id": [ "f3254596-4402-40e2-ac25-b79248bd7ec5" ],
66+
"x-ms-ratelimit-remaining-subscription-deletes": [ "14985" ],
67+
"x-ms-request-id": [ "f3254596-4402-40e2-ac25-b79248bd7ec5" ],
68+
"x-ms-routing-request-id": [ "REDMOND:20200221T103019Z:f3254596-4402-40e2-ac25-b79248bd7ec5" ],
6969
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
7070
"X-Content-Type-Options": [ "nosniff" ],
7171
"Cache-Control": [ "no-cache" ],
72-
"Date": [ "Fri, 14 Feb 2020 08:55:22 GMT" ],
72+
"Date": [ "Fri, 21 Feb 2020 10:30:19 GMT" ],
7373
"Server": [ "Microsoft-HTTPAPI/2.0" ],
74-
"WWW-Authenticate": [ "oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvEdDWyiR4k/hwcxerYbFZWgGHDpiZzKrY5RZGJZoqDjE6+rg9jA0399Q4GYDG1KaxcT/LqO7Hz2BFV9aJuyY8wuc054q6Xt07n4xyDlnd4DBf+gigtA0/It35vWvvl1zCENC62cmBqLVNSvO1NIrJ" ]
74+
"WWW-Authenticate": [ "oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRviH9LgOgr6VV/jrfUVc4WBPpSmlzYRa9dlakj7cX4eFiyCgyygfaKa/pWz/0KCFVD5jVEqd3qKH2294SuYqQJA+n/mM/EV2Skpy0Cj8b9ecnJLi/r6WZSJwIgFpLxkAvwD2Ui6VEJv1T/3DLkOrka" ]
7575
},
7676
"ContentHeaders": {
7777
"Content-Length": [ "0" ],

src/Azs.Storage.Admin/test/New-AzsStorageQuota.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ Describe 'New-AzsStorageQuota' {
2323
$quota | Should Not Be $null
2424
$quota.CapacityInGb | Should Be 100000000
2525
$quota.NumberOfStorageAccounts | Should Be 1000000000
26-
Remove-AzsStorageQuota -Location $global:Location -Name $name -Force
26+
Remove-AzsStorageQuota -Location $global:Location -Name $name
2727
}
2828
}

0 commit comments

Comments
 (0)