Skip to content
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
2 changes: 2 additions & 0 deletions src/Cdn/Cdn.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ module-version: 0.1.0
# Normally, title is the service name
title: Cdn
subject-prefix: $(service-name)
# Change Safety: opt in -AcquirePolicyToken / -ChangeReference on write cmdlets
enable-change-safety: true
commit: 9e9079a5d235e0c804e7fbb188258a84b4221571

# If there are post APIs for some kinds of actions in the RP, you may need to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,21 @@ function Enable-AzFrontDoorCdnProfileMigration {
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\Invoke-AzCdnCommitProfileMigration_Commit' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}

process {
Write-Host("Start to migrate.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ function Invoke-AzCdnCommitProfileToAFDMigration {
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\Invoke-AzCdnCommitProfileMigration_Commit' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}

process {
Write-Host("Start to migrate.")
Expand Down
15 changes: 15 additions & 0 deletions src/Cdn/Cdn.Autorest/custom/Move-AzCdnProfileToAFD.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,21 @@ function Move-AzCdnProfileToAFD {
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\Move-AzFrontDoorCdnCdnProfilesTo_MigrateExpanded' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}
process {
ValidateIdentityType
Write-Host("Start the initial progress of migration of CDN profile to Azure Front Door.")
Expand Down
26 changes: 21 additions & 5 deletions src/Cdn/Cdn.Autorest/custom/New-AzCdnProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,27 @@ function New-AzCdnProfile {
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)

if(-Not (ISFrontDoorCdnProfile($PSBoundParameters['SkuName']))){
Az.Cdn.internal\New-AzCdnProfile @PSBoundParameters
}else{
throw "$($PSBoundParameters['SkuName']) is not a valid SKU. Please use a valid AzureCDN SkuName.";
dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\New-AzCdnProfile_CreateExpanded' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}
process {
if(-Not (ISFrontDoorCdnProfile($PSBoundParameters['SkuName']))){
Az.Cdn.internal\New-AzCdnProfile @PSBoundParameters
}else{
throw "$($PSBoundParameters['SkuName']) is not a valid SKU. Please use a valid AzureCDN SkuName.";
}
}
}

16 changes: 16 additions & 0 deletions src/Cdn/Cdn.Autorest/custom/New-AzFrontDoorCdnProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,22 @@ function New-AzFrontDoorCdnProfile {
${ProxyUseDefaultCredentials}
)

dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\New-AzCdnProfile_CreateExpanded' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}

process {
if(ISFrontDoorCdnProfile($PSBoundParameters['SkuName']))
{
Expand Down
15 changes: 15 additions & 0 deletions src/Cdn/Cdn.Autorest/custom/New-AzFrontDoorCdnRoute.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,21 @@ function New-AzFrontDoorCdnRoute {
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\New-AzFrontDoorCdnRoute_CreateExpanded' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}

process {
if (${CompressionSettingIsCompressionEnabled}.IsPresent) {
Expand Down
15 changes: 15 additions & 0 deletions src/Cdn/Cdn.Autorest/custom/Remove-AzCdnProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,21 @@ function Remove-AzCdnProfile {
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\Remove-AzCdnProfile_Delete' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}

process {
$hasAsJob = $PSBoundParameters.Remove('AsJob')
Expand Down
16 changes: 16 additions & 0 deletions src/Cdn/Cdn.Autorest/custom/Remove-AzFrontDoorCdnProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,22 @@ function Remove-AzFrontDoorCdnProfile {
${ProxyUseDefaultCredentials}
)

dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\Remove-AzCdnProfile_Delete' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}

process {
$hasAsJob = $PSBoundParameters.Remove('AsJob')
$hasNoWait = $PSBoundParameters.Remove('NoWait')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,21 @@ function Start-AzFrontDoorCdnProfilePrepareMigration {
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\Move-AzCdnProfile_MigrateExpanded' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}

process {
if (!(Get-Module -ListAvailable -Name Az.FrontDoor)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,21 @@ function Test-AzFrontDoorCdnProfileMigration {
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\Invoke-AzCdnCanProfileMigrate_CanExpanded' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}

process {
Write-Host("This could take a few seconds to a few mins depending on the complexity of your resource.")
Expand Down
15 changes: 15 additions & 0 deletions src/Cdn/Cdn.Autorest/custom/Update-AzCdnProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,21 @@ function Update-AzCdnProfile {
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\Update-AzCdnProfile_UpdateExpanded' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}

process {
$hasTag = $PSBoundParameters.Remove('Tag')
Expand Down
16 changes: 16 additions & 0 deletions src/Cdn/Cdn.Autorest/custom/Update-AzFrontDoorCdnProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,22 @@ function Update-AzFrontDoorCdnProfile {
${ProxyUseDefaultCredentials}
)

dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\Update-AzCdnProfile_UpdateExpanded' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}

process {
$hasTag = $PSBoundParameters.Remove('Tag')
$hasOriginResponseTimeout = $PSBoundParameters.Remove('OriginResponseTimeoutSecond')
Expand Down
15 changes: 15 additions & 0 deletions src/Cdn/Cdn.Autorest/custom/Update-AzFrontDoorCdnProfileSku.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,21 @@ function Update-AzFrontDoorCdnProfileSku {
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
dynamicparam {
# Change Safety: forward the wrapped generated cmdlet's dynamic parameters (-AcquirePolicyToken / -ChangeReference).
# Self-gates on enable-change-safety: the private cmdlet implements IDynamicParameters only when the module opted in.
$dynamicParameters = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new()
$wrapped = Get-Command -Name 'Az.Cdn.private\Update-AzFrontDoorCdnProfileSku_Upgrade' -ErrorAction Ignore
if ($wrapped -and [System.Management.Automation.IDynamicParameters].IsAssignableFrom($wrapped.ImplementingType)) {
$instance = [System.Activator]::CreateInstance($wrapped.ImplementingType)
foreach ($entry in $instance.GetDynamicParameters().GetEnumerator()) {
if (-not $dynamicParameters.ContainsKey($entry.Key)) {
$dynamicParameters.Add($entry.Key, $entry.Value)
}
}
}
return $dynamicParameters
}

process {
if (!(Get-Module -ListAvailable -Name Az.FrontDoor)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Cdn/Cdn.Autorest/generate-info.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"generate_Id": "93c4dd87-c726-443a-9d3b-2dc823cd4a6b"
"generate_Id": "39d7c1e4-7bfb-4e14-a49a-ba3e1c9354f5"
}
1 change: 1 addition & 0 deletions src/Cdn/Cdn/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
-->

## Upcoming Release
* Added ChangeSafety Support

## Version 6.1.0
* Upgraded API version to 2026-04-01-preview.
Expand Down