Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Next Next commit
Move Cdn to release-2024-03-05
  • Loading branch information
azure-powershell-bot committed Feb 28, 2024
commit fd94e32263b6f0f72b50dbcc27ed9bea50c0d024
269 changes: 21 additions & 248 deletions src/Cdn/Cdn.Autorest/Az.Cdn.psd1

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions src/Cdn/Cdn.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
This directory contains the PowerShell module for the Cdn service.

---

## Info
- Modifiable: yes
- Generated: all
Expand All @@ -30,7 +29,7 @@ For information on how to develop for `Az.Cdn`, see [how-to.md](how-to.md).
``` yaml
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../readme.azure.noprofile.md
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
# You need to specify your swagger files here.
- $(repo)/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/afdx.json
Expand All @@ -43,7 +42,7 @@ module-version: 0.1.0
# Normally, title is the service name
title: Cdn
subject-prefix: $(service-name)
branch: 61c04ab5495e259114bc427cdd77c3ab8ce8ec81
commit: 61c04ab5495e259114bc427cdd77c3ab8ce8ec81

# If there are post APIs for some kinds of actions in the RP, you may need to
# uncomment following line to support viaIdentity for these post APIs
Expand All @@ -52,6 +51,10 @@ identity-correction-for-post: true
resourcegroup-append: true
nested-object-to-string: 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..operationId
Expand Down
43 changes: 43 additions & 0 deletions src/Cdn/Cdn.Autorest/UX/Microsoft.Cdn/profiles-afdEndpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,49 @@
"url": "https://learn.microsoft.com/powershell/module/az.cdn"
},
"commands": [
{
"name": "Clear-AzFrontDoorCdnEndpointContent",
"description": "Removes a content from AzureFrontDoor.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/purge",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.cdn/clear-azfrontdoorcdnendpointcontent"
},
"parameterSets": [
{
"parameters": [
"-EndpointName <String>",
"-ProfileName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Removes a content from AzureFrontDoor.",
"parameters": [
{
"name": "-EndpointName",
"value": "[Path.endpointName]"
},
{
"name": "-ProfileName",
"value": "[Path.profileName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Get-AzFrontDoorCdnEndpoint",
"description": "Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource group and profile.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,54 @@
}
]
},
{
"name": "Enable-AzCdnCustomDomainCustomHttps",
"description": "Enable https delivery of the custom domain.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.cdn/enable-azcdncustomdomaincustomhttps"
},
"parameterSets": [
{
"parameters": [
"-CustomDomainName <String>",
"-EndpointName <String>",
"-ProfileName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Enable https delivery of the custom domain.",
"parameters": [
{
"name": "-CustomDomainName",
"value": "[Path.customDomainName]"
},
{
"name": "-EndpointName",
"value": "[Path.endpointName]"
},
{
"name": "-ProfileName",
"value": "[Path.profileName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Get-AzCdnCustomDomain",
"description": "Gets an existing custom domain within an endpoint.",
Expand Down
86 changes: 86 additions & 0 deletions src/Cdn/Cdn.Autorest/UX/Microsoft.Cdn/profiles-endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,49 @@
"url": "https://learn.microsoft.com/powershell/module/az.cdn"
},
"commands": [
{
"name": "Clear-AzCdnEndpointContent",
"description": "Removes a content from CDN.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.cdn/clear-azcdnendpointcontent"
},
"parameterSets": [
{
"parameters": [
"-EndpointName <String>",
"-ProfileName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Removes a content from CDN.",
"parameters": [
{
"name": "-EndpointName",
"value": "[Path.endpointName]"
},
{
"name": "-ProfileName",
"value": "[Path.profileName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Get-AzCdnEndpoint",
"description": "Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile.",
Expand Down Expand Up @@ -48,6 +91,49 @@
}
]
},
{
"name": "Import-AzCdnEndpointContent",
"description": "Pre-loads a content to CDN.\nAvailable for Verizon Profiles.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.cdn/import-azcdnendpointcontent"
},
"parameterSets": [
{
"parameters": [
"-EndpointName <String>",
"-ProfileName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Pre-loads a content to CDN. Available for Verizon Profiles.",
"parameters": [
{
"name": "-EndpointName",
"value": "[Path.endpointName]"
},
{
"name": "-ProfileName",
"value": "[Path.profileName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Remove-AzCdnEndpoint",
"description": "Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile.",
Expand Down
9 changes: 8 additions & 1 deletion src/Cdn/Cdn.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ if($NoDocs) {
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
}
$null = New-Item -ItemType Directory -Force -Path $docsFolder
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
}

Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
Expand All @@ -162,4 +163,10 @@ Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFol
Write-Host -ForegroundColor Green 'Creating example stubs...'
Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder

if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
{
Write-Host -ForegroundColor Green 'Creating ux metadata...'
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
}

Write-Host -ForegroundColor Green '-------------Done-------------'
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,19 @@ function Start-AzFrontDoorCdnProfilePrepareMigration {
$allPoliciesWithWAF = New-Object System.Collections.Generic.HashSet[string]
$allPoliciesWithVault = New-Object System.Collections.Generic.HashSet[string]
foreach ($info in $frontDoorInfos) {
if ($info.WebApplicationFirewallPolicyLink) {
$allPoliciesWithWAF.Add($info.WebApplicationFirewallPolicyLink) | Out-Null
$wafInfo = $info.WebApplicationFirewallPolicyLink
if ($wafInfo) {
$allPoliciesWithWAF.Add($wafInfo.ToLower()) | Out-Null
}
if ($info.Vault) {
$allPoliciesWithVault.Add($info.Vault.split("/")[-1]) | Out-Null
$vaultNameInfo = $info.Vault.split("/")[-1]
$allPoliciesWithVault.Add($vaultNameInfo.ToLower()) | Out-Null
}
}

Write-Debug("WAF linked to the frontdoor: $allPoliciesWithWAF")
Write-Debug("Key vault name used for the frontdoor: $allPoliciesWithVault")

if (${MigrationWebApplicationFirewallMapping}.count -ne $allPoliciesWithWAF.count) {
throw "MigrationWebApplicationFirewallMapping parameter instance should be equal to the number of WAF policy instance in the profile."
}
Expand Down
4 changes: 4 additions & 0 deletions src/Cdn/Cdn.Autorest/exports/Clear-AzCdnEndpointContent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
Expand Down
4 changes: 4 additions & 0 deletions src/Cdn/Cdn.Autorest/exports/Get-AzCdnCustomDomain.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
Expand Down
4 changes: 4 additions & 0 deletions src/Cdn/Cdn.Autorest/exports/Get-AzCdnEdgeNode.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
Expand Down
Loading