Skip to content

Commit 66e235c

Browse files
Migrate Quota from generation to main (#23544)
* Move Quota to main * update changelog --------- Co-authored-by: Jinpei Li <[email protected]>
1 parent 6aa5481 commit 66e235c

File tree

241 files changed

+14536
-5918
lines changed

Some content is hidden

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

241 files changed

+14536
-5918
lines changed

src/Quota/Quota.Autorest/Az.Quota.format.ps1xml

Lines changed: 84 additions & 84 deletions
Large diffs are not rendered by default.
Lines changed: 20 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,23 @@
1-
#
2-
# Module manifest for module 'Az.Quota'
3-
#
4-
# Generated by: Microsoft Corporation
5-
#
6-
# Generated on: 2/21/2022
7-
#
8-
91
@{
10-
11-
# Script module or binary module file associated with this manifest.
12-
RootModule = './Az.Quota.psm1'
13-
14-
# Version number of this module.
15-
ModuleVersion = '0.1.0'
16-
17-
# Supported PSEditions
18-
CompatiblePSEditions = 'Core', 'Desktop'
19-
20-
# ID used to uniquely identify this module
21-
GUID = 'bd26548c-ac2c-4447-9d5d-2e4d8c622495'
22-
23-
# Author of this module
24-
Author = 'Microsoft Corporation'
25-
26-
# Company or vendor of this module
27-
CompanyName = 'Microsoft Corporation'
28-
29-
# Copyright statement for this module
30-
Copyright = 'Microsoft Corporation. All rights reserved.'
31-
32-
# Description of the functionality provided by this module
33-
Description = 'Microsoft Azure PowerShell: Quota cmdlets'
34-
35-
# Minimum version of the PowerShell engine required by this module
36-
PowerShellVersion = '5.1'
37-
38-
# Name of the PowerShell host required by this module
39-
# PowerShellHostName = ''
40-
41-
# Minimum version of the PowerShell host required by this module
42-
# PowerShellHostVersion = ''
43-
44-
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45-
DotNetFrameworkVersion = '4.7.2'
46-
47-
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48-
# ClrVersion = ''
49-
50-
# Processor architecture (None, X86, Amd64) required by this module
51-
# ProcessorArchitecture = ''
52-
53-
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.7.4'; })
55-
56-
# Assemblies that must be loaded prior to importing this module
57-
RequiredAssemblies = './bin/Az.Quota.private.dll'
58-
59-
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60-
# ScriptsToProcess = @()
61-
62-
# Type files (.ps1xml) to be loaded when importing this module
63-
# TypesToProcess = @()
64-
65-
# Format files (.ps1xml) to be loaded when importing this module
66-
FormatsToProcess = './Az.Quota.format.ps1xml'
67-
68-
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69-
# NestedModules = @()
70-
71-
# 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 = 'Get-AzQuota', 'Get-AzQuotaOperation', 'Get-AzQuotaRequestStatus',
73-
'Get-AzQuotaUsage', 'New-AzQuota', 'New-AzQuotaLimitObject',
74-
'Update-AzQuota'
75-
76-
# 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.
77-
CmdletsToExport = @()
78-
79-
# Variables to export from this module
80-
# VariablesToExport = @()
81-
82-
# Aliases 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 aliases to export.
83-
AliasesToExport = '*'
84-
85-
# DSC resources to export from this module
86-
# DscResourcesToExport = @()
87-
88-
# List of all modules packaged with this module
89-
# ModuleList = @()
90-
91-
# List of all files packaged with this module
92-
# FileList = @()
93-
94-
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
95-
PrivateData = @{
96-
2+
GUID = 'bd26548c-ac2c-4447-9d5d-2e4d8c622495'
3+
RootModule = './Az.Quota.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: Quota cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.Quota.private.dll'
13+
FormatsToProcess = './Az.Quota.format.ps1xml'
14+
FunctionsToExport = 'Get-AzQuota', 'Get-AzQuotaOperation', 'Get-AzQuotaRequestStatus', 'Get-AzQuotaUsage', 'New-AzQuota', 'New-AzQuotaLimitObject', 'Update-AzQuota'
15+
PrivateData = @{
9716
PSData = @{
98-
99-
# Tags applied to this module. These help with module discovery in online galleries.
100-
Tags = 'Azure','ResourceManager','ARM','PSModule','Quota'
101-
102-
# A URL to the license for this module.
103-
LicenseUri = 'https://aka.ms/azps-license'
104-
105-
# A URL to the main website for this project.
106-
ProjectUri = 'https://github.com/Azure/azure-powershell'
107-
108-
# A URL to an icon representing this module.
109-
# IconUri = ''
110-
111-
# ReleaseNotes of this module
112-
# ReleaseNotes = ''
113-
114-
# Prerelease string of this module
115-
# Prerelease = ''
116-
117-
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
118-
# RequireLicenseAcceptance = $false
119-
120-
# External dependent modules of this module
121-
# ExternalModuleDependencies = @()
122-
123-
} # End of PSData hashtable
124-
125-
} # End of PrivateData hashtable
126-
127-
# HelpInfo URI of this module
128-
# HelpInfoURI = ''
129-
130-
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
131-
# DefaultCommandPrefix = ''
132-
17+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Quota'
18+
LicenseUri = 'https://aka.ms/azps-license'
19+
ProjectUri = 'https://github.com/Azure/azure-powershell'
20+
ReleaseNotes = ''
21+
}
22+
}
13323
}
134-

src/Quota/Quota.Autorest/Az.Quota.psm1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
}
2626
}
2727
if(-not $accountsModule) {
28-
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.2.3' } | Measure-Object).Count -gt 0
28+
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
2929
if($hasAdequateVersion) {
30-
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.2.3 -Scope Global -PassThru
30+
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
3131
}
3232
}
3333
}
3434

3535
if(-not $accountsModule) {
36-
Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
37-
} elseif (($accountsModule.Version -lt [System.Version]'2.2.3') -and (-not $localAccounts)) {
38-
Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
36+
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
37+
} elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
38+
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
3939
}
4040
Write-Information "Loaded Module '$($accountsModule.Name)'"
4141

@@ -50,6 +50,10 @@
5050

5151
# Tweaks the pipeline on module load
5252
$instance.OnModuleLoad = $VTable.OnModuleLoad
53+
54+
# Following two delegates are added for telemetry
55+
$instance.GetTelemetryId = $VTable.GetTelemetryId
56+
$instance.Telemetry = $VTable.Telemetry
5357

5458

5559
# Tweaks the pipeline per call

src/Quota/Quota.Autorest/README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This directory contains the PowerShell module for the Quota service.
1717
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
1818

1919
## Module Requirements
20-
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater
20+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
2121

2222
## Authentication
2323
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
@@ -31,22 +31,25 @@ For information on how to develop for `Az.Quota`, see [how-to.md](how-to.md).
3131
3232
``` yaml
3333
# lock the commit
34-
branch: 679887ace44697c726aba8d2814ee415a5d25e6f
34+
commit: 4442e8121686218ce2951ab4dc734e489aa5bc08
3535
require:
36-
- $(this-folder)/../readme.azure.noprofile.md
36+
- $(this-folder)/../../readme.azure.noprofile.md
3737
input-file:
38-
- $(repo)/specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/quota.json
38+
- $(repo)/specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/quota.json
3939

4040
title: Quota
4141
module-version: 0.1.0
4242

4343
identity-correction-for-post: true
44-
# resouces usage id does not contain resource group name.
45-
# resourcegroup-append: true
44+
resourcegroup-append: true
4645
nested-object-to-string: true
46+
auto-switch-view: false
4747

4848
inlining-threshold: 50
4949

50+
use-extension:
51+
"@autorest/powershell": "4.x"
52+
5053
directive:
5154
# The regex(^/(?<scope>[^/]+)/) mathch failed because the scope inlcude '/' character.
5255
# Replace regex to fixed it.
@@ -56,15 +59,12 @@ directive:
5659

5760
# Remove the set Workspace cmdlet
5861
- where:
59-
verb: Set
60-
subject: ""
62+
variant: ^(Create|Update).*(?<!Expanded|JsonFilePath|JsonString)$
6163
remove: true
62-
63-
# Remove the unexpanded parameter set
6464
- where:
65-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
65+
verb: Set
6666
remove: true
67-
67+
6868
- where:
6969
verb: Get
7070
subject: RequestStatus|Usage
@@ -74,15 +74,13 @@ directive:
7474
# Rename parameter
7575
- where:
7676
werb: New
77-
subject: ""
7877
parameter-name: NameValue
7978
set:
8079
parameter-name: Name
8180
# Hide parameter
8281
# future extendibility. It’s not used currently
8382
- where:
8483
verb: New|Update
85-
subject: ""
8684
parameter-name: AnyProperty
8785
hide: true
8886

@@ -126,6 +124,7 @@ directive:
126124
- no-inline:
127125
- LimitJsonObject
128126

129-
# - model-cmdlet:
130-
# - LimitObject # Successfull generated then hide it to custom(Rename cmdlet and parameter).
127+
- model-cmdlet:
128+
- model-name: LimitObject
129+
cmdlet-name: New-AzQuotaLimitObject
131130
```
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"resourceType": "quotaRequests",
3+
"apiVersion": "2023-02-01",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.quota"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzQuotaRequestStatus",
10+
"description": "Get the quota request details and status by quota request ID for the resources of the resource provider at a specific location.\nThe quota request ID **id** is returned in the response of the PUT operation.",
11+
"path": "/{scope}/providers/Microsoft.Quota/quotaRequests/{id}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.quota/get-azquotarequeststatus"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-Id <String>",
20+
"-Scope <String>"
21+
]
22+
}
23+
]
24+
},
25+
"examples": [
26+
{
27+
"description": "Get the quota request details and status by quota request ID for the resources of the resource provider at a specific location. The quota request ID **id** is returned in the response of the PUT operation.",
28+
"parameters": [
29+
{
30+
"name": "-Id",
31+
"value": "[Path.id]"
32+
},
33+
{
34+
"name": "-Scope",
35+
"value": "[Path.scope]"
36+
}
37+
]
38+
}
39+
]
40+
}
41+
]
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"resourceType": "quotas",
3+
"apiVersion": "2023-02-01",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.quota"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzQuota",
10+
"description": "Get the quota limit of a resource.\nThe response can be used to determine the remaining quota to calculate a new quota limit that can be submitted with a PUT request.",
11+
"path": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.quota/get-azquota"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-ResourceName <String>",
20+
"-Scope <String>"
21+
]
22+
}
23+
]
24+
},
25+
"examples": [
26+
{
27+
"description": "Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new quota limit that can be submitted with a PUT request.",
28+
"parameters": [
29+
{
30+
"name": "-ResourceName",
31+
"value": "[Path.resourceName]"
32+
},
33+
{
34+
"name": "-Scope",
35+
"value": "[Path.scope]"
36+
}
37+
]
38+
}
39+
]
40+
}
41+
]
42+
}

0 commit comments

Comments
 (0)