Skip to content

Commit f7f857d

Browse files
Migrate CustomLocation from generation to main (#23712)
* Move CustomLocation to main * update changelog and delete ./src/customlocation/customlocation/UX * update ExampleIssues.csv --------- Co-authored-by: Jinpei Li <[email protected]>
1 parent bbfd783 commit f7f857d

File tree

320 files changed

+42787
-5831
lines changed

Some content is hidden

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

320 files changed

+42787
-5831
lines changed

src/CustomLocation/CustomLocation.Autorest/Az.CustomLocation.format.ps1xml

Lines changed: 367 additions & 143 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.CustomLocation'
3-
#
4-
# Generated by: Microsoft Corporation
5-
#
6-
# Generated on: 10/28/2021
7-
#
8-
91
@{
10-
11-
# Script module or binary module file associated with this manifest.
12-
RootModule = './Az.CustomLocation.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 = 'b5a68592-6b36-4d8f-b582-a157eb4dfacf'
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: CustomLocation 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.CustomLocation.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.CustomLocation.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-AzCustomLocation', 'Get-AzCustomLocationEnabledResourceType',
73-
'New-AzCustomLocation', 'Remove-AzCustomLocation',
74-
'Update-AzCustomLocation'
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 = 'b5a68592-6b36-4d8f-b582-a157eb4dfacf'
3+
RootModule = './Az.CustomLocation.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: CustomLocation cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.CustomLocation.private.dll'
13+
FormatsToProcess = './Az.CustomLocation.format.ps1xml'
14+
FunctionsToExport = 'Find-AzCustomLocationTargetResourceGroup', 'Get-AzCustomLocation', 'Get-AzCustomLocationEnabledResourceType', 'Get-AzCustomLocationResourceSyncRule', 'New-AzCustomLocation', 'New-AzCustomLocationMatchExpressionsObject', 'New-AzCustomLocationResourceSyncRule', 'Remove-AzCustomLocation', 'Remove-AzCustomLocationResourceSyncRule', 'Update-AzCustomLocation', 'Update-AzCustomLocationResourceSyncRule'
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','CustomLocation'
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 = 'First preview release for module Az.CustomLocation'
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', 'CustomLocation'
18+
LicenseUri = 'https://aka.ms/azps-license'
19+
ProjectUri = 'https://github.com/Azure/azure-powershell'
20+
ReleaseNotes = ''
21+
}
22+
}
13323
}
134-

src/CustomLocation/CustomLocation.Autorest/Az.CustomLocation.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/CustomLocation/CustomLocation.Autorest/README.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This directory contains the PowerShell module for the CustomLocation 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.
@@ -30,11 +30,11 @@ For information on how to develop for `Az.CustomLocation`, see [how-to.md](how-t
3030
> see https://aka.ms/autorest
3131
3232
``` yaml
33-
branch: c6c9e02ae4de78cd7357bc4a5a7be38e6f1909d0
33+
commit: f1180941e238bc99ac71f9535ecd126bb8b77d8f
3434
require:
35-
- $(this-folder)/../readme.azure.noprofile.md
35+
- $(this-folder)/../../readme.azure.noprofile.md
3636
input-file:
37-
- $(repo)/specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/customlocations.json
37+
- $(repo)/specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/customlocations.json
3838

3939
module-version: 0.1.0
4040
title: CustomLocation
@@ -59,7 +59,7 @@ directive:
5959
"default": {
6060
"description": "Error response describing why the operation failed.",
6161
"schema": {
62-
"$ref": "https://github.com/Azure/azure-rest-api-specs/blob/c6c9e02ae4de78cd7357bc4a5a7be38e6f1909d0/specification/common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
62+
"$ref": "https://github.com/Azure/azure-rest-api-specs/blob/f1180941e238bc99ac71f9535ecd126bb8b77d8f/specification/common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
6363
}
6464
}
6565
}
@@ -90,9 +90,15 @@ directive:
9090
transform: return $.replace(/\{resourceName\}\/enabledResourceTypes/g, "{resourceName}/enabledresourcetypes")
9191

9292
- where:
93-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
93+
variant: ^(Create|Update).*(?<!Expanded|JsonFilePath|JsonString)$
94+
remove: true
95+
- where:
96+
subject: CustomLocation
97+
variant: ^CreateViaIdentityExpanded$
98+
remove: true
99+
- where:
100+
variant: ^Find$|^FindViaIdentity$
94101
remove: true
95-
96102
- where:
97103
verb: Set
98104
remove: true
@@ -121,6 +127,18 @@ directive:
121127
set:
122128
parameter-name: Name
123129

130+
- where:
131+
subject: ^CustomLocationTargetResourceGroup$|^ResourceSyncRule$
132+
parameter-name: ResourceName
133+
set:
134+
parameter-name: CustomLocationName
135+
136+
- where:
137+
subject: ^CustomLocationTargetResourceGroup$|^ResourceSyncRule$
138+
parameter-name: ChildResourceName
139+
set:
140+
parameter-name: Name
141+
124142
- where:
125143
model-name: CustomLocation
126144
set:
@@ -129,4 +147,17 @@ directive:
129147
- Location
130148
- Name
131149
- Namespace
150+
- ResourceGroupName
151+
152+
- where:
153+
model-name: EnabledResourceType
154+
set:
155+
format-table:
156+
properties:
157+
- Name
158+
- ExtensionType
159+
160+
- model-cmdlet:
161+
- model-name: MatchExpressionsProperties
162+
cmdlet-name: New-AzCustomLocationMatchExpressionsObject
132163
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"resourceType": "customlocations/resourceSyncRules",
3+
"apiVersion": "2021-08-31-preview",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.customlocation"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzCustomLocationResourceSyncRule",
10+
"description": "Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name.",
11+
"path": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.extendedlocation/customlocations/{resourceName}/resourceSyncRules/{childResourceName}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.customlocation/get-azcustomlocationresourcesyncrule"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-CustomLocationName <String>",
20+
"-Name <String>",
21+
"-ResourceGroupName <String>",
22+
"[-SubscriptionId <String[]>]"
23+
]
24+
}
25+
]
26+
},
27+
"examples": [
28+
{
29+
"description": "Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name.",
30+
"parameters": [
31+
{
32+
"name": "-CustomLocationName",
33+
"value": "[Path.resourceName]"
34+
},
35+
{
36+
"name": "-Name",
37+
"value": "[Path.childResourceName]"
38+
},
39+
{
40+
"name": "-ResourceGroupName",
41+
"value": "[Path.resourceGroupName]"
42+
},
43+
{
44+
"name": "-SubscriptionId",
45+
"value": "[Path.subscriptionId]"
46+
}
47+
]
48+
}
49+
]
50+
},
51+
{
52+
"name": "Remove-AzCustomLocationResourceSyncRule",
53+
"description": "Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id.",
54+
"path": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.extendedlocation/customlocations/{resourceName}/resourceSyncRules/{childResourceName}",
55+
"help": {
56+
"learnMore": {
57+
"url": "https://learn.microsoft.com/powershell/module/az.customlocation/remove-azcustomlocationresourcesyncrule"
58+
},
59+
"parameterSets": [
60+
{
61+
"parameters": [
62+
"-CustomLocationName <String>",
63+
"-Name <String>",
64+
"-ResourceGroupName <String>",
65+
"[-SubscriptionId <String>]"
66+
]
67+
}
68+
]
69+
},
70+
"examples": [
71+
{
72+
"description": "Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id.",
73+
"parameters": [
74+
{
75+
"name": "-CustomLocationName",
76+
"value": "[Path.resourceName]"
77+
},
78+
{
79+
"name": "-Name",
80+
"value": "[Path.childResourceName]"
81+
},
82+
{
83+
"name": "-ResourceGroupName",
84+
"value": "[Path.resourceGroupName]"
85+
},
86+
{
87+
"name": "-SubscriptionId",
88+
"value": "[Path.subscriptionId]"
89+
}
90+
]
91+
}
92+
]
93+
}
94+
]
95+
}

src/CustomLocation/CustomLocation/UX/microsoft.extendedlocation/customlocations.json renamed to src/CustomLocation/CustomLocation.Autorest/UX/microsoft.extendedlocation/customlocations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "customlocations",
3-
"apiVersion": "2021-08-15",
3+
"apiVersion": "2021-08-31-preview",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.customlocation"
66
},

0 commit comments

Comments
 (0)