Skip to content

[CustomLocation] Update custom location api version #23598

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

Merged
merged 6 commits into from
Dec 12, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.CustomLocation.private.dll'
FormatsToProcess = './Az.CustomLocation.format.ps1xml'
FunctionsToExport = 'Get-AzCustomLocation', 'Get-AzCustomLocationEnabledResourceType', 'New-AzCustomLocation', 'Remove-AzCustomLocation', 'Update-AzCustomLocation', '*'
AliasesToExport = '*'
FunctionsToExport = 'Find-AzCustomLocationTargetResourceGroup', 'Get-AzCustomLocation', 'Get-AzCustomLocationEnabledResourceType', 'Get-AzCustomLocationResourceSyncRule', 'New-AzCustomLocation', 'New-AzCustomLocationMatchExpressionsObject', 'New-AzCustomLocationResourceSyncRule', 'Remove-AzCustomLocation', 'Remove-AzCustomLocationResourceSyncRule', 'Update-AzCustomLocation', 'Update-AzCustomLocationResourceSyncRule'
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'CustomLocation'
Expand Down
47 changes: 37 additions & 10 deletions src/CustomLocation/CustomLocation.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This directory contains the PowerShell module for the CustomLocation service.
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.

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

## Authentication
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
Expand All @@ -30,22 +30,18 @@ For information on how to develop for `Az.CustomLocation`, see [how-to.md](how-t
> see https://aka.ms/autorest

``` yaml
commit: c6c9e02ae4de78cd7357bc4a5a7be38e6f1909d0
commit: f1180941e238bc99ac71f9535ecd126bb8b77d8f
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/stable/2021-08-15/customlocations.json
- $(repo)/specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/customlocations.json

module-version: 0.1.0
title: CustomLocation
subject-prefix: $(service-name)

identity-correction-for-post: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}"].delete.responses
Expand All @@ -63,7 +59,7 @@ directive:
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "https://github.com/Azure/azure-rest-api-specs/blob/c6c9e02ae4de78cd7357bc4a5a7be38e6f1909d0/specification/common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "https://github.com/Azure/azure-rest-api-specs/blob/f1180941e238bc99ac71f9535ecd126bb8b77d8f/specification/common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
}
}
}
Expand Down Expand Up @@ -94,9 +90,15 @@ directive:
transform: return $.replace(/\{resourceName\}\/enabledResourceTypes/g, "{resourceName}/enabledresourcetypes")

- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
variant: ^(Create|Update).*(?<!Expanded|JsonFilePath|JsonString)$
remove: true
- where:
subject: CustomLocation
variant: ^CreateViaIdentityExpanded$
remove: true
- where:
variant: ^Find$|^FindViaIdentity$
remove: true

- where:
verb: Set
remove: true
Expand Down Expand Up @@ -125,6 +127,18 @@ directive:
set:
parameter-name: Name

- where:
subject: ^CustomLocationTargetResourceGroup$|^ResourceSyncRule$
parameter-name: ResourceName
set:
parameter-name: CustomLocationName

- where:
subject: ^CustomLocationTargetResourceGroup$|^ResourceSyncRule$
parameter-name: ChildResourceName
set:
parameter-name: Name

- where:
model-name: CustomLocation
set:
Expand All @@ -133,4 +147,17 @@ directive:
- Location
- Name
- Namespace
- ResourceGroupName

- where:
model-name: EnabledResourceType
set:
format-table:
properties:
- Name
- ExtensionType

- model-cmdlet:
- model-name: MatchExpressionsProperties
cmdlet-name: New-AzCustomLocationMatchExpressionsObject
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"resourceType": "customlocations/resourceSyncRules",
"apiVersion": "2021-08-31-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.customlocation"
},
"commands": [
{
"name": "Get-AzCustomLocationResourceSyncRule",
"description": "Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name.",
"path": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.extendedlocation/customlocations/{resourceName}/resourceSyncRules/{childResourceName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.customlocation/get-azcustomlocationresourcesyncrule"
},
"parameterSets": [
{
"parameters": [
"-CustomLocationName <String>",
"-Name <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name.",
"parameters": [
{
"name": "-CustomLocationName",
"value": "[Path.resourceName]"
},
{
"name": "-Name",
"value": "[Path.childResourceName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Remove-AzCustomLocationResourceSyncRule",
"description": "Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id.",
"path": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.extendedlocation/customlocations/{resourceName}/resourceSyncRules/{childResourceName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.customlocation/remove-azcustomlocationresourcesyncrule"
},
"parameterSets": [
{
"parameters": [
"-CustomLocationName <String>",
"-Name <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id.",
"parameters": [
{
"name": "-CustomLocationName",
"value": "[Path.resourceName]"
},
{
"name": "-Name",
"value": "[Path.childResourceName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,72 @@
{
"resourceType": "customlocations",
"apiVersion": "2021-08-15",
"apiVersion": "2021-08-31-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.customlocation"
},
"commands": [
{
"name": "Find-AzCustomLocationTargetResourceGroup",
"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.",
"path": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.extendedlocation/customlocations/{resourceName}/findTargetResourceGroup",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.customlocation/find-azcustomlocationtargetresourcegroup"
},
"parameterSets": [
{
"parameters": [
"-CustomLocationName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
},
{
"parameters": [
"-CustomLocationName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"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.",
"parameters": [
{
"name": "-CustomLocationName",
"value": "[Path.resourceName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
},
{
"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.",
"parameters": [
{
"name": "-CustomLocationName",
"value": "[Path.resourceName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Get-AzCustomLocation",
"description": "Gets the details of the customLocation with a specified resource group and name.",
Expand Down
Loading