Skip to content

Migrate Cdn from generation to main #24488

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 2 commits into from
Mar 25, 2024
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
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
8 changes: 7 additions & 1 deletion src/Cdn/Cdn.Autorest/exports/Clear-AzCdnEndpointContent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,13 @@ begin {
PurgeViaIdentityExpanded1 = 'Az.Cdn.private\Clear-AzCdnEndpointContent_PurgeViaIdentityExpanded1';
}
if (('Purge1', 'PurgeExpanded1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.PipelineMock' -eq $_.Target.GetType().FullName) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,13 @@ begin {
PurgeViaIdentityExpanded = 'Az.Cdn.private\Clear-AzFrontDoorCdnEndpointContent_PurgeViaIdentityExpanded';
}
if (('Purge', 'PurgeExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.PipelineMock' -eq $_.Target.GetType().FullName) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,13 @@ begin {
DisableViaIdentity = 'Az.Cdn.private\Disable-AzCdnCustomDomainCustomHttps_DisableViaIdentity';
}
if (('Disable') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.PipelineMock' -eq $_.Target.GetType().FullName) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,13 @@ begin {
EnableViaIdentity = 'Az.Cdn.private\Enable-AzCdnCustomDomainCustomHttps_EnableViaIdentity';
}
if (('Enable') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.PipelineMock' -eq $_.Target.GetType().FullName) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,13 @@ begin {
__AllParameterSets = 'Az.Cdn.custom\Enable-AzFrontDoorCdnProfileMigration';
}
if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.PipelineMock' -eq $_.Target.GetType().FullName) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
8 changes: 7 additions & 1 deletion src/Cdn/Cdn.Autorest/exports/Get-AzCdnCustomDomain.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ begin {
List1 = 'Az.Cdn.private\Get-AzCdnCustomDomain_List1';
}
if (('Get1', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.PipelineMock' -eq $_.Target.GetType().FullName) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
8 changes: 7 additions & 1 deletion src/Cdn/Cdn.Autorest/exports/Get-AzCdnEndpoint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,13 @@ begin {
List1 = 'Az.Cdn.private\Get-AzCdnEndpoint_List1';
}
if (('Get1', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.PipelineMock' -eq $_.Target.GetType().FullName) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,13 @@ begin {
List1 = 'Az.Cdn.private\Get-AzCdnEndpointResourceUsage_List1';
}
if (('List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.PipelineMock' -eq $_.Target.GetType().FullName) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
8 changes: 7 additions & 1 deletion src/Cdn/Cdn.Autorest/exports/Get-AzCdnOrigin.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ begin {
List1 = 'Az.Cdn.private\Get-AzCdnOrigin_List1';
}
if (('Get1', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.PipelineMock' -eq $_.Target.GetType().FullName) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
8 changes: 7 additions & 1 deletion src/Cdn/Cdn.Autorest/exports/Get-AzCdnOriginGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,13 @@ begin {
List1 = 'Az.Cdn.private\Get-AzCdnOriginGroup_List1';
}
if (('Get1', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.PipelineMock' -eq $_.Target.GetType().FullName) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
8 changes: 7 additions & 1 deletion src/Cdn/Cdn.Autorest/exports/Get-AzCdnProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ begin {
GetViaIdentity = 'Az.Cdn.custom\Get-AzCdnProfile';
}
if (('List', 'Get', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.PipelineMock' -eq $_.Target.GetType().FullName) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ begin {
List1 = 'Az.Cdn.private\Get-AzCdnProfileResourceUsage_List1';
}
if (('List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.PipelineMock' -eq $_.Target.GetType().FullName) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Loading