diff --git a/src/Cdn/Cdn.Autorest/Az.Cdn.psd1 b/src/Cdn/Cdn.Autorest/Az.Cdn.psd1 index fed6a97f2da5..4ed7127b4f93 100644 --- a/src/Cdn/Cdn.Autorest/Az.Cdn.psd1 +++ b/src/Cdn/Cdn.Autorest/Az.Cdn.psd1 @@ -11,7 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.Cdn.private.dll' FormatsToProcess = './Az.Cdn.format.ps1xml' - FunctionsToExport = 'Clear-AzCdnEndpointContent', 'Clear-AzFrontDoorCdnEndpointContent', 'Disable-AzCdnCustomDomainCustomHttps', 'Enable-AzCdnCustomDomainCustomHttps', 'Get-AzCdnCustomDomain', 'Get-AzCdnEdgeNode', 'Get-AzCdnEndpoint', 'Get-AzCdnEndpointResourceUsage', 'Get-AzCdnLogAnalyticLocation', 'Get-AzCdnLogAnalyticMetric', 'Get-AzCdnLogAnalyticRanking', 'Get-AzCdnLogAnalyticResource', 'Get-AzCdnLogAnalyticWafLogAnalyticMetric', 'Get-AzCdnLogAnalyticWafLogAnalyticRanking', 'Get-AzCdnManagedRuleSet', 'Get-AzCdnOrigin', 'Get-AzCdnOriginGroup', 'Get-AzCdnPolicy', 'Get-AzCdnProfile', 'Get-AzCdnProfileResourceUsage', 'Get-AzCdnProfileSupportedOptimizationType', 'Get-AzCdnResourceUsage', 'Get-AzFrontDoorCdnCustomDomain', 'Get-AzFrontDoorCdnEndpoint', 'Get-AzFrontDoorCdnEndpointResourceUsage', 'Get-AzFrontDoorCdnOrigin', 'Get-AzFrontDoorCdnOriginGroup', 'Get-AzFrontDoorCdnOriginGroupResourceUsage', 'Get-AzFrontDoorCdnProfile', 'Get-AzFrontDoorCdnProfileResourceUsage', 'Get-AzFrontDoorCdnRoute', 'Get-AzFrontDoorCdnRule', 'Get-AzFrontDoorCdnRuleSet', 'Get-AzFrontDoorCdnRuleSetResourceUsage', 'Get-AzFrontDoorCdnSecret', 'Get-AzFrontDoorCdnSecurityPolicy', 'Import-AzCdnEndpointContent', 'Invoke-AzCdnSecretValidate', 'New-AzCdnAzureFirstPartyManagedCertificateParametersObject', 'New-AzCdnCustomDomain', 'New-AzCdnCustomerCertificateParametersObject', 'New-AzCdnDeliveryRuleCacheExpirationActionObject', 'New-AzCdnDeliveryRuleCacheKeyQueryStringActionObject', 'New-AzCdnDeliveryRuleClientPortConditionObject', 'New-AzCdnDeliveryRuleCookiesConditionObject', 'New-AzCdnDeliveryRuleHostNameConditionObject', 'New-AzCdnDeliveryRuleHttpVersionConditionObject', 'New-AzCdnDeliveryRuleIsDeviceConditionObject', 'New-AzCdnDeliveryRulePostArgsConditionObject', 'New-AzCdnDeliveryRuleQueryStringConditionObject', 'New-AzCdnDeliveryRuleRemoteAddressConditionObject', 'New-AzCdnDeliveryRuleRequestBodyConditionObject', 'New-AzCdnDeliveryRuleRequestHeaderActionObject', 'New-AzCdnDeliveryRuleRequestHeaderConditionObject', 'New-AzCdnDeliveryRuleRequestMethodConditionObject', 'New-AzCdnDeliveryRuleRequestSchemeConditionObject', 'New-AzCdnDeliveryRuleRequestUriConditionObject', 'New-AzCdnDeliveryRuleResponseHeaderActionObject', 'New-AzCdnDeliveryRuleRouteConfigurationOverrideActionObject', 'New-AzCdnDeliveryRuleServerPortConditionObject', 'New-AzCdnDeliveryRuleSocketAddrConditionObject', 'New-AzCdnDeliveryRuleSslProtocolConditionObject', 'New-AzCdnDeliveryRuleUrlFileExtensionConditionObject', 'New-AzCdnDeliveryRuleUrlFileNameConditionObject', 'New-AzCdnDeliveryRuleUrlPathConditionObject', 'New-AzCdnEndpoint', 'New-AzCdnManagedCertificateParametersObject', 'New-AzCdnOrigin', 'New-AzCdnOriginGroup', 'New-AzCdnOriginGroupOverrideActionObject', 'New-AzCdnPolicy', 'New-AzCdnProfile', 'New-AzCdnProfileSsoUri', 'New-AzCdnSecurityPolicyWebApplicationFirewallAssociationObject', 'New-AzCdnSecurityPolicyWebApplicationFirewallParametersObject', 'New-AzCdnUrlRedirectActionObject', 'New-AzCdnUrlRewriteActionObject', 'New-AzCdnUrlSigningActionObject', 'New-AzCdnUrlSigningKeyParametersObject', 'New-AzFrontDoorCdnCustomDomain', 'New-AzFrontDoorCdnEndpoint', 'New-AzFrontDoorCdnOrigin', 'New-AzFrontDoorCdnOriginGroup', 'New-AzFrontDoorCdnProfile', 'New-AzFrontDoorCdnRoute', 'New-AzFrontDoorCdnRule', 'New-AzFrontDoorCdnRuleSet', 'New-AzFrontDoorCdnSecret', 'New-AzFrontDoorCdnSecurityPolicy', 'Remove-AzCdnCustomDomain', 'Remove-AzCdnEndpoint', 'Remove-AzCdnOrigin', 'Remove-AzCdnOriginGroup', 'Remove-AzCdnPolicy', 'Remove-AzCdnProfile', 'Remove-AzFrontDoorCdnCustomDomain', 'Remove-AzFrontDoorCdnEndpoint', 'Remove-AzFrontDoorCdnOrigin', 'Remove-AzFrontDoorCdnOriginGroup', 'Remove-AzFrontDoorCdnProfile', 'Remove-AzFrontDoorCdnRoute', 'Remove-AzFrontDoorCdnRule', 'Remove-AzFrontDoorCdnRuleSet', 'Remove-AzFrontDoorCdnSecret', 'Remove-AzFrontDoorCdnSecurityPolicy', 'Start-AzCdnEndpoint', 'Stop-AzCdnEndpoint', 'Test-AzCdnEndpointCustomDomain', 'Test-AzCdnEndpointNameAvailability', 'Test-AzCdnNameAvailability', 'Test-AzCdnProbe', 'Test-AzFrontDoorCdnEndpointCustomDomain', 'Test-AzFrontDoorCdnProfileHostNameAvailability', 'Update-AzCdnEndpoint', 'Update-AzCdnOrigin', 'Update-AzCdnOriginGroup', 'Update-AzCdnPolicy', 'Update-AzCdnProfile', 'Update-AzFrontDoorCdnCustomDomain', 'Update-AzFrontDoorCdnCustomDomainValidationToken', 'Update-AzFrontDoorCdnEndpoint', 'Update-AzFrontDoorCdnOrigin', 'Update-AzFrontDoorCdnOriginGroup', 'Update-AzFrontDoorCdnProfile', 'Update-AzFrontDoorCdnRoute', 'Update-AzFrontDoorCdnRule', 'Update-AzFrontDoorCdnSecurityPolicy', '*' + FunctionsToExport = 'Clear-AzCdnEndpointContent', 'Clear-AzFrontDoorCdnEndpointContent', 'Disable-AzCdnCustomDomainCustomHttps', 'Enable-AzCdnCustomDomainCustomHttps', 'Get-AzCdnCustomDomain', 'Get-AzCdnEdgeNode', 'Get-AzCdnEndpoint', 'Get-AzCdnEndpointResourceUsage', 'Get-AzCdnLogAnalyticLocation', 'Get-AzCdnLogAnalyticMetric', 'Get-AzCdnLogAnalyticRanking', 'Get-AzCdnLogAnalyticResource', 'Get-AzCdnLogAnalyticWafLogAnalyticMetric', 'Get-AzCdnLogAnalyticWafLogAnalyticRanking', 'Get-AzCdnManagedRuleSet', 'Get-AzCdnOrigin', 'Get-AzCdnOriginGroup', 'Get-AzCdnPolicy', 'Get-AzCdnProfile', 'Get-AzCdnProfileResourceUsage', 'Get-AzCdnProfileSupportedOptimizationType', 'Get-AzCdnResourceUsage', 'Get-AzFrontDoorCdnCustomDomain', 'Get-AzFrontDoorCdnEndpoint', 'Get-AzFrontDoorCdnEndpointResourceUsage', 'Get-AzFrontDoorCdnOrigin', 'Get-AzFrontDoorCdnOriginGroup', 'Get-AzFrontDoorCdnOriginGroupResourceUsage', 'Get-AzFrontDoorCdnProfile', 'Get-AzFrontDoorCdnProfileResourceUsage', 'Get-AzFrontDoorCdnRoute', 'Get-AzFrontDoorCdnRule', 'Get-AzFrontDoorCdnRuleSet', 'Get-AzFrontDoorCdnRuleSetResourceUsage', 'Get-AzFrontDoorCdnSecret', 'Get-AzFrontDoorCdnSecurityPolicy', 'Import-AzCdnEndpointContent', 'Invoke-AzCdnSecretValidate', 'New-AzCdnAzureFirstPartyManagedCertificateParametersObject', 'New-AzCdnCustomDomain', 'New-AzCdnCustomerCertificateParametersObject', 'New-AzCdnDeliveryRuleCacheExpirationActionObject', 'New-AzCdnDeliveryRuleCacheKeyQueryStringActionObject', 'New-AzCdnDeliveryRuleClientPortConditionObject', 'New-AzCdnDeliveryRuleCookiesConditionObject', 'New-AzCdnDeliveryRuleHostNameConditionObject', 'New-AzCdnDeliveryRuleHttpVersionConditionObject', 'New-AzCdnDeliveryRuleIsDeviceConditionObject', 'New-AzCdnDeliveryRulePostArgsConditionObject', 'New-AzCdnDeliveryRuleQueryStringConditionObject', 'New-AzCdnDeliveryRuleRemoteAddressConditionObject', 'New-AzCdnDeliveryRuleRequestBodyConditionObject', 'New-AzCdnDeliveryRuleRequestHeaderActionObject', 'New-AzCdnDeliveryRuleRequestHeaderConditionObject', 'New-AzCdnDeliveryRuleRequestMethodConditionObject', 'New-AzCdnDeliveryRuleRequestSchemeConditionObject', 'New-AzCdnDeliveryRuleRequestUriConditionObject', 'New-AzCdnDeliveryRuleResponseHeaderActionObject', 'New-AzCdnDeliveryRuleRouteConfigurationOverrideActionObject', 'New-AzCdnDeliveryRuleServerPortConditionObject', 'New-AzCdnDeliveryRuleSocketAddrConditionObject', 'New-AzCdnDeliveryRuleSslProtocolConditionObject', 'New-AzCdnDeliveryRuleUrlFileExtensionConditionObject', 'New-AzCdnDeliveryRuleUrlFileNameConditionObject', 'New-AzCdnDeliveryRuleUrlPathConditionObject', 'New-AzCdnEndpoint', 'New-AzCdnManagedCertificateParametersObject', 'New-AzCdnOrigin', 'New-AzCdnOriginGroup', 'New-AzCdnOriginGroupOverrideActionObject', 'New-AzCdnPolicy', 'New-AzCdnProfile', 'New-AzCdnProfileSsoUri', 'New-AzCdnSecurityPolicyWebApplicationFirewallAssociationObject', 'New-AzCdnSecurityPolicyWebApplicationFirewallParametersObject', 'New-AzCdnUrlRedirectActionObject', 'New-AzCdnUrlRewriteActionObject', 'New-AzCdnUrlSigningActionObject', 'New-AzCdnUrlSigningKeyParametersObject', 'New-AzFrontDoorCdnCustomDomain', 'New-AzFrontDoorCdnEndpoint', 'New-AzFrontDoorCdnOrigin', 'New-AzFrontDoorCdnOriginGroup', 'New-AzFrontDoorCdnProfile', 'New-AzFrontDoorCdnRoute', 'New-AzFrontDoorCdnRule', 'New-AzFrontDoorCdnRuleSet', 'New-AzFrontDoorCdnSecret', 'New-AzFrontDoorCdnSecurityPolicy', 'Remove-AzCdnCustomDomain', 'Remove-AzCdnEndpoint', 'Remove-AzCdnOrigin', 'Remove-AzCdnOriginGroup', 'Remove-AzCdnPolicy', 'Remove-AzCdnProfile', 'Remove-AzFrontDoorCdnCustomDomain', 'Remove-AzFrontDoorCdnEndpoint', 'Remove-AzFrontDoorCdnOrigin', 'Remove-AzFrontDoorCdnOriginGroup', 'Remove-AzFrontDoorCdnProfile', 'Remove-AzFrontDoorCdnRoute', 'Remove-AzFrontDoorCdnRule', 'Remove-AzFrontDoorCdnRuleSet', 'Remove-AzFrontDoorCdnSecret', 'Remove-AzFrontDoorCdnSecurityPolicy', 'Start-AzCdnEndpoint', 'Stop-AzCdnEndpoint', 'Test-AzCdnEndpointCustomDomain', 'Test-AzCdnNameAvailability', 'Test-AzCdnProbe', 'Test-AzFrontDoorCdnEndpointCustomDomain', 'Test-AzFrontDoorCdnEndpointNameAvailability', 'Test-AzFrontDoorCdnProfileHostNameAvailability', 'Update-AzCdnEndpoint', 'Update-AzCdnOrigin', 'Update-AzCdnOriginGroup', 'Update-AzCdnPolicy', 'Update-AzCdnProfile', 'Update-AzFrontDoorCdnCustomDomain', 'Update-AzFrontDoorCdnCustomDomainValidationToken', 'Update-AzFrontDoorCdnEndpoint', 'Update-AzFrontDoorCdnOrigin', 'Update-AzFrontDoorCdnOriginGroup', 'Update-AzFrontDoorCdnProfile', 'Update-AzFrontDoorCdnRoute', 'Update-AzFrontDoorCdnRule', 'Update-AzFrontDoorCdnSecurityPolicy', '*' AliasesToExport = '*' PrivateData = @{ PSData = @{ diff --git a/src/Cdn/Cdn.Autorest/README.md b/src/Cdn/Cdn.Autorest/README.md index 1965020d6783..b43f8c6d33d8 100644 --- a/src/Cdn/Cdn.Autorest/README.md +++ b/src/Cdn/Cdn.Autorest/README.md @@ -110,6 +110,11 @@ directive: - where: verb: Set remove: true + # Remove some cmdlets' ViaIdentity which are inconvinient to call + - where: + variant: ^CheckViaIdentity$|^CheckViaIdentityExpanded$ + subject: ^NameAvailability$|^EndpointNameAvailability$ + remove: true # Hide Cdn profile - where: @@ -149,7 +154,11 @@ directive: subject: SecurityPolicy set: subject-prefix: FrontDoorCdn - subject: SecurityPolicy + subject: SecurityPolicy + - where: + subject: EndpointNameAvailability + set: + subject-prefix: FrontDoorCdn # https://github.com/Azure/autorest.powershell/issues/906 - where: diff --git a/src/Cdn/Cdn.Autorest/docs/Az.Cdn.md b/src/Cdn/Cdn.Autorest/docs/Az.Cdn.md index ad654122d729..b63c5026510f 100644 --- a/src/Cdn/Cdn.Autorest/docs/Az.Cdn.md +++ b/src/Cdn/Cdn.Autorest/docs/Az.Cdn.md @@ -341,10 +341,6 @@ Stops an existing running CDN endpoint. ### [Test-AzCdnEndpointCustomDomain](Test-AzCdnEndpointCustomDomain.md) Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. -### [Test-AzCdnEndpointNameAvailability](Test-AzCdnEndpointNameAvailability.md) -Check the availability of a resource name. -This is needed for resources where name is globally unique, such as a afdx endpoint. - ### [Test-AzCdnNameAvailability](Test-AzCdnNameAvailability.md) Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. @@ -357,6 +353,10 @@ This path is relative to the origin path specified in the endpoint configuration ### [Test-AzFrontDoorCdnEndpointCustomDomain](Test-AzFrontDoorCdnEndpointCustomDomain.md) Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. +### [Test-AzFrontDoorCdnEndpointNameAvailability](Test-AzFrontDoorCdnEndpointNameAvailability.md) +Check the availability of a resource name. +This is needed for resources where name is globally unique, such as a afdx endpoint. + ### [Test-AzFrontDoorCdnProfileHostNameAvailability](Test-AzFrontDoorCdnProfileHostNameAvailability.md) Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. diff --git a/src/Cdn/Cdn.Autorest/docs/Test-AzCdnNameAvailability.md b/src/Cdn/Cdn.Autorest/docs/Test-AzCdnNameAvailability.md index 0afbfd7fdbde..8c6e45aa4251 100644 --- a/src/Cdn/Cdn.Autorest/docs/Test-AzCdnNameAvailability.md +++ b/src/Cdn/Cdn.Autorest/docs/Test-AzCdnNameAvailability.md @@ -37,19 +37,6 @@ Test-AzCdnNameAvailability -Name -Type [-SubscriptionId [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` -### CheckViaIdentity -``` -Test-AzCdnNameAvailability -InputObject - -CheckNameAvailabilityInput [-DefaultProfile ] [-Confirm] [-WhatIf] - [] -``` - -### CheckViaIdentityExpanded -``` -Test-AzCdnNameAvailability -InputObject -Name -Type - [-DefaultProfile ] [-Confirm] [-WhatIf] [] -``` - ## DESCRIPTION Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. @@ -82,7 +69,7 @@ To construct, see NOTES section for CHECKNAMEAVAILABILITYINPUT properties and cr ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20210601.ICheckNameAvailabilityInput -Parameter Sets: Check, Check1, CheckViaIdentity +Parameter Sets: Check, Check1 Aliases: Required: True @@ -107,28 +94,12 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InputObject -Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.ICdnIdentity -Parameter Sets: CheckViaIdentity, CheckViaIdentityExpanded -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - ### -Name The resource name to validate. ```yaml Type: System.String -Parameter Sets: CheckExpanded, CheckExpanded1, CheckViaIdentityExpanded +Parameter Sets: CheckExpanded, CheckExpanded1 Aliases: Required: True @@ -158,7 +129,7 @@ The type of the resource whose name is to be validated. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ResourceType -Parameter Sets: CheckExpanded, CheckExpanded1, CheckViaIdentityExpanded +Parameter Sets: CheckExpanded, CheckExpanded1 Aliases: Required: True @@ -206,8 +177,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20210601.ICheckNameAvailabilityInput -### Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.ICdnIdentity - ## OUTPUTS ### Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20210601.ICheckNameAvailabilityOutput @@ -225,21 +194,5 @@ CHECKNAMEAVAILABILITYINPUT : Input of CheckNameAvai - `Name `: The resource name to validate. - `Type `: The type of the resource whose name is to be validated. -INPUTOBJECT : Identity Parameter - - `[CustomDomainName ]`: Name of the domain under the profile which is unique globally. - - `[EndpointName ]`: Name of the endpoint under the profile which is unique globally. - - `[Id ]`: Resource identity path - - `[OriginGroupName ]`: Name of the origin group which is unique within the endpoint. - - `[OriginName ]`: Name of the origin which is unique within the profile. - - `[PolicyName ]`: The name of the CdnWebApplicationFirewallPolicy. - - `[ProfileName ]`: Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group. - - `[ResourceGroupName ]`: Name of the Resource group within the Azure subscription. - - `[RouteName ]`: Name of the routing rule. - - `[RuleName ]`: Name of the delivery rule which is unique within the endpoint. - - `[RuleSetName ]`: Name of the rule set under the profile which is unique globally. - - `[SecretName ]`: Name of the Secret under the profile. - - `[SecurityPolicyName ]`: Name of the security policy under the profile. - - `[SubscriptionId ]`: Azure Subscription ID. - ## RELATED LINKS diff --git a/src/Cdn/Cdn.Autorest/docs/Test-AzCdnEndpointNameAvailability.md b/src/Cdn/Cdn.Autorest/docs/Test-AzFrontDoorCdnEndpointNameAvailability.md similarity index 63% rename from src/Cdn/Cdn.Autorest/docs/Test-AzCdnEndpointNameAvailability.md rename to src/Cdn/Cdn.Autorest/docs/Test-AzFrontDoorCdnEndpointNameAvailability.md index e0f6c7757f34..23b3fa84d3cc 100644 --- a/src/Cdn/Cdn.Autorest/docs/Test-AzCdnEndpointNameAvailability.md +++ b/src/Cdn/Cdn.Autorest/docs/Test-AzFrontDoorCdnEndpointNameAvailability.md @@ -1,11 +1,11 @@ --- external help file: Module Name: Az.Cdn -online version: https://docs.microsoft.com/powershell/module/az.cdn/test-azcdnendpointnameavailability +online version: https://docs.microsoft.com/powershell/module/az.cdn/test-azfrontdoorcdnendpointnameavailability schema: 2.0.0 --- -# Test-AzCdnEndpointNameAvailability +# Test-AzFrontDoorCdnEndpointNameAvailability ## SYNOPSIS Check the availability of a resource name. @@ -15,32 +15,18 @@ This is needed for resources where name is globally unique, such as a afdx endpo ### CheckExpanded (Default) ``` -Test-AzCdnEndpointNameAvailability -ResourceGroupName -Name -Type +Test-AzFrontDoorCdnEndpointNameAvailability -ResourceGroupName -Name -Type [-SubscriptionId ] [-AutoGeneratedDomainNameLabelScope ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` ### Check ``` -Test-AzCdnEndpointNameAvailability -ResourceGroupName +Test-AzFrontDoorCdnEndpointNameAvailability -ResourceGroupName -CheckEndpointNameAvailabilityInput [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` -### CheckViaIdentity -``` -Test-AzCdnEndpointNameAvailability -InputObject - -CheckEndpointNameAvailabilityInput [-DefaultProfile ] - [-Confirm] [-WhatIf] [] -``` - -### CheckViaIdentityExpanded -``` -Test-AzCdnEndpointNameAvailability -InputObject -Name -Type - [-AutoGeneratedDomainNameLabelScope ] [-DefaultProfile ] - [-Confirm] [-WhatIf] [] -``` - ## DESCRIPTION Check the availability of a resource name. This is needed for resources where name is globally unique, such as a afdx endpoint. @@ -49,8 +35,10 @@ This is needed for resources where name is globally unique, such as a afdx endpo ### Example 1: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +{{ Add code here }} +``` +```output {{ Add output here }} ``` @@ -58,8 +46,10 @@ PS C:\> {{ Add code here }} ### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +{{ Add code here }} +``` +```output {{ Add output here }} ``` @@ -73,7 +63,7 @@ The default value is TenantReuse. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.AutoGeneratedDomainNameLabelScope -Parameter Sets: CheckExpanded, CheckViaIdentityExpanded +Parameter Sets: CheckExpanded Aliases: Required: False @@ -89,7 +79,7 @@ To construct, see NOTES section for CHECKENDPOINTNAMEAVAILABILITYINPUT propertie ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20210601.ICheckEndpointNameAvailabilityInput -Parameter Sets: Check, CheckViaIdentity +Parameter Sets: Check Aliases: Required: True @@ -114,28 +104,12 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InputObject -Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.ICdnIdentity -Parameter Sets: CheckViaIdentity, CheckViaIdentityExpanded -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - ### -Name The resource name to validate. ```yaml Type: System.String -Parameter Sets: CheckExpanded, CheckViaIdentityExpanded +Parameter Sets: CheckExpanded Aliases: Required: True @@ -150,7 +124,7 @@ Name of the Resource group within the Azure subscription. ```yaml Type: System.String -Parameter Sets: Check, CheckExpanded +Parameter Sets: (All) Aliases: Required: True @@ -165,7 +139,7 @@ Azure Subscription ID. ```yaml Type: System.String -Parameter Sets: Check, CheckExpanded +Parameter Sets: (All) Aliases: Required: False @@ -180,7 +154,7 @@ The type of the resource whose name is to be validated. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ResourceType -Parameter Sets: CheckExpanded, CheckViaIdentityExpanded +Parameter Sets: CheckExpanded Aliases: Required: True @@ -228,8 +202,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20210601.ICheckEndpointNameAvailabilityInput -### Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.ICdnIdentity - ## OUTPUTS ### Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20210601.ICheckEndpointNameAvailabilityOutput @@ -248,21 +220,5 @@ CHECKENDPOINTNAMEAVAILABILITYINPUT : Input - `Type `: The type of the resource whose name is to be validated. - `[AutoGeneratedDomainNameLabelScope ]`: Indicates the endpoint name reuse scope. The default value is TenantReuse. -INPUTOBJECT : Identity Parameter - - `[CustomDomainName ]`: Name of the domain under the profile which is unique globally. - - `[EndpointName ]`: Name of the endpoint under the profile which is unique globally. - - `[Id ]`: Resource identity path - - `[OriginGroupName ]`: Name of the origin group which is unique within the endpoint. - - `[OriginName ]`: Name of the origin which is unique within the profile. - - `[PolicyName ]`: The name of the CdnWebApplicationFirewallPolicy. - - `[ProfileName ]`: Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group. - - `[ResourceGroupName ]`: Name of the Resource group within the Azure subscription. - - `[RouteName ]`: Name of the routing rule. - - `[RuleName ]`: Name of the delivery rule which is unique within the endpoint. - - `[RuleSetName ]`: Name of the rule set under the profile which is unique globally. - - `[SecretName ]`: Name of the Secret under the profile. - - `[SecurityPolicyName ]`: Name of the security policy under the profile. - - `[SubscriptionId ]`: Azure Subscription ID. - ## RELATED LINKS diff --git a/src/Cdn/Cdn.Autorest/examples/Test-AzCdnEndpointNameAvailability.md b/src/Cdn/Cdn.Autorest/examples/Test-AzFrontDoorCdnEndpointNameAvailability.md similarity index 75% rename from src/Cdn/Cdn.Autorest/examples/Test-AzCdnEndpointNameAvailability.md rename to src/Cdn/Cdn.Autorest/examples/Test-AzFrontDoorCdnEndpointNameAvailability.md index 093355d11d50..6ee1a83db970 100644 --- a/src/Cdn/Cdn.Autorest/examples/Test-AzCdnEndpointNameAvailability.md +++ b/src/Cdn/Cdn.Autorest/examples/Test-AzFrontDoorCdnEndpointNameAvailability.md @@ -1,7 +1,9 @@ ### Example 1: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +{{ Add code here }} +``` +```output {{ Add output here }} ``` @@ -9,8 +11,10 @@ PS C:\> {{ Add code here }} ### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +{{ Add code here }} +``` +```output {{ Add output here }} ``` diff --git a/src/Cdn/Cdn.Autorest/test/Get-AzCdnEdgeNode.Tests.ps1 b/src/Cdn/Cdn.Autorest/test/Get-AzCdnEdgeNode.Tests.ps1 index 3efc70dd42bf..ba0dc81949fa 100644 --- a/src/Cdn/Cdn.Autorest/test/Get-AzCdnEdgeNode.Tests.ps1 +++ b/src/Cdn/Cdn.Autorest/test/Get-AzCdnEdgeNode.Tests.ps1 @@ -15,7 +15,34 @@ if(($null -eq $TestName) -or ($TestName -contains 'Get-AzCdnEdgeNode')) } Describe 'Get-AzCdnEdgeNode' { - It 'List' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + It 'List' { + { + $minPrefixLength = 0; + $maxIpv4PrefixLength = 32; + $maxIpv6PrefixLength = 128; + $expectedEdgeNodeNames = @("Standard_Verizon", "Premium_Verizon", "Custom_Verizon") + $edgeNodes = Get-AzCdnEdgeNode + + $edgeNodes.Count | Should -Be 3 + foreach ($edgeNode in $edgeNodes) { + $edgeNode.Name | Should -BeIn $expectedEdgeNodeNames + $edgeNode.IpAddressGroup.Count | Should -BeGreaterThan 0 + foreach ($ipAddressGroup in $edgeNode.IpAddressGroup) { + $ipAddressGroup.DeliveryRegion | Should -Not -BeNullOrEmpty + $ipAddressGroup.Ipv4Address.Count | Should -BeGreaterThan 0 + foreach ($ipAddress in $ipAddressGroup.Ipv4Address) { + $ipAddress.BaseIpAddress | Should -Not -BeNullOrEmpty + $ipAddress.PrefixLength | Should -BeGreaterOrEqual $minPrefixLength + $ipAddress.PrefixLength | Should -BeLessOrEqual $maxIpv4PrefixLength + } + $ipAddressGroup.Ipv6Address.Count | Should -BeGreaterThan 0 + foreach ($ipAddress in $ipAddressGroup.Ipv6Address) { + $ipAddress.BaseIpAddress | Should -Not -BeNullOrEmpty + $ipAddress.PrefixLength | Should -BeGreaterOrEqual $minPrefixLength + $ipAddress.PrefixLength | Should -BeLessOrEqual $maxIpv6PrefixLength + } + } + } + } | Should -Not -Throw } } diff --git a/src/Cdn/Cdn.Autorest/test/Test-AzCdnEndpointNameAvailability.Tests.ps1 b/src/Cdn/Cdn.Autorest/test/Test-AzCdnEndpointNameAvailability.Tests.ps1 deleted file mode 100644 index 9ab4a948ddc9..000000000000 --- a/src/Cdn/Cdn.Autorest/test/Test-AzCdnEndpointNameAvailability.Tests.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -if(($null -eq $TestName) -or ($TestName -contains 'Test-AzCdnEndpointNameAvailability')) -{ - $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' - if (-Not (Test-Path -Path $loadEnvPath)) { - $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' - } - . ($loadEnvPath) - $TestRecordingFile = Join-Path $PSScriptRoot 'Test-AzCdnEndpointNameAvailability.Recording.json' - $currentPath = $PSScriptRoot - while(-not $mockingPath) { - $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File - $currentPath = Split-Path -Path $currentPath -Parent - } - . ($mockingPath | Select-Object -First 1).FullName -} - -Describe 'Test-AzCdnEndpointNameAvailability' { - It 'CheckExpanded' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'Check' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'CheckViaIdentityExpanded' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } - - It 'CheckViaIdentity' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } -} diff --git a/src/Cdn/Cdn.Autorest/test/Test-AzCdnNameAvailability.Tests.ps1 b/src/Cdn/Cdn.Autorest/test/Test-AzCdnNameAvailability.Tests.ps1 index 33fdb1fda9aa..886556ddc89c 100644 --- a/src/Cdn/Cdn.Autorest/test/Test-AzCdnNameAvailability.Tests.ps1 +++ b/src/Cdn/Cdn.Autorest/test/Test-AzCdnNameAvailability.Tests.ps1 @@ -15,27 +15,157 @@ if(($null -eq $TestName) -or ($TestName -contains 'Test-AzCdnNameAvailability')) } Describe 'Test-AzCdnNameAvailability' { - It 'CheckExpanded' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } + It 'CheckExpanded' { + { + $ResourceGroupName = 'testps-rg-' + (RandomString -allChars $false -len 6) + try + { + Write-Host -ForegroundColor Green "Create test group $($ResourceGroupName)" + New-AzResourceGroup -Name $ResourceGroupName -Location $env.location - It 'CheckExpanded1' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw - } + $cdnProfileName = 'p-' + (RandomString -allChars $false -len 6); + Write-Host -ForegroundColor Green "Use cdnProfileName : $($cdnProfileName)" + + $profileSku = "Standard_Microsoft"; + New-AzCdnProfile -SkuName $profileSku -Name $cdnProfileName -ResourceGroupName $ResourceGroupName -Location Global + + $endpointName = 'e-' + (RandomString -allChars $false -len 6); + $origin = @{ + Name = "origin1" + HostName = "host1.hello.com" + }; + $location = "westus" + $resourceType = [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ResourceType]::MicrosoftCdnProfilesEndpoints + Write-Host -ForegroundColor Green "Create endpointName : $($endpointName), origin.Name : $($origin.Name), origin.HostName : $($origin.HostName)" + + $nameAvailability = Test-AzCdnNameAvailability -Name $endpointName -Type $resourceType + $nameAvailability.NameAvailable | Should -BeTrue - It 'Check1' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + New-AzCdnEndpoint -Name $endpointName -ResourceGroupName $ResourceGroupName -ProfileName $cdnProfileName -Location $location -Origin $origin + $nameAvailability = Test-AzCdnNameAvailability -Name $endpointName -Type $resourceType + $nameAvailability.NameAvailable | Should -BeFalse + } Finally + { + Remove-AzResourceGroup -Name $ResourceGroupName -NoWait + } + } | Should -Not -Throw } - It 'CheckViaIdentityExpanded' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + It 'CheckExpanded1' { + { + $subId = $env.SubscriptionId + $ResourceGroupName = 'testps-rg-' + (RandomString -allChars $false -len 6) + try + { + Write-Host -ForegroundColor Green "Create test group $($ResourceGroupName)" + New-AzResourceGroup -Name $ResourceGroupName -Location $env.location + + $cdnProfileName = 'p-' + (RandomString -allChars $false -len 6); + Write-Host -ForegroundColor Green "Use cdnProfileName : $($cdnProfileName)" + + $profileSku = "Standard_Microsoft"; + New-AzCdnProfile -SkuName $profileSku -Name $cdnProfileName -ResourceGroupName $ResourceGroupName -Location Global + + $endpointName = 'e-' + (RandomString -allChars $false -len 6); + $origin = @{ + Name = "origin1" + HostName = "host1.hello.com" + }; + $location = "westus" + $resourceType = [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ResourceType]::MicrosoftCdnProfilesEndpoints + Write-Host -ForegroundColor Green "Create endpointName : $($endpointName), origin.Name : $($origin.Name), origin.HostName : $($origin.HostName)" + + $nameAvailability = Test-AzCdnNameAvailability -Name $endpointName -Type $resourceType -SubscriptionId $subId + $nameAvailability.NameAvailable | Should -BeTrue + + New-AzCdnEndpoint -Name $endpointName -ResourceGroupName $ResourceGroupName -ProfileName $cdnProfileName -Location $location -Origin $origin + $nameAvailability = Test-AzCdnNameAvailability -Name $endpointName -Type $resourceType -SubscriptionId $subId + $nameAvailability.NameAvailable | Should -BeFalse + } Finally + { + Remove-AzResourceGroup -Name $ResourceGroupName -NoWait + } + } | Should -Not -Throw } - It 'CheckViaIdentity' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + It 'Check1' { + { + $subId = $env.SubscriptionId + $ResourceGroupName = 'testps-rg-' + (RandomString -allChars $false -len 6) + try + { + Write-Host -ForegroundColor Green "Create test group $($ResourceGroupName)" + New-AzResourceGroup -Name $ResourceGroupName -Location $env.location + + $cdnProfileName = 'p-' + (RandomString -allChars $false -len 6); + Write-Host -ForegroundColor Green "Use cdnProfileName : $($cdnProfileName)" + + $profileSku = "Standard_Microsoft"; + New-AzCdnProfile -SkuName $profileSku -Name $cdnProfileName -ResourceGroupName $ResourceGroupName -Location Global + + $endpointName = 'e-' + (RandomString -allChars $false -len 6); + $origin = @{ + Name = "origin1" + HostName = "host1.hello.com" + }; + $location = "westus" + Write-Host -ForegroundColor Green "Create endpointName : $($endpointName), origin.Name : $($origin.Name), origin.HostName : $($origin.HostName)" + + $resourceType = [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ResourceType]::MicrosoftCdnProfilesEndpoints + $checkNameAvailabilityInput = @{ + Name = $endpointName + Type = $resourceType + } + $nameAvailability = Test-AzCdnNameAvailability -CheckNameAvailabilityInput $checkNameAvailabilityInput -SubscriptionId $subId + $nameAvailability.NameAvailable | Should -BeTrue + + New-AzCdnEndpoint -Name $endpointName -ResourceGroupName $ResourceGroupName -ProfileName $cdnProfileName -Location $location -Origin $origin + $nameAvailability = Test-AzCdnNameAvailability -CheckNameAvailabilityInput $checkNameAvailabilityInput -SubscriptionId $subId + $nameAvailability.NameAvailable | Should -BeFalse + } Finally + { + Remove-AzResourceGroup -Name $ResourceGroupName -NoWait + } + } | Should -Not -Throw } - It 'Check' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + It 'Check' { + { + $ResourceGroupName = 'testps-rg-' + (RandomString -allChars $false -len 6) + try + { + Write-Host -ForegroundColor Green "Create test group $($ResourceGroupName)" + New-AzResourceGroup -Name $ResourceGroupName -Location $env.location + + $cdnProfileName = 'p-' + (RandomString -allChars $false -len 6); + Write-Host -ForegroundColor Green "Use cdnProfileName : $($cdnProfileName)" + + $profileSku = "Standard_Microsoft"; + New-AzCdnProfile -SkuName $profileSku -Name $cdnProfileName -ResourceGroupName $ResourceGroupName -Location Global + + $endpointName = 'e-' + (RandomString -allChars $false -len 6); + $origin = @{ + Name = "origin1" + HostName = "host1.hello.com" + }; + $location = "westus" + Write-Host -ForegroundColor Green "Create endpointName : $($endpointName), origin.Name : $($origin.Name), origin.HostName : $($origin.HostName)" + + $resourceType = [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ResourceType]::MicrosoftCdnProfilesEndpoints + $checkNameAvailabilityInput = @{ + Name = $endpointName + Type = $resourceType + } + $nameAvailability = Test-AzCdnNameAvailability -CheckNameAvailabilityInput $checkNameAvailabilityInput + $nameAvailability.NameAvailable | Should -BeTrue + + New-AzCdnEndpoint -Name $endpointName -ResourceGroupName $ResourceGroupName -ProfileName $cdnProfileName -Location $location -Origin $origin + $nameAvailability = Test-AzCdnNameAvailability -CheckNameAvailabilityInput $checkNameAvailabilityInput + $nameAvailability.NameAvailable | Should -BeFalse + } Finally + { + Remove-AzResourceGroup -Name $ResourceGroupName -NoWait + } + } | Should -Not -Throw } } diff --git a/src/Cdn/Cdn.Autorest/test/Test-AzFrontDoorCdnEndpointNameAvailability.Tests.ps1 b/src/Cdn/Cdn.Autorest/test/Test-AzFrontDoorCdnEndpointNameAvailability.Tests.ps1 new file mode 100644 index 000000000000..3d995865929d --- /dev/null +++ b/src/Cdn/Cdn.Autorest/test/Test-AzFrontDoorCdnEndpointNameAvailability.Tests.ps1 @@ -0,0 +1,85 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Test-AzFrontDoorCdnEndpointNameAvailability')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Test-AzFrontDoorCdnEndpointNameAvailability.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Test-AzFrontDoorCdnEndpointNameAvailability' { + It 'CheckExpanded' { + { + $ResourceGroupName = 'testps-rg-' + (RandomString -allChars $false -len 6) + try + { + Write-Host -ForegroundColor Green "Create test group $($ResourceGroupName)" + New-AzResourceGroup -Name $ResourceGroupName -Location $env.location + + $frontDoorCdnProfileName = 'fdp-' + (RandomString -allChars $false -len 6); + Write-Host -ForegroundColor Green "Use frontDoorCdnProfileName : $($frontDoorCdnProfileName)" + + $profileSku = "Standard_AzureFrontDoor"; + New-AzFrontDoorCdnProfile -SkuName $profileSku -Name $frontDoorCdnProfileName -ResourceGroupName $ResourceGroupName -Location Global + + $endpointName = 'end-' + (RandomString -allChars $false -len 6); + Write-Host -ForegroundColor Green "Use frontDoorCdnEndpointName : $($endpointName)" + + $resourceType = [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ResourceType]::MicrosoftCdnProfilesAfdEndpoints + + $nameAvailability = Test-AzFrontDoorCdnEndpointNameAvailability -ResourceGroupName $ResourceGroupName -Name $endpointName -Type $resourceType + $nameAvailability.NameAvailable | Should -BeTrue + New-AzFrontDoorCdnEndpoint -EndpointName $endpointName -ProfileName $frontDoorCdnProfileName -ResourceGroupName $ResourceGroupName -Location Global + + $nameAvailability = Test-AzFrontDoorCdnEndpointNameAvailability -ResourceGroupName $ResourceGroupName -Name $endpointName -Type $resourceType + $nameAvailability.NameAvailable | Should -BeFalse + } Finally + { + Remove-AzResourceGroup -Name $ResourceGroupName -NoWait + } + } | Should -Not -Throw + } + + It 'Check' { + { + $ResourceGroupName = 'testps-rg-' + (RandomString -allChars $false -len 6) + try + { + Write-Host -ForegroundColor Green "Create test group $($ResourceGroupName)" + New-AzResourceGroup -Name $ResourceGroupName -Location $env.location + + $frontDoorCdnProfileName = 'fdp-' + (RandomString -allChars $false -len 6); + Write-Host -ForegroundColor Green "Use frontDoorCdnProfileName : $($frontDoorCdnProfileName)" + + $profileSku = "Standard_AzureFrontDoor"; + New-AzFrontDoorCdnProfile -SkuName $profileSku -Name $frontDoorCdnProfileName -ResourceGroupName $ResourceGroupName -Location Global + + $endpointName = 'end-' + (RandomString -allChars $false -len 6); + Write-Host -ForegroundColor Green "Use frontDoorCdnEndpointName : $($endpointName)" + + $resourceType = [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ResourceType]::MicrosoftCdnProfilesAfdEndpoints + $checkNameAvailabilityInput = @{ + Name = $endpointName + Type = $resourceType + } + + $nameAvailability = Test-AzFrontDoorCdnEndpointNameAvailability -ResourceGroupName $ResourceGroupName -CheckEndpointNameAvailabilityInput $checkNameAvailabilityInput + $nameAvailability.NameAvailable | Should -BeTrue + New-AzFrontDoorCdnEndpoint -EndpointName $endpointName -ProfileName $frontDoorCdnProfileName -ResourceGroupName $ResourceGroupName -Location Global + + $nameAvailability = Test-AzFrontDoorCdnEndpointNameAvailability -ResourceGroupName $ResourceGroupName -CheckEndpointNameAvailabilityInput $checkNameAvailabilityInput + $nameAvailability.NameAvailable | Should -BeFalse + } Finally + { + Remove-AzResourceGroup -Name $ResourceGroupName -NoWait + } + } | Should -Not -Throw + } +}