Skip to content

Commit 344f808

Browse files
authored
[Az.Storage] Support File provision V2 (Azure#27166)
* Add File Porvision V2 change * Update test and chagnelog * Fix the duplicated parameter section in Set-AzStorageAccountManagementPolicy help * Fix CR failure
1 parent 47dc993 commit 344f808

File tree

288 files changed

+10427
-3347
lines changed

Some content is hidden

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

288 files changed

+10427
-3347
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0 (the ""License"");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an ""AS IS"" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
12+
// is regenerated.
13+
14+
using System;
15+
using System.Reflection;
16+
using System.Runtime.CompilerServices;
17+
using System.Runtime.InteropServices;
18+
19+
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
20+
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
21+
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
22+
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Storage")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("8.1.0")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("8.1.0")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

src/Storage/Storage.Autorest/README.md

+38-3
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ For information on how to develop for `Az.Storage`, see [how-to.md](how-to.md).
2828
2929
``` yaml
3030
# Please specify the commit id that includes your features to make sure generated codes stable.
31-
commit: 3e6b4ddca225530c27273d0f816466a905c0151b
31+
commit: ae38b76a7e681922a05b0b1e4d44cc725eb94802
3232
require:
3333
# readme.azure.noprofile.md is the common configuration file
3434
- $(this-folder)/../../readme.azure.noprofile.md
3535
input-file:
36-
- $(repo)/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/storage.json
36+
- $(repo)/specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/storage.json
37+
- $(repo)/specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/file.json
3738

3839
# For new RP, the version is 0.1.0
3940
module-version: 5.9.1
@@ -48,6 +49,7 @@ directive:
4849
where: $.paths.["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration"].post.operationId
4950
transform: return "StartAccountMigration"
5051
- remove-operation: StorageAccounts_Update
52+
- remove-operation: FileShares_Lease
5153
- where:
5254
subject: ^StorageAccountCustomerInitiatedMigration$
5355
set:
@@ -64,6 +66,39 @@ directive:
6466
set:
6567
parameter-name: TargetSku
6668
- where:
67-
subject: ^StorageAccount$|^StorageAccountKey$|^StorageAccountProperty$|^StorageAccountSas$|^StorageAccountServiceSas$|BlobInventoryPolicy$|^DeletedAccount$|^EncryptionScope$|^LocalUser$|^LocalUserKey$|^ManagementPolicy$|^ObjectReplicationPolicy$|^Sku$|^Usage$|^LocalUserPassword$|^AccountUserDelegationKey$|^AbortStorageAccountHierarchicalNamespaceMigration$|^HierarchicalStorageAccountNamespaceMigration$|^StorageAccountBlobRange$|^StorageAccountUserDelegationKey$|^StorageAccountNameAvailability$
69+
subject: ^FileServiceUsage$
70+
parameter-name: AccountName
71+
set:
72+
parameter-name: StorageAccountName
73+
- where:
74+
property-name: BurstingConstantBurstFloorIop
75+
set:
76+
property-name: BurstingConstantBurstFloorIops
77+
- where:
78+
property-name: FileShareLimitMaxProvisionedIop
79+
set:
80+
property-name: FileShareLimitMaxProvisionedIops
81+
- where:
82+
property-name: FileShareLimitMinProvisionedIop
83+
set:
84+
property-name: FileShareLimitMinProvisionedIops
85+
- where:
86+
property-name: FileShareRecommendationBaseIop
87+
set:
88+
property-name: FileShareRecommendationBaseIops
89+
- where:
90+
property-name: LiveShareProvisionedIop
91+
set:
92+
property-name: LiveShareProvisionedIops
93+
- where:
94+
property-name: SoftDeletedShareProvisionedIop
95+
set:
96+
property-name: SoftDeletedShareProvisionedIops
97+
- where:
98+
property-name: StorageAccountLimitMaxProvisionedIop
99+
set:
100+
property-name: StorageAccountLimitMaxProvisionedIops
101+
- where:
102+
subject: ^StorageAccount$|^StorageAccountKey$|^StorageAccountProperty$|^StorageAccountSas$|^StorageAccountServiceSas$|BlobInventoryPolicy$|^DeletedAccount$|^EncryptionScope$|^LocalUser$|^LocalUserKey$|^ManagementPolicy$|^ObjectReplicationPolicy$|^Sku$|^Usage$|^LocalUserPassword$|^AccountUserDelegationKey$|^AbortStorageAccountHierarchicalNamespaceMigration$|^HierarchicalStorageAccountNamespaceMigration$|^StorageAccountBlobRange$|^StorageAccountUserDelegationKey$|^StorageAccountNameAvailability$|^FileShare$|^FileServiceProperty$|^FileService$
68103
remove: true
69104
```

src/Storage/Storage.Autorest/UX/Microsoft.Storage/storageAccounts-accountMigrations.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "storageAccounts/accountMigrations",
3-
"apiVersion": "2023-01-01",
3+
"apiVersion": "2024-01-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.storage"
66
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"resourceType": "storageAccounts/fileServices/usages",
3+
"apiVersion": "2024-01-01",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.storage"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzStorageFileServiceUsage",
10+
"description": "Gets the usage of file service in storage account including account limits, file share limits and constants used in recommendations and bursting formula.",
11+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}/usages/{fileServiceUsagesName}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.storage/get-azstoragefileserviceusage"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-ResourceGroupName <String>",
20+
"-StorageAccountName <String>",
21+
"[-SubscriptionId <String[]>]"
22+
]
23+
}
24+
]
25+
},
26+
"examples": [
27+
{
28+
"description": "Gets the usage of file service in storage account including account limits, file share limits and constants used in recommendations and bursting formula.",
29+
"parameters": [
30+
{
31+
"name": "-ResourceGroupName",
32+
"value": "[Path.resourceGroupName]"
33+
},
34+
{
35+
"name": "-StorageAccountName",
36+
"value": "[Path.accountName]"
37+
},
38+
{
39+
"name": "-SubscriptionId",
40+
"value": "[Path.subscriptionId]"
41+
}
42+
]
43+
}
44+
]
45+
}
46+
]
47+
}

src/Storage/Storage.Autorest/docs/Az.Storage.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Storage
3-
Module Guid: 14995ab3-8dd3-4201-b5f5-9dc94eac60d4
3+
Module Guid: 5d40916c-8675-46df-9847-bee3c1d8f7e2
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.storage
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -14,6 +14,9 @@ Microsoft Azure PowerShell: Storage cmdlets
1414
### [Get-AzStorageAccountMigration](Get-AzStorageAccountMigration.md)
1515
Gets the status of the ongoing migration for the specified storage account.
1616

17+
### [Get-AzStorageFileServiceUsage](Get-AzStorageFileServiceUsage.md)
18+
Gets the usage of file service in storage account including account limits, file share limits and constants used in recommendations and bursting formula.
19+
1720
### [Start-AzStorageAccountMigration](Start-AzStorageAccountMigration.md)
1821
Account Migration request can be triggered for a storage account to change its redundancy level.
1922
The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
---
2+
external help file:
3+
Module Name: Az.Storage
4+
online version: https://learn.microsoft.com/powershell/module/az.storage/get-azstoragefileserviceusage
5+
schema: 2.0.0
6+
---
7+
8+
# Get-AzStorageFileServiceUsage
9+
10+
## SYNOPSIS
11+
Gets the usage of file service in storage account including account limits, file share limits and constants used in recommendations and bursting formula.
12+
13+
## SYNTAX
14+
15+
### Get (Default)
16+
```
17+
Get-AzStorageFileServiceUsage -ResourceGroupName <String> -StorageAccountName <String>
18+
[-SubscriptionId <String[]>] [-DefaultProfile <PSObject>] [<CommonParameters>]
19+
```
20+
21+
### GetViaIdentity
22+
```
23+
Get-AzStorageFileServiceUsage -InputObject <IStorageIdentity> [-DefaultProfile <PSObject>]
24+
[<CommonParameters>]
25+
```
26+
27+
### List
28+
```
29+
Get-AzStorageFileServiceUsage -ResourceGroupName <String> -StorageAccountName <String>
30+
[-SubscriptionId <String[]>] [-Maxpagesize <Int32>] [-DefaultProfile <PSObject>] [<CommonParameters>]
31+
```
32+
33+
## DESCRIPTION
34+
Gets the usage of file service in storage account including account limits, file share limits and constants used in recommendations and bursting formula.
35+
36+
## EXAMPLES
37+
38+
### Example 1: Get a Storage account file service usage data
39+
```powershell
40+
Get-AzStorageFileServiceUsage -StorageAccountName myaccount -ResourceGroupName myresroucegroup
41+
```
42+
43+
```output
44+
BurstingConstantBurstFloorIops : 10000
45+
BurstingConstantBurstIoScalar : 3
46+
BurstingConstantBurstTimeframeSecond : 3600
47+
FileShareLimitMaxProvisionedBandwidthMiBPerSec : 10340
48+
FileShareLimitMaxProvisionedIops : 102400
49+
FileShareLimitMaxProvisionedStorageGiB : 262144
50+
FileShareLimitMinProvisionedBandwidthMiBPerSec : 125
51+
FileShareLimitMinProvisionedIops : 3000
52+
FileShareLimitMinProvisionedStorageGiB : 32
53+
FileShareRecommendationBandwidthScalar : 0.1
54+
FileShareRecommendationBaseBandwidthMiBPerSec : 125
55+
FileShareRecommendationBaseIops : 3000
56+
FileShareRecommendationIoScalar : 1
57+
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresroucegroup/providers/Microsoft.Storage/storageAccounts/myaccount/fileServices/default/usages/default
58+
LiveShareFileShareCount : 1
59+
LiveShareProvisionedBandwidthMiBPerSec : 129
60+
LiveShareProvisionedIops : 3032
61+
LiveShareProvisionedStorageGiB : 32
62+
Name : default
63+
ResourceGroupName : myresroucegroup
64+
SoftDeletedShareFileShareCount : 0
65+
SoftDeletedShareProvisionedBandwidthMiBPerSec : 0
66+
SoftDeletedShareProvisionedIops : 0
67+
SoftDeletedShareProvisionedStorageGiB : 0
68+
StorageAccountLimitMaxFileShare : 50
69+
StorageAccountLimitMaxProvisionedBandwidthMiBPerSec : 10340
70+
StorageAccountLimitMaxProvisionedIops : 102400
71+
StorageAccountLimitMaxProvisionedStorageGiB : 262144
72+
Type : Microsoft.Storage/storageAccounts/fileServices/usages
73+
```
74+
75+
This command gets the usage of file service in storage account including account limits, file share limits and constants used in recommendations and bursting formula.
76+
77+
## PARAMETERS
78+
79+
### -DefaultProfile
80+
The DefaultProfile parameter is not functional.
81+
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
82+
83+
```yaml
84+
Type: System.Management.Automation.PSObject
85+
Parameter Sets: (All)
86+
Aliases: AzureRMContext, AzureCredential
87+
88+
Required: False
89+
Position: Named
90+
Default value: None
91+
Accept pipeline input: False
92+
Accept wildcard characters: False
93+
```
94+
95+
### -InputObject
96+
Identity Parameter
97+
98+
```yaml
99+
Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity
100+
Parameter Sets: GetViaIdentity
101+
Aliases:
102+
103+
Required: True
104+
Position: Named
105+
Default value: None
106+
Accept pipeline input: True (ByValue)
107+
Accept wildcard characters: False
108+
```
109+
110+
### -Maxpagesize
111+
Optional, specifies the maximum number of file service usages to be included in the list response.
112+
113+
```yaml
114+
Type: System.Int32
115+
Parameter Sets: List
116+
Aliases:
117+
118+
Required: False
119+
Position: Named
120+
Default value: None
121+
Accept pipeline input: False
122+
Accept wildcard characters: False
123+
```
124+
125+
### -ResourceGroupName
126+
The name of the resource group within the user's subscription.
127+
The name is case insensitive.
128+
129+
```yaml
130+
Type: System.String
131+
Parameter Sets: Get, List
132+
Aliases:
133+
134+
Required: True
135+
Position: Named
136+
Default value: None
137+
Accept pipeline input: False
138+
Accept wildcard characters: False
139+
```
140+
141+
### -StorageAccountName
142+
The name of the storage account within the specified resource group.
143+
Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
144+
145+
```yaml
146+
Type: System.String
147+
Parameter Sets: Get, List
148+
Aliases:
149+
150+
Required: True
151+
Position: Named
152+
Default value: None
153+
Accept pipeline input: False
154+
Accept wildcard characters: False
155+
```
156+
157+
### -SubscriptionId
158+
The ID of the target subscription.
159+
160+
```yaml
161+
Type: System.String[]
162+
Parameter Sets: Get, List
163+
Aliases:
164+
165+
Required: False
166+
Position: Named
167+
Default value: (Get-AzContext).Subscription.Id
168+
Accept pipeline input: False
169+
Accept wildcard characters: False
170+
```
171+
172+
### CommonParameters
173+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
174+
175+
## INPUTS
176+
177+
### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity
178+
179+
## OUTPUTS
180+
181+
### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IFileServiceUsage
182+
183+
## NOTES
184+
185+
## RELATED LINKS
186+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
### Example 1: Get a Storage account file service usage data
2+
```powershell
3+
Get-AzStorageFileServiceUsage -StorageAccountName myaccount -ResourceGroupName myresroucegroup
4+
```
5+
6+
```output
7+
BurstingConstantBurstFloorIops : 10000
8+
BurstingConstantBurstIoScalar : 3
9+
BurstingConstantBurstTimeframeSecond : 3600
10+
FileShareLimitMaxProvisionedBandwidthMiBPerSec : 10340
11+
FileShareLimitMaxProvisionedIops : 102400
12+
FileShareLimitMaxProvisionedStorageGiB : 262144
13+
FileShareLimitMinProvisionedBandwidthMiBPerSec : 125
14+
FileShareLimitMinProvisionedIops : 3000
15+
FileShareLimitMinProvisionedStorageGiB : 32
16+
FileShareRecommendationBandwidthScalar : 0.1
17+
FileShareRecommendationBaseBandwidthMiBPerSec : 125
18+
FileShareRecommendationBaseIops : 3000
19+
FileShareRecommendationIoScalar : 1
20+
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresroucegroup/providers/Microsoft.Storage/storageAccounts/myaccount/fileServices/default/usages/default
21+
LiveShareFileShareCount : 1
22+
LiveShareProvisionedBandwidthMiBPerSec : 129
23+
LiveShareProvisionedIops : 3032
24+
LiveShareProvisionedStorageGiB : 32
25+
Name : default
26+
ResourceGroupName : myresroucegroup
27+
SoftDeletedShareFileShareCount : 0
28+
SoftDeletedShareProvisionedBandwidthMiBPerSec : 0
29+
SoftDeletedShareProvisionedIops : 0
30+
SoftDeletedShareProvisionedStorageGiB : 0
31+
StorageAccountLimitMaxFileShare : 50
32+
StorageAccountLimitMaxProvisionedBandwidthMiBPerSec : 10340
33+
StorageAccountLimitMaxProvisionedIops : 102400
34+
StorageAccountLimitMaxProvisionedStorageGiB : 262144
35+
Type : Microsoft.Storage/storageAccounts/fileServices/usages
36+
```
37+
38+
This command gets the usage of file service in storage account including account limits, file share limits and constants used in recommendations and bursting formula.
39+
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"generate_Id": "ed8361f3-9959-4586-ba2c-2fb59e04aac2"
2+
"generate_Id": "c1579e62-4c75-4579-8aab-b119ed48e6eb"
33
}

0 commit comments

Comments
 (0)