Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support File provision V2 #27166

Merged
merged 4 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/Storage/Storage.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the ""License"");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an ""AS IS"" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
// is regenerated.

using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Storage")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("8.1.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("8.1.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
41 changes: 38 additions & 3 deletions src/Storage/Storage.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ For information on how to develop for `Az.Storage`, see [how-to.md](how-to.md).

``` yaml
# Please specify the commit id that includes your features to make sure generated codes stable.
commit: 3e6b4ddca225530c27273d0f816466a905c0151b
commit: ae38b76a7e681922a05b0b1e4d44cc725eb94802
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/storage.json
- $(repo)/specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/storage.json
- $(repo)/specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/file.json

# For new RP, the version is 0.1.0
module-version: 5.9.1
Expand All @@ -48,6 +49,7 @@ directive:
where: $.paths.["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration"].post.operationId
transform: return "StartAccountMigration"
- remove-operation: StorageAccounts_Update
- remove-operation: FileShares_Lease
- where:
subject: ^StorageAccountCustomerInitiatedMigration$
set:
Expand All @@ -64,6 +66,39 @@ directive:
set:
parameter-name: TargetSku
- where:
subject: ^StorageAccount$|^StorageAccountKey$|^StorageAccountProperty$|^StorageAccountSas$|^StorageAccountServiceSas$|BlobInventoryPolicy$|^DeletedAccount$|^EncryptionScope$|^LocalUser$|^LocalUserKey$|^ManagementPolicy$|^ObjectReplicationPolicy$|^Sku$|^Usage$|^LocalUserPassword$|^AccountUserDelegationKey$|^AbortStorageAccountHierarchicalNamespaceMigration$|^HierarchicalStorageAccountNamespaceMigration$|^StorageAccountBlobRange$|^StorageAccountUserDelegationKey$|^StorageAccountNameAvailability$
subject: ^FileServiceUsage$
parameter-name: AccountName
set:
parameter-name: StorageAccountName
- where:
property-name: BurstingConstantBurstFloorIop
set:
property-name: BurstingConstantBurstFloorIops
- where:
property-name: FileShareLimitMaxProvisionedIop
set:
property-name: FileShareLimitMaxProvisionedIops
- where:
property-name: FileShareLimitMinProvisionedIop
set:
property-name: FileShareLimitMinProvisionedIops
- where:
property-name: FileShareRecommendationBaseIop
set:
property-name: FileShareRecommendationBaseIops
- where:
property-name: LiveShareProvisionedIop
set:
property-name: LiveShareProvisionedIops
- where:
property-name: SoftDeletedShareProvisionedIop
set:
property-name: SoftDeletedShareProvisionedIops
- where:
property-name: StorageAccountLimitMaxProvisionedIop
set:
property-name: StorageAccountLimitMaxProvisionedIops
- where:
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$
remove: true
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "storageAccounts/accountMigrations",
"apiVersion": "2023-01-01",
"apiVersion": "2024-01-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.storage"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"resourceType": "storageAccounts/fileServices/usages",
"apiVersion": "2024-01-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.storage"
},
"commands": [
{
"name": "Get-AzStorageFileServiceUsage",
"description": "Gets the usage of file service in storage account including account limits, file share limits and constants used in recommendations and bursting formula.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}/usages/{fileServiceUsagesName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.storage/get-azstoragefileserviceusage"
},
"parameterSets": [
{
"parameters": [
"-ResourceGroupName <String>",
"-StorageAccountName <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "Gets the usage of file service in storage account including account limits, file share limits and constants used in recommendations and bursting formula.",
"parameters": [
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-StorageAccountName",
"value": "[Path.accountName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
5 changes: 4 additions & 1 deletion src/Storage/Storage.Autorest/docs/Az.Storage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Module Name: Az.Storage
Module Guid: 14995ab3-8dd3-4201-b5f5-9dc94eac60d4
Module Guid: 5d40916c-8675-46df-9847-bee3c1d8f7e2
Download Help Link: https://learn.microsoft.com/powershell/module/az.storage
Help Version: 1.0.0.0
Locale: en-US
Expand All @@ -14,6 +14,9 @@ Microsoft Azure PowerShell: Storage cmdlets
### [Get-AzStorageAccountMigration](Get-AzStorageAccountMigration.md)
Gets the status of the ongoing migration for the specified storage account.

### [Get-AzStorageFileServiceUsage](Get-AzStorageFileServiceUsage.md)
Gets the usage of file service in storage account including account limits, file share limits and constants used in recommendations and bursting formula.

### [Start-AzStorageAccountMigration](Start-AzStorageAccountMigration.md)
Account Migration request can be triggered for a storage account to change its redundancy level.
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.
Expand Down
186 changes: 186 additions & 0 deletions src/Storage/Storage.Autorest/docs/Get-AzStorageFileServiceUsage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
---
external help file:
Module Name: Az.Storage
online version: https://learn.microsoft.com/powershell/module/az.storage/get-azstoragefileserviceusage
schema: 2.0.0
---

# Get-AzStorageFileServiceUsage

## SYNOPSIS
Gets the usage of file service in storage account including account limits, file share limits and constants used in recommendations and bursting formula.

## SYNTAX

### Get (Default)
```
Get-AzStorageFileServiceUsage -ResourceGroupName <String> -StorageAccountName <String>
[-SubscriptionId <String[]>] [-DefaultProfile <PSObject>] [<CommonParameters>]
```

### GetViaIdentity
```
Get-AzStorageFileServiceUsage -InputObject <IStorageIdentity> [-DefaultProfile <PSObject>]
[<CommonParameters>]
```

### List
```
Get-AzStorageFileServiceUsage -ResourceGroupName <String> -StorageAccountName <String>
[-SubscriptionId <String[]>] [-Maxpagesize <Int32>] [-DefaultProfile <PSObject>] [<CommonParameters>]
```

## DESCRIPTION
Gets the usage of file service in storage account including account limits, file share limits and constants used in recommendations and bursting formula.

## EXAMPLES

### Example 1: Get a Storage account file service usage data
```powershell
Get-AzStorageFileServiceUsage -StorageAccountName myaccount -ResourceGroupName myresroucegroup
```

```output
BurstingConstantBurstFloorIops : 10000
BurstingConstantBurstIoScalar : 3
BurstingConstantBurstTimeframeSecond : 3600
FileShareLimitMaxProvisionedBandwidthMiBPerSec : 10340
FileShareLimitMaxProvisionedIops : 102400
FileShareLimitMaxProvisionedStorageGiB : 262144
FileShareLimitMinProvisionedBandwidthMiBPerSec : 125
FileShareLimitMinProvisionedIops : 3000
FileShareLimitMinProvisionedStorageGiB : 32
FileShareRecommendationBandwidthScalar : 0.1
FileShareRecommendationBaseBandwidthMiBPerSec : 125
FileShareRecommendationBaseIops : 3000
FileShareRecommendationIoScalar : 1
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresroucegroup/providers/Microsoft.Storage/storageAccounts/myaccount/fileServices/default/usages/default
LiveShareFileShareCount : 1
LiveShareProvisionedBandwidthMiBPerSec : 129
LiveShareProvisionedIops : 3032
LiveShareProvisionedStorageGiB : 32
Name : default
ResourceGroupName : myresroucegroup
SoftDeletedShareFileShareCount : 0
SoftDeletedShareProvisionedBandwidthMiBPerSec : 0
SoftDeletedShareProvisionedIops : 0
SoftDeletedShareProvisionedStorageGiB : 0
StorageAccountLimitMaxFileShare : 50
StorageAccountLimitMaxProvisionedBandwidthMiBPerSec : 10340
StorageAccountLimitMaxProvisionedIops : 102400
StorageAccountLimitMaxProvisionedStorageGiB : 262144
Type : Microsoft.Storage/storageAccounts/fileServices/usages
```

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.

## PARAMETERS

### -DefaultProfile
The DefaultProfile parameter is not functional.
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

```yaml
Type: System.Management.Automation.PSObject
Parameter Sets: (All)
Aliases: AzureRMContext, AzureCredential

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -InputObject
Identity Parameter

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity
Parameter Sets: GetViaIdentity
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -Maxpagesize
Optional, specifies the maximum number of file service usages to be included in the list response.

```yaml
Type: System.Int32
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ResourceGroupName
The name of the resource group within the user's subscription.
The name is case insensitive.

```yaml
Type: System.String
Parameter Sets: Get, List
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -StorageAccountName
The name of the storage account within the specified resource group.
Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.

```yaml
Type: System.String
Parameter Sets: Get, List
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -SubscriptionId
The ID of the target subscription.

```yaml
Type: System.String[]
Parameter Sets: Get, List
Aliases:

Required: False
Position: Named
Default value: (Get-AzContext).Subscription.Id
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
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).

## INPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IFileServiceUsage

## NOTES

## RELATED LINKS

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
### Example 1: Get a Storage account file service usage data
```powershell
Get-AzStorageFileServiceUsage -StorageAccountName myaccount -ResourceGroupName myresroucegroup
```

```output
BurstingConstantBurstFloorIops : 10000
BurstingConstantBurstIoScalar : 3
BurstingConstantBurstTimeframeSecond : 3600
FileShareLimitMaxProvisionedBandwidthMiBPerSec : 10340
FileShareLimitMaxProvisionedIops : 102400
FileShareLimitMaxProvisionedStorageGiB : 262144
FileShareLimitMinProvisionedBandwidthMiBPerSec : 125
FileShareLimitMinProvisionedIops : 3000
FileShareLimitMinProvisionedStorageGiB : 32
FileShareRecommendationBandwidthScalar : 0.1
FileShareRecommendationBaseBandwidthMiBPerSec : 125
FileShareRecommendationBaseIops : 3000
FileShareRecommendationIoScalar : 1
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresroucegroup/providers/Microsoft.Storage/storageAccounts/myaccount/fileServices/default/usages/default
LiveShareFileShareCount : 1
LiveShareProvisionedBandwidthMiBPerSec : 129
LiveShareProvisionedIops : 3032
LiveShareProvisionedStorageGiB : 32
Name : default
ResourceGroupName : myresroucegroup
SoftDeletedShareFileShareCount : 0
SoftDeletedShareProvisionedBandwidthMiBPerSec : 0
SoftDeletedShareProvisionedIops : 0
SoftDeletedShareProvisionedStorageGiB : 0
StorageAccountLimitMaxFileShare : 50
StorageAccountLimitMaxProvisionedBandwidthMiBPerSec : 10340
StorageAccountLimitMaxProvisionedIops : 102400
StorageAccountLimitMaxProvisionedStorageGiB : 262144
Type : Microsoft.Storage/storageAccounts/fileServices/usages
```

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.

2 changes: 1 addition & 1 deletion src/Storage/Storage.Autorest/generate-info.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"generate_Id": "ed8361f3-9959-4586-ba2c-2fb59e04aac2"
"generate_Id": "c1579e62-4c75-4579-8aab-b119ed48e6eb"
}
Loading