Skip to content

Commit 6ccd8a5

Browse files
authored
[CustomLocation] Update custom location api version (#23598)
* update custom location api version * update ExampleIssues.csv * Change the parameter to required * Remove syntax CreateViaIdentityExpanded in New-AzCustomLocation * update
1 parent 3483c90 commit 6ccd8a5

File tree

44 files changed

+3900
-1049
lines changed

Some content is hidden

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

44 files changed

+3900
-1049
lines changed

src/CustomLocation/CustomLocation.Autorest/Az.CustomLocation.psd1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.CustomLocation.private.dll'
1313
FormatsToProcess = './Az.CustomLocation.format.ps1xml'
14-
FunctionsToExport = 'Get-AzCustomLocation', 'Get-AzCustomLocationEnabledResourceType', 'New-AzCustomLocation', 'Remove-AzCustomLocation', 'Update-AzCustomLocation', '*'
15-
AliasesToExport = '*'
14+
FunctionsToExport = 'Find-AzCustomLocationTargetResourceGroup', 'Get-AzCustomLocation', 'Get-AzCustomLocationEnabledResourceType', 'Get-AzCustomLocationResourceSyncRule', 'New-AzCustomLocation', 'New-AzCustomLocationMatchExpressionsObject', 'New-AzCustomLocationResourceSyncRule', 'Remove-AzCustomLocation', 'Remove-AzCustomLocationResourceSyncRule', 'Update-AzCustomLocation', 'Update-AzCustomLocationResourceSyncRule'
1615
PrivateData = @{
1716
PSData = @{
1817
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'CustomLocation'

src/CustomLocation/CustomLocation.Autorest/README.md

Lines changed: 37 additions & 10 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,22 +30,18 @@ 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-
commit: c6c9e02ae4de78cd7357bc4a5a7be38e6f1909d0
33+
commit: f1180941e238bc99ac71f9535ecd126bb8b77d8f
3434
require:
3535
- $(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
4141
subject-prefix: $(service-name)
4242

4343
identity-correction-for-post: true
4444

45-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
46-
use-extension:
47-
"@autorest/powershell": "3.x"
48-
4945
directive:
5046
- from: swagger-document
5147
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}"].delete.responses
@@ -63,7 +59,7 @@ directive:
6359
"default": {
6460
"description": "Error response describing why the operation failed.",
6561
"schema": {
66-
"$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"
6763
}
6864
}
6965
}
@@ -94,9 +90,15 @@ directive:
9490
transform: return $.replace(/\{resourceName\}\/enabledResourceTypes/g, "{resourceName}/enabledresourcetypes")
9591

9692
- where:
97-
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$
98101
remove: true
99-
100102
- where:
101103
verb: Set
102104
remove: true
@@ -125,6 +127,18 @@ directive:
125127
set:
126128
parameter-name: Name
127129

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+
128142
- where:
129143
model-name: CustomLocation
130144
set:
@@ -133,4 +147,17 @@ directive:
133147
- Location
134148
- Name
135149
- 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
136163
```
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.Autorest/UX/microsoft.extendedlocation/customlocations.json

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,72 @@
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
},
77
"commands": [
8+
{
9+
"name": "Find-AzCustomLocationTargetResourceGroup",
10+
"description": "Returns the target resource group associated with the resource sync rules of the Custom Location that match the rules passed in with the Find Target Resource Group Request.",
11+
"path": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.extendedlocation/customlocations/{resourceName}/findTargetResourceGroup",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.customlocation/find-azcustomlocationtargetresourcegroup"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-CustomLocationName <String>",
20+
"-ResourceGroupName <String>",
21+
"[-SubscriptionId <String>]"
22+
]
23+
},
24+
{
25+
"parameters": [
26+
"-CustomLocationName <String>",
27+
"-ResourceGroupName <String>",
28+
"[-SubscriptionId <String>]"
29+
]
30+
}
31+
]
32+
},
33+
"examples": [
34+
{
35+
"description": "Returns the target resource group associated with the resource sync rules of the Custom Location that match the rules passed in with the Find Target Resource Group Request.",
36+
"parameters": [
37+
{
38+
"name": "-CustomLocationName",
39+
"value": "[Path.resourceName]"
40+
},
41+
{
42+
"name": "-ResourceGroupName",
43+
"value": "[Path.resourceGroupName]"
44+
},
45+
{
46+
"name": "-SubscriptionId",
47+
"value": "[Path.subscriptionId]"
48+
}
49+
]
50+
},
51+
{
52+
"description": "Returns the target resource group associated with the resource sync rules of the Custom Location that match the rules passed in with the Find Target Resource Group Request.",
53+
"parameters": [
54+
{
55+
"name": "-CustomLocationName",
56+
"value": "[Path.resourceName]"
57+
},
58+
{
59+
"name": "-ResourceGroupName",
60+
"value": "[Path.resourceGroupName]"
61+
},
62+
{
63+
"name": "-SubscriptionId",
64+
"value": "[Path.subscriptionId]"
65+
}
66+
]
67+
}
68+
]
69+
},
870
{
971
"name": "Get-AzCustomLocation",
1072
"description": "Gets the details of the customLocation with a specified resource group and name.",

0 commit comments

Comments
 (0)