Skip to content

Commit 7d3a777

Browse files
Migrate Dns from generation to main (#23253)
* Move Dns to main * Update ChangeLog.md * Update Set-AzDnsZone.md * Update Set-AzDnsZone.md --------- Co-authored-by: Yabo Hu <[email protected]>
1 parent 8925eed commit 7d3a777

File tree

370 files changed

+56377
-23
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+56377
-23
lines changed

src/Dns/Dns.Autorest/Az.Dns.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<PsModuleName>Dns</PsModuleName>
4+
<PsRootModuleName>Dns</PsRootModuleName>
5+
<PsModuleFolder>Dns.Autorest</PsModuleFolder>
6+
</PropertyGroup>
7+
8+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.autorest.hybrid.props" />
9+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.Post.props" />
10+
</Project>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="utf-16"?>
2+
<Configuration>
3+
<ViewDefinitions>
4+
<View>
5+
<Name>Microsoft.Azure.PowerShell.Cmdlets.Dns.Models.Api20230701Preview.RecordSetPropertiesMetadata</Name>
6+
<ViewSelectedBy>
7+
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Dns.Models.Api20230701Preview.RecordSetPropertiesMetadata</TypeName>
8+
</ViewSelectedBy>
9+
<TableControl>
10+
<TableHeaders>
11+
<TableColumnHeader>
12+
<Label>Item</Label>
13+
</TableColumnHeader>
14+
</TableHeaders>
15+
<TableRowEntries>
16+
<TableRowEntry>
17+
<TableColumnItems>
18+
<TableColumnItem>
19+
<PropertyName>Item</PropertyName>
20+
</TableColumnItem>
21+
</TableColumnItems>
22+
</TableRowEntry>
23+
</TableRowEntries>
24+
</TableControl>
25+
</View>
26+
<View>
27+
<Name>Microsoft.Azure.PowerShell.Cmdlets.Dns.Models.Api20230701Preview.ResourceTags</Name>
28+
<ViewSelectedBy>
29+
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Dns.Models.Api20230701Preview.ResourceTags</TypeName>
30+
</ViewSelectedBy>
31+
<TableControl>
32+
<TableHeaders>
33+
<TableColumnHeader>
34+
<Label>Item</Label>
35+
</TableColumnHeader>
36+
</TableHeaders>
37+
<TableRowEntries>
38+
<TableRowEntry>
39+
<TableColumnItems>
40+
<TableColumnItem>
41+
<PropertyName>Item</PropertyName>
42+
</TableColumnItem>
43+
</TableColumnItems>
44+
</TableRowEntry>
45+
</TableRowEntries>
46+
</TableControl>
47+
</View>
48+
<View>
49+
<Name>Microsoft.Azure.PowerShell.Cmdlets.Dns.Models.Api20230701Preview.ZoneUpdateTags</Name>
50+
<ViewSelectedBy>
51+
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Dns.Models.Api20230701Preview.ZoneUpdateTags</TypeName>
52+
</ViewSelectedBy>
53+
<TableControl>
54+
<TableHeaders>
55+
<TableColumnHeader>
56+
<Label>Item</Label>
57+
</TableColumnHeader>
58+
</TableHeaders>
59+
<TableRowEntries>
60+
<TableRowEntry>
61+
<TableColumnItems>
62+
<TableColumnItem>
63+
<PropertyName>Item</PropertyName>
64+
</TableColumnItem>
65+
</TableColumnItems>
66+
</TableRowEntry>
67+
</TableRowEntries>
68+
</TableControl>
69+
</View>
70+
</ViewDefinitions>
71+
</Configuration>

src/Dns/Dns.Autorest/Az.Dns.psd1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@{
2+
GUID = '6bb9f5b6-6948-424c-b7b3-faba33be0aef'
3+
RootModule = './Az.Dns.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: Dns cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.Dns.private.dll'
13+
FormatsToProcess = './Az.Dns.format.ps1xml'
14+
FunctionsToExport = 'Get-AzDnsDnssecConfig', 'New-AzDnsDnssecConfig', 'Remove-AzDnsDnssecConfig', '*'
15+
AliasesToExport = '*'
16+
PrivateData = @{
17+
PSData = @{
18+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Dns'
19+
LicenseUri = 'https://aka.ms/azps-license'
20+
ProjectUri = 'https://github.com/Azure/azure-powershell'
21+
ReleaseNotes = ''
22+
}
23+
}
24+
}

src/Dns/Dns.Autorest/Az.Dns.psm1

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# region Generated
2+
# ----------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
14+
# is regenerated.
15+
# ----------------------------------------------------------------------------------
16+
# Load required Az.Accounts module
17+
$accountsName = 'Az.Accounts'
18+
$accountsModule = Get-Module -Name $accountsName
19+
if(-not $accountsModule) {
20+
$localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
21+
if(Test-Path -Path $localAccountsPath) {
22+
$localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
23+
if($localAccounts) {
24+
$accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
25+
}
26+
}
27+
if(-not $accountsModule) {
28+
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
29+
if($hasAdequateVersion) {
30+
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
31+
}
32+
}
33+
}
34+
35+
if(-not $accountsModule) {
36+
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
37+
} elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
38+
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
39+
}
40+
Write-Information "Loaded Module '$($accountsModule.Name)'"
41+
42+
# Load the private module dll
43+
$null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.Dns.private.dll')
44+
45+
# Get the private module's instance
46+
$instance = [Microsoft.Azure.PowerShell.Cmdlets.Dns.Module]::Instance
47+
48+
# Ask for the shared functionality table
49+
$VTable = Register-AzModule
50+
51+
# Tweaks the pipeline on module load
52+
$instance.OnModuleLoad = $VTable.OnModuleLoad
53+
54+
# Following two delegates are added for telemetry
55+
$instance.GetTelemetryId = $VTable.GetTelemetryId
56+
$instance.Telemetry = $VTable.Telemetry
57+
58+
59+
# Tweaks the pipeline per call
60+
$instance.OnNewRequest = $VTable.OnNewRequest
61+
62+
# Gets shared parameter values
63+
$instance.GetParameterValue = $VTable.GetParameterValue
64+
65+
# Allows shared module to listen to events from this module
66+
$instance.EventListener = $VTable.EventListener
67+
68+
# Gets shared argument completers
69+
$instance.ArgumentCompleter = $VTable.ArgumentCompleter
70+
71+
# The name of the currently selected Azure profile
72+
$instance.ProfileName = $VTable.ProfileName
73+
74+
75+
# Load the custom module
76+
$customModulePath = Join-Path $PSScriptRoot './custom/Az.Dns.custom.psm1'
77+
if(Test-Path $customModulePath) {
78+
$null = Import-Module -Name $customModulePath
79+
}
80+
81+
# Export nothing to clear implicit exports
82+
Export-ModuleMember
83+
84+
# Export proxy cmdlet scripts
85+
$exportsPath = Join-Path $PSScriptRoot './exports'
86+
$directories = Get-ChildItem -Directory -Path $exportsPath
87+
$profileDirectory = $null
88+
if($instance.ProfileName) {
89+
if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
90+
$profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
91+
} else {
92+
# Don't export anything if the profile doesn't exist for the module
93+
$exportsPath = $null
94+
Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
95+
}
96+
} elseif(($directories | Measure-Object).Count -gt 0) {
97+
# Load the last folder if no profile is selected
98+
$profileDirectory = $directories | Select-Object -Last 1
99+
}
100+
101+
if($profileDirectory) {
102+
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
103+
$exportsPath = $profileDirectory.FullName
104+
}
105+
106+
if($exportsPath) {
107+
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
108+
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
109+
Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
110+
}
111+
112+
# Finalize initialization of this module
113+
$instance.Init();
114+
Write-Information "Loaded Module '$($instance.Name)'"
115+
# endregion
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Reflection;
17+
using System.Runtime.InteropServices;
18+
19+
[assembly: AssemblyTitle("Microsoft Azure Powershell - Dns")]
20+
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
21+
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
22+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
23+
24+
[assembly: ComVisible(false)]
25+
[assembly: CLSCompliant(false)]
26+
[assembly: Guid("ebe02e66-bc10-4a30-87df-125d3264ebb5")]
27+
[assembly: AssemblyVersion("0.1.0")]
28+
[assembly: AssemblyFileVersion("0.1.0")]

src/Dns/Dns.Autorest/README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<!-- region Generated -->
2+
# Az.Dns
3+
This directory contains the PowerShell module for the Dns service.
4+
5+
---
6+
## Status
7+
[![Az.Dns](https://img.shields.io/powershellgallery/v/Az.Dns.svg?style=flat-square&label=Az.Dns "Az.Dns")](https://www.powershellgallery.com/packages/Az.Dns/)
8+
9+
## Info
10+
- Modifiable: yes
11+
- Generated: all
12+
- Committed: yes
13+
- Packaged: yes
14+
15+
---
16+
## Detail
17+
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
18+
19+
## Module Requirements
20+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
21+
22+
## Authentication
23+
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
24+
25+
## Development
26+
For information on how to develop for `Az.Dns`, see [how-to.md](how-to.md).
27+
<!-- endregion -->
28+
29+
### AutoRest Configuration
30+
> see https://aka.ms/autorest
31+
32+
``` yaml
33+
branch: a3126a361b75f952ece050b2cf67c11d4e542ef8
34+
require:
35+
- $(this-folder)/../../readme.azure.noprofile.md
36+
input-file:
37+
- $(repo)/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/dns.json
38+
39+
# For new RP, the version is 0.1.0
40+
module-version: 0.1.0
41+
# Normally, title is the service name
42+
title: Dns
43+
subject-prefix: $(service-name)
44+
45+
# If there are post APIs for some kinds of actions in the RP, you may need to
46+
# uncomment following line to support viaIdentity for these post APIs
47+
# identity-correction-for-post: true
48+
resourcegroup-append: true
49+
nested-object-to-string: true
50+
51+
directive:
52+
# Following is two common directive which are normally required in all the RPs
53+
# 1. Remove the unexpanded parameter set
54+
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
55+
- where:
56+
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
57+
subject: ^(?!.*DnssecConfig).*$
58+
remove: true
59+
# Remove the set-* cmdlet
60+
61+
- where:
62+
verb: Set
63+
remove: true
64+
65+
# Remove zone and record set cmdlets
66+
- where:
67+
subject: ^(?!.*DnssecConfig).*$
68+
remove: true
69+
70+
- where:
71+
subject: (^DnssecConfig)
72+
set:
73+
preview-announcement:
74+
preview-message: DNSSEC support for Azure DNS Public Zones is in preview.
75+
76+
# Table formatting
77+
78+
- where:
79+
model-name: (.*)
80+
set:
81+
suppress-format: true
82+
83+
```

0 commit comments

Comments
 (0)