[mgmt] dns release (#31408)
https://github.com/Azure/sdk-release-request/issues/5528
This commit is contained in:
Родитель
f6fca08c34
Коммит
df87d3f655
|
@ -15031,7 +15031,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-dns.tgz:
|
||||
resolution: {integrity: sha512-62eABHBXpoL7JIR7Xz0wCVs8C9a1IDdWUImh5KvHxTm2M46fNw4s7gJD45Uc+SYFUZYWmcxAwvxXk1woNuNHVA==, tarball: file:projects/arm-dns.tgz}
|
||||
resolution: {integrity: sha512-FP3+m6UVBiNg87XItEXkp8blZXIAtGSZ2etA2J9taiBdYL0rqCQQgfgxoD4sU5K8OKH6+wi5X/0PZeQH+Wenvw==, tarball: file:projects/arm-dns.tgz}
|
||||
name: '@rush-temp/arm-dns'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -15045,11 +15045,13 @@ packages:
|
|||
'@types/node': 18.19.57
|
||||
chai: 4.3.10
|
||||
cross-env: 7.0.3
|
||||
dotenv: 16.4.5
|
||||
mkdirp: 3.0.1
|
||||
mocha: 10.7.3
|
||||
rimraf: 5.0.10
|
||||
ts-node: 10.9.2(@types/node@18.19.57)(typescript@5.6.3)
|
||||
tslib: 2.8.0
|
||||
tsx: 4.19.1
|
||||
typescript: 5.6.3
|
||||
uglify-js: 3.19.3
|
||||
transitivePeerDependencies:
|
||||
|
|
|
@ -1,15 +1,49 @@
|
|||
# Release History
|
||||
|
||||
## 5.1.1 (Unreleased)
|
||||
|
||||
|
||||
## 5.2.0-beta.1 (2024-10-15)
|
||||
Compared with version 5.1.0
|
||||
|
||||
### Features Added
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
### Bugs Fixed
|
||||
|
||||
### Other Changes
|
||||
|
||||
- Added operation group DnssecConfigs
|
||||
- Added Interface DelegationSignerInfo
|
||||
- Added Interface Digest
|
||||
- Added Interface DnssecConfig
|
||||
- Added Interface DnssecConfigListResult
|
||||
- Added Interface DnssecConfigsCreateOrUpdateOptionalParams
|
||||
- Added Interface DnssecConfigsDeleteHeaders
|
||||
- Added Interface DnssecConfigsDeleteOptionalParams
|
||||
- Added Interface DnssecConfigsGetOptionalParams
|
||||
- Added Interface DnssecConfigsListByDnsZoneNextOptionalParams
|
||||
- Added Interface DnssecConfigsListByDnsZoneOptionalParams
|
||||
- Added Interface DsRecord
|
||||
- Added Interface NaptrRecord
|
||||
- Added Interface SigningKey
|
||||
- Added Interface SystemData
|
||||
- Added Interface TlsaRecord
|
||||
- Added Interface ZonesDeleteHeaders
|
||||
- Added Type Alias CreatedByType
|
||||
- Added Type Alias DnssecConfigsCreateOrUpdateResponse
|
||||
- Added Type Alias DnssecConfigsGetResponse
|
||||
- Added Type Alias DnssecConfigsListByDnsZoneNextResponse
|
||||
- Added Type Alias DnssecConfigsListByDnsZoneResponse
|
||||
- Interface RecordSet has a new optional parameter dsRecords
|
||||
- Interface RecordSet has a new optional parameter naptrRecords
|
||||
- Interface RecordSet has a new optional parameter tlsaRecords
|
||||
- Interface RecordSet has a new optional parameter trafficManagementProfile
|
||||
- Interface Zone has a new optional parameter signingKeys
|
||||
- Interface Zone has a new optional parameter systemData
|
||||
- Added Enum KnownCreatedByType
|
||||
- Interface RecordSetsListAllByDnsZoneNextOptionalParams no longer has parameter recordSetNameSuffix
|
||||
- Interface RecordSetsListAllByDnsZoneNextOptionalParams no longer has parameter top
|
||||
- Interface RecordSetsListByDnsZoneNextOptionalParams no longer has parameter recordsetnamesuffix
|
||||
- Interface RecordSetsListByDnsZoneNextOptionalParams no longer has parameter top
|
||||
- Interface RecordSetsListByTypeNextOptionalParams no longer has parameter recordsetnamesuffix
|
||||
- Interface RecordSetsListByTypeNextOptionalParams no longer has parameter top
|
||||
- Interface ZonesListByResourceGroupNextOptionalParams no longer has parameter top
|
||||
- Interface ZonesListNextOptionalParams no longer has parameter top
|
||||
|
||||
|
||||
## 5.1.0 (2022-11-22)
|
||||
|
||||
### Features Added
|
||||
|
@ -30,4 +64,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka.
|
|||
|
||||
To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).
|
||||
|
||||
To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ).
|
||||
To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart).
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2022 Microsoft
|
||||
Copyright (c) 2024 Microsoft
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -6,7 +6,7 @@ The DNS Management Client.
|
|||
|
||||
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns) |
|
||||
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-dns) |
|
||||
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-dns) |
|
||||
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-dns?view=azure-node-preview) |
|
||||
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
|
||||
|
||||
## Getting started
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"commit": "20df2424a278ca19437e437a7dbf3a7857a0dd9d",
|
||||
"commit": "f0573da04ed934620c566b96e04ddd80d46d2742",
|
||||
"readme": "specification/dns/resource-manager/readme.md",
|
||||
"autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\dns\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true",
|
||||
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\dns\\resource-manager\\readme.md --use=@autorest/typescript@6.0.27 --generate-sample=true",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.2",
|
||||
"use": "@autorest/typescript@6.0.0-rc.3.20221108.1"
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.13",
|
||||
"use": "@autorest/typescript@6.0.27"
|
||||
}
|
|
@ -2,5 +2,5 @@
|
|||
"AssetsRepo": "Azure/azure-sdk-assets",
|
||||
"AssetsRepoPrefixPath": "js",
|
||||
"TagPrefix": "js/dns/arm-dns",
|
||||
"Tag": "js/dns/arm-dns_3919a2cb96"
|
||||
"Tag": "js/dns/arm-dns_e45d202fd1"
|
||||
}
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
"sdk-type": "mgmt",
|
||||
"author": "Microsoft Corporation",
|
||||
"description": "A generated SDK for DnsManagementClient.",
|
||||
"version": "5.1.1",
|
||||
"version": "5.2.0-beta.1",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@azure/abort-controller": "^1.0.0",
|
||||
"@azure/core-auth": "^1.3.0",
|
||||
"@azure/core-client": "^1.6.1",
|
||||
"@azure/core-lro": "^2.2.0",
|
||||
"@azure/core-lro": "^2.5.4",
|
||||
"@azure/abort-controller": "^2.1.2",
|
||||
"@azure/core-paging": "^1.2.0",
|
||||
"@azure/core-rest-pipeline": "^1.8.0",
|
||||
"@azure/core-client": "^1.7.0",
|
||||
"@azure/core-auth": "^1.6.0",
|
||||
"@azure/core-rest-pipeline": "^1.14.0",
|
||||
"tslib": "^2.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
|
@ -28,21 +28,22 @@
|
|||
"module": "./dist-esm/src/index.js",
|
||||
"types": "./types/arm-dns.d.ts",
|
||||
"devDependencies": {
|
||||
"@azure-tools/test-credential": "^1.0.0",
|
||||
"@azure-tools/test-recorder": "^3.0.0",
|
||||
"typescript": "~5.6.2",
|
||||
"uglify-js": "^3.4.9",
|
||||
"dotenv": "^16.0.0",
|
||||
"@azure/dev-tool": "^1.0.0",
|
||||
"@azure/identity": "^4.0.1",
|
||||
"@types/chai": "^4.2.8",
|
||||
"@azure/identity": "^4.2.1",
|
||||
"@azure-tools/test-recorder": "^3.0.0",
|
||||
"@azure-tools/test-credential": "^1.1.0",
|
||||
"mocha": "^10.0.0",
|
||||
"@types/mocha": "^10.0.0",
|
||||
"@types/node": "^18.0.0",
|
||||
"tsx": "^4.7.1",
|
||||
"@types/chai": "^4.2.8",
|
||||
"chai": "^4.2.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"mocha": "^10.0.0",
|
||||
"ts-node": "^10.0.0",
|
||||
"typescript": "~5.6.2",
|
||||
"uglify-js": "^3.4.9"
|
||||
"@types/node": "^18.0.0",
|
||||
"ts-node": "^10.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js.git"
|
||||
|
@ -68,31 +69,29 @@
|
|||
"types/*"
|
||||
],
|
||||
"scripts": {
|
||||
"audit": "echo skipped",
|
||||
"build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api",
|
||||
"build:browser": "echo skipped",
|
||||
"build:node": "echo skipped",
|
||||
"build:samples": "echo skipped.",
|
||||
"build:test": "echo skipped",
|
||||
"check-format": "echo skipped",
|
||||
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
||||
"execute:samples": "echo skipped",
|
||||
"extract-api": "dev-tool run extract-api",
|
||||
"format": "echo skipped",
|
||||
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
||||
"integration-test:browser": "echo skipped",
|
||||
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
|
||||
"lint": "echo skipped",
|
||||
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
|
||||
"pack": "npm pack 2>&1",
|
||||
"prepack": "npm run build",
|
||||
"pack": "npm pack 2>&1",
|
||||
"extract-api": "dev-tool run extract-api",
|
||||
"lint": "echo skipped",
|
||||
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
||||
"build:node": "echo skipped",
|
||||
"build:browser": "echo skipped",
|
||||
"build:test": "echo skipped",
|
||||
"build:samples": "echo skipped.",
|
||||
"check-format": "echo skipped",
|
||||
"execute:samples": "echo skipped",
|
||||
"format": "echo skipped",
|
||||
"test": "npm run integration-test",
|
||||
"test:browser": "echo skipped",
|
||||
"test:node": "echo skipped",
|
||||
"test:browser": "echo skipped",
|
||||
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
||||
"unit-test:browser": "echo skipped",
|
||||
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
|
||||
"update-snippets": "echo skipped"
|
||||
"unit-test:browser": "echo skipped",
|
||||
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
||||
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
|
||||
"integration-test:browser": "echo skipped"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"//metadata": {
|
||||
|
@ -104,6 +103,7 @@
|
|||
]
|
||||
},
|
||||
"autoPublish": true,
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns",
|
||||
"//sampleConfiguration": {
|
||||
"productName": "",
|
||||
"productSlugs": [
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
import * as coreAuth from '@azure/core-auth';
|
||||
import * as coreClient from '@azure/core-client';
|
||||
import { OperationState } from '@azure/core-lro';
|
||||
import { PagedAsyncIterableIterator } from '@azure/core-paging';
|
||||
import { PollerLike } from '@azure/core-lro';
|
||||
import { PollOperationState } from '@azure/core-lro';
|
||||
import { SimplePollerLike } from '@azure/core-lro';
|
||||
|
||||
// @public
|
||||
export interface AaaaRecord {
|
||||
|
@ -45,6 +45,22 @@ export interface CnameRecord {
|
|||
cname?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type CreatedByType = string;
|
||||
|
||||
// @public
|
||||
export interface DelegationSignerInfo {
|
||||
readonly digestAlgorithmType?: number;
|
||||
readonly digestValue?: string;
|
||||
readonly record?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Digest {
|
||||
algorithmType?: number;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export class DnsManagementClient extends coreClient.ServiceClient {
|
||||
// (undocumented)
|
||||
|
@ -55,6 +71,8 @@ export class DnsManagementClient extends coreClient.ServiceClient {
|
|||
// (undocumented)
|
||||
dnsResourceReferenceOperations: DnsResourceReferenceOperations;
|
||||
// (undocumented)
|
||||
dnssecConfigs: DnssecConfigs;
|
||||
// (undocumented)
|
||||
recordSets: RecordSets;
|
||||
// (undocumented)
|
||||
subscriptionId: string;
|
||||
|
@ -97,15 +115,111 @@ export interface DnsResourceReferenceResult {
|
|||
dnsResourceReferences?: DnsResourceReference[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DnssecConfig {
|
||||
etag?: string;
|
||||
readonly id?: string;
|
||||
readonly name?: string;
|
||||
readonly provisioningState?: string;
|
||||
readonly signingKeys?: SigningKey[];
|
||||
readonly systemData?: SystemData;
|
||||
readonly type?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DnssecConfigListResult {
|
||||
readonly nextLink?: string;
|
||||
value?: DnssecConfig[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DnssecConfigs {
|
||||
beginCreateOrUpdate(resourceGroupName: string, zoneName: string, options?: DnssecConfigsCreateOrUpdateOptionalParams): Promise<SimplePollerLike<OperationState<DnssecConfigsCreateOrUpdateResponse>, DnssecConfigsCreateOrUpdateResponse>>;
|
||||
beginCreateOrUpdateAndWait(resourceGroupName: string, zoneName: string, options?: DnssecConfigsCreateOrUpdateOptionalParams): Promise<DnssecConfigsCreateOrUpdateResponse>;
|
||||
beginDelete(resourceGroupName: string, zoneName: string, options?: DnssecConfigsDeleteOptionalParams): Promise<SimplePollerLike<OperationState<void>, void>>;
|
||||
beginDeleteAndWait(resourceGroupName: string, zoneName: string, options?: DnssecConfigsDeleteOptionalParams): Promise<void>;
|
||||
get(resourceGroupName: string, zoneName: string, options?: DnssecConfigsGetOptionalParams): Promise<DnssecConfigsGetResponse>;
|
||||
listByDnsZone(resourceGroupName: string, zoneName: string, options?: DnssecConfigsListByDnsZoneOptionalParams): PagedAsyncIterableIterator<DnssecConfig>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DnssecConfigsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
|
||||
ifMatch?: string;
|
||||
ifNoneMatch?: string;
|
||||
resumeFrom?: string;
|
||||
updateIntervalInMs?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DnssecConfigsCreateOrUpdateResponse = DnssecConfig;
|
||||
|
||||
// @public
|
||||
export interface DnssecConfigsDeleteHeaders {
|
||||
location?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DnssecConfigsDeleteOptionalParams extends coreClient.OperationOptions {
|
||||
ifMatch?: string;
|
||||
resumeFrom?: string;
|
||||
updateIntervalInMs?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DnssecConfigsGetOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DnssecConfigsGetResponse = DnssecConfig;
|
||||
|
||||
// @public
|
||||
export interface DnssecConfigsListByDnsZoneNextOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DnssecConfigsListByDnsZoneNextResponse = DnssecConfigListResult;
|
||||
|
||||
// @public
|
||||
export interface DnssecConfigsListByDnsZoneOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DnssecConfigsListByDnsZoneResponse = DnssecConfigListResult;
|
||||
|
||||
// @public
|
||||
export interface DsRecord {
|
||||
algorithm?: number;
|
||||
digest?: Digest;
|
||||
keyTag?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export function getContinuationToken(page: unknown): string | undefined;
|
||||
|
||||
// @public
|
||||
export enum KnownCreatedByType {
|
||||
Application = "Application",
|
||||
Key = "Key",
|
||||
ManagedIdentity = "ManagedIdentity",
|
||||
User = "User"
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface MxRecord {
|
||||
exchange?: string;
|
||||
preference?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface NaptrRecord {
|
||||
flags?: string;
|
||||
order?: number;
|
||||
preference?: number;
|
||||
regexp?: string;
|
||||
replacement?: string;
|
||||
services?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface NsRecord {
|
||||
nsdname?: string;
|
||||
|
@ -122,6 +236,7 @@ export interface RecordSet {
|
|||
aRecords?: ARecord[];
|
||||
caaRecords?: CaaRecord[];
|
||||
cnameRecord?: CnameRecord;
|
||||
dsRecords?: DsRecord[];
|
||||
etag?: string;
|
||||
readonly fqdn?: string;
|
||||
readonly id?: string;
|
||||
|
@ -130,12 +245,15 @@ export interface RecordSet {
|
|||
};
|
||||
mxRecords?: MxRecord[];
|
||||
readonly name?: string;
|
||||
naptrRecords?: NaptrRecord[];
|
||||
nsRecords?: NsRecord[];
|
||||
readonly provisioningState?: string;
|
||||
ptrRecords?: PtrRecord[];
|
||||
soaRecord?: SoaRecord;
|
||||
srvRecords?: SrvRecord[];
|
||||
targetResource?: SubResource;
|
||||
tlsaRecords?: TlsaRecord[];
|
||||
trafficManagementProfile?: SubResource;
|
||||
ttl?: number;
|
||||
txtRecords?: TxtRecord[];
|
||||
readonly type?: string;
|
||||
|
@ -181,8 +299,6 @@ export type RecordSetsGetResponse = RecordSet;
|
|||
|
||||
// @public
|
||||
export interface RecordSetsListAllByDnsZoneNextOptionalParams extends coreClient.OperationOptions {
|
||||
recordSetNameSuffix?: string;
|
||||
top?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
|
@ -199,8 +315,6 @@ export type RecordSetsListAllByDnsZoneResponse = RecordSetListResult;
|
|||
|
||||
// @public
|
||||
export interface RecordSetsListByDnsZoneNextOptionalParams extends coreClient.OperationOptions {
|
||||
recordsetnamesuffix?: string;
|
||||
top?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
|
@ -217,8 +331,6 @@ export type RecordSetsListByDnsZoneResponse = RecordSetListResult;
|
|||
|
||||
// @public
|
||||
export interface RecordSetsListByTypeNextOptionalParams extends coreClient.OperationOptions {
|
||||
recordsetnamesuffix?: string;
|
||||
top?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
|
@ -247,7 +359,7 @@ export interface RecordSetUpdateParameters {
|
|||
}
|
||||
|
||||
// @public
|
||||
export type RecordType = "A" | "AAAA" | "CAA" | "CNAME" | "MX" | "NS" | "PTR" | "SOA" | "SRV" | "TXT";
|
||||
export type RecordType = "A" | "AAAA" | "CAA" | "CNAME" | "MX" | "NS" | "PTR" | "SOA" | "SRV" | "TXT" | "TLSA" | "DS" | "NAPTR";
|
||||
|
||||
// @public
|
||||
export interface Resource {
|
||||
|
@ -260,6 +372,16 @@ export interface Resource {
|
|||
readonly type?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface SigningKey {
|
||||
readonly delegationSignerInfo?: DelegationSignerInfo[];
|
||||
readonly flags?: number;
|
||||
readonly keyTag?: number;
|
||||
readonly protocol?: number;
|
||||
readonly publicKey?: string;
|
||||
readonly securityAlgorithmType?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface SoaRecord {
|
||||
email?: string;
|
||||
|
@ -284,6 +406,24 @@ export interface SubResource {
|
|||
id?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface SystemData {
|
||||
createdAt?: Date;
|
||||
createdBy?: string;
|
||||
createdByType?: CreatedByType;
|
||||
lastModifiedAt?: Date;
|
||||
lastModifiedBy?: string;
|
||||
lastModifiedByType?: CreatedByType;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface TlsaRecord {
|
||||
certAssociationData?: string;
|
||||
matchingType?: number;
|
||||
selector?: number;
|
||||
usage?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface TxtRecord {
|
||||
value?: string[];
|
||||
|
@ -298,6 +438,8 @@ export interface Zone extends Resource {
|
|||
readonly numberOfRecordSets?: number;
|
||||
registrationVirtualNetworks?: SubResource[];
|
||||
resolutionVirtualNetworks?: SubResource[];
|
||||
readonly signingKeys?: SigningKey[];
|
||||
readonly systemData?: SystemData;
|
||||
zoneType?: ZoneType;
|
||||
}
|
||||
|
||||
|
@ -309,7 +451,7 @@ export interface ZoneListResult {
|
|||
|
||||
// @public
|
||||
export interface Zones {
|
||||
beginDelete(resourceGroupName: string, zoneName: string, options?: ZonesDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
|
||||
beginDelete(resourceGroupName: string, zoneName: string, options?: ZonesDeleteOptionalParams): Promise<SimplePollerLike<OperationState<void>, void>>;
|
||||
beginDeleteAndWait(resourceGroupName: string, zoneName: string, options?: ZonesDeleteOptionalParams): Promise<void>;
|
||||
createOrUpdate(resourceGroupName: string, zoneName: string, parameters: Zone, options?: ZonesCreateOrUpdateOptionalParams): Promise<ZonesCreateOrUpdateResponse>;
|
||||
get(resourceGroupName: string, zoneName: string, options?: ZonesGetOptionalParams): Promise<ZonesGetResponse>;
|
||||
|
@ -327,6 +469,11 @@ export interface ZonesCreateOrUpdateOptionalParams extends coreClient.OperationO
|
|||
// @public
|
||||
export type ZonesCreateOrUpdateResponse = Zone;
|
||||
|
||||
// @public
|
||||
export interface ZonesDeleteHeaders {
|
||||
location?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ZonesDeleteOptionalParams extends coreClient.OperationOptions {
|
||||
ifMatch?: string;
|
||||
|
@ -343,7 +490,6 @@ export type ZonesGetResponse = Zone;
|
|||
|
||||
// @public
|
||||
export interface ZonesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
|
||||
top?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
|
@ -359,7 +505,6 @@ export type ZonesListByResourceGroupResponse = ZoneListResult;
|
|||
|
||||
// @public
|
||||
export interface ZonesListNextOptionalParams extends coreClient.OperationOptions {
|
||||
top?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
|
|
|
@ -10,32 +10,39 @@
|
|||
// Licensed under the MIT License.
|
||||
import {
|
||||
DnsResourceReferenceRequest,
|
||||
DnsManagementClient
|
||||
DnsManagementClient,
|
||||
} from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Returns the DNS records specified by the referencing targetResourceIds.
|
||||
*
|
||||
* @summary Returns the DNS records specified by the referencing targetResourceIds.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetDnsResourceReference.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnsResourceReference.json
|
||||
*/
|
||||
async function listZonesByResourceGroup() {
|
||||
const subscriptionId = "subid";
|
||||
async function getDnsResourceReference() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const parameters: DnsResourceReferenceRequest = {
|
||||
targetResources: [
|
||||
{
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/trafficManagerProfiles/testpp2"
|
||||
}
|
||||
]
|
||||
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/trafficManagerProfiles/testpp2",
|
||||
},
|
||||
],
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnsResourceReferenceOperations.getByTargetResources(
|
||||
parameters
|
||||
);
|
||||
const result =
|
||||
await client.dnsResourceReferenceOperations.getByTargetResources(
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
listZonesByResourceGroup().catch(console.error);
|
||||
async function main() {
|
||||
getDnsResourceReference();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates the DNSSEC configuration on a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates the DNSSEC configuration on a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDnssecConfig.json
|
||||
*/
|
||||
async function createDnssecConfig() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnssecConfigs.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createDnssecConfig();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDnssecConfig.json
|
||||
*/
|
||||
async function deleteDnssecConfig() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnssecConfigs.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteDnssecConfig();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the DNSSEC configuration.
|
||||
*
|
||||
* @summary Gets the DNSSEC configuration.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnssecConfig.json
|
||||
*/
|
||||
async function getDnssecConfig() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnssecConfigs.get(resourceGroupName, zoneName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getDnssecConfig();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the DNSSEC configurations in a DNS zone.
|
||||
*
|
||||
* @summary Lists the DNSSEC configurations in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDnssecConfigsByZone.json
|
||||
*/
|
||||
async function listDnssecConfigs() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.dnssecConfigs.listByDnsZone(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listDnssecConfigs();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,23 +10,26 @@
|
|||
// Licensed under the MIT License.
|
||||
import { RecordSet, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordset.json
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordset.json
|
||||
*/
|
||||
async function createARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const parameters: RecordSet = {
|
||||
aRecords: [{ ipv4Address: "127.0.0.1" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -35,22 +38,20 @@ async function createARecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createARecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordsetAlias.json
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordsetAlias.json
|
||||
*/
|
||||
async function createARecordsetWithAliasTargetResource() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
|
@ -58,9 +59,8 @@ async function createARecordsetWithAliasTargetResource() {
|
|||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
targetResource: {
|
||||
id:
|
||||
"/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"
|
||||
}
|
||||
id: "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2",
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -69,29 +69,58 @@ async function createARecordsetWithAliasTargetResource() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createARecordsetWithAliasTargetResource().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordSetTrafficManagementProfile.json
|
||||
*/
|
||||
async function createARecordsetWithTrafficManagementProfile() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const parameters: RecordSet = {
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
trafficManagementProfile: {
|
||||
id: "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2",
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateAAAARecordset.json
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateAAAARecordset.json
|
||||
*/
|
||||
async function createAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
const parameters: RecordSet = {
|
||||
aaaaRecords: [{ ipv6Address: "::1" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -100,29 +129,27 @@ async function createAaaaRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createAaaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCaaRecordset.json
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCaaRecordset.json
|
||||
*/
|
||||
async function createCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
const parameters: RecordSet = {
|
||||
ttl: 3600,
|
||||
caaRecords: [{ flags: 0, tag: "issue", value: "ca.contoso.com" }],
|
||||
metadata: { key1: "value1" }
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -131,29 +158,27 @@ async function createCaaRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createCaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCNAMERecordset.json
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCNAMERecordset.json
|
||||
*/
|
||||
async function createCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
const parameters: RecordSet = {
|
||||
cnameRecord: { cname: "contoso.com" },
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -162,29 +187,65 @@ async function createCnameRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createCnameRecordset().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDSRecordset.json
|
||||
*/
|
||||
async function createDsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "DS";
|
||||
const parameters: RecordSet = {
|
||||
dsRecords: [
|
||||
{
|
||||
algorithm: 5,
|
||||
digest: {
|
||||
algorithmType: 1,
|
||||
value: "2BB183AF5F22588179A53B0A98631FAD1A292118",
|
||||
},
|
||||
keyTag: 60485,
|
||||
},
|
||||
],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateMXRecordset.json
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateMXRecordset.json
|
||||
*/
|
||||
async function createMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
const parameters: RecordSet = {
|
||||
mxRecords: [{ exchange: "mail.contoso.com", preference: 0 }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -193,29 +254,65 @@ async function createMxRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createMxRecordset().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNAPTRRecordset.json
|
||||
*/
|
||||
async function createNaptrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NAPTR";
|
||||
const parameters: RecordSet = {
|
||||
naptrRecords: [
|
||||
{
|
||||
flags: "U",
|
||||
order: 100,
|
||||
preference: 10,
|
||||
regexp: "!^.*$!sip:user@example.com!",
|
||||
replacement: "",
|
||||
services: "E2U+sip",
|
||||
},
|
||||
],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateNSRecordset.json
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNSRecordset.json
|
||||
*/
|
||||
async function createNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
const parameters: RecordSet = {
|
||||
nsRecords: [{ nsdname: "ns1.contoso.com" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -224,29 +321,27 @@ async function createNsRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createNsRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdatePTRRecordset.json
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdatePTRRecordset.json
|
||||
*/
|
||||
async function createPtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
const parameters: RecordSet = {
|
||||
ptrRecords: [{ ptrdname: "localhost" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -255,22 +350,20 @@ async function createPtrRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createPtrRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSOARecordset.json
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSOARecordset.json
|
||||
*/
|
||||
async function createSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
|
@ -282,10 +375,10 @@ async function createSoaRecordset() {
|
|||
minimumTtl: 300,
|
||||
refreshTime: 3600,
|
||||
retryTime: 300,
|
||||
serialNumber: 1
|
||||
serialNumber: 1,
|
||||
},
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -294,29 +387,27 @@ async function createSoaRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createSoaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSRVRecordset.json
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSRVRecordset.json
|
||||
*/
|
||||
async function createSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
const parameters: RecordSet = {
|
||||
srvRecords: [{ port: 80, priority: 0, target: "contoso.com", weight: 10 }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -325,29 +416,64 @@ async function createSrvRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createSrvRecordset().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTLSARecordset.json
|
||||
*/
|
||||
async function createTlsaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TLSA";
|
||||
const parameters: RecordSet = {
|
||||
tlsaRecords: [
|
||||
{
|
||||
certAssociationData:
|
||||
"6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B",
|
||||
matchingType: 1,
|
||||
selector: 1,
|
||||
usage: 3,
|
||||
},
|
||||
],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateTXTRecordset.json
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTXTRecordset.json
|
||||
*/
|
||||
async function createTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
const parameters: RecordSet = {
|
||||
ttl: 3600,
|
||||
txtRecords: [{ value: ["string1", "string2"] }],
|
||||
metadata: { key1: "value1" }
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -356,9 +482,27 @@ async function createTxtRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createTxtRecordset().catch(console.error);
|
||||
async function main() {
|
||||
createARecordset();
|
||||
createARecordsetWithAliasTargetResource();
|
||||
createARecordsetWithTrafficManagementProfile();
|
||||
createAaaaRecordset();
|
||||
createCaaRecordset();
|
||||
createCnameRecordset();
|
||||
createDsRecordset();
|
||||
createMxRecordset();
|
||||
createNaptrRecordset();
|
||||
createNsRecordset();
|
||||
createPtrRecordset();
|
||||
createSoaRecordset();
|
||||
createSrvRecordset();
|
||||
createTlsaRecordset();
|
||||
createTxtRecordset();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteARecordset.json
|
||||
*/
|
||||
async function deleteARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
|
@ -29,22 +32,20 @@ async function deleteARecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteARecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteAAAARecordset.json
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteAAAARecordset.json
|
||||
*/
|
||||
async function deleteAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
|
@ -54,22 +55,20 @@ async function deleteAaaaRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteAaaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteCaaRecordset.json
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCaaRecordset.json
|
||||
*/
|
||||
async function deleteCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
|
@ -79,97 +78,135 @@ async function deleteCaaRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteCaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCNAMERecordset.json
|
||||
*/
|
||||
async function deleteCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const recordType = "CNAME";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteCnameRecordset().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDSRecordset.json
|
||||
*/
|
||||
async function deleteDsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "DS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteMXRecordset.json
|
||||
*/
|
||||
async function deleteMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const recordType = "MX";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteMxRecordset().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNAPTRRecordset.json
|
||||
*/
|
||||
async function deleteNaptrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NAPTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNSRecordset.json
|
||||
*/
|
||||
async function deleteNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const recordType = "NS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteNsRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeletePTRRecordset.json
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeletePTRRecordset.json
|
||||
*/
|
||||
async function deletePtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
|
@ -179,22 +216,20 @@ async function deletePtrRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deletePtrRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteSRVRecordset.json
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteSRVRecordset.json
|
||||
*/
|
||||
async function deleteSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
|
@ -204,22 +239,43 @@ async function deleteSrvRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteSrvRecordset().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTLSARecordset.json
|
||||
*/
|
||||
async function deleteTlsaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TLSA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteTXTRecordset.json
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTXTRecordset.json
|
||||
*/
|
||||
async function deleteTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
|
@ -229,9 +285,24 @@ async function deleteTxtRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteTxtRecordset().catch(console.error);
|
||||
async function main() {
|
||||
deleteARecordset();
|
||||
deleteAaaaRecordset();
|
||||
deleteCaaRecordset();
|
||||
deleteCnameRecordset();
|
||||
deleteDsRecordset();
|
||||
deleteMxRecordset();
|
||||
deleteNaptrRecordset();
|
||||
deleteNsRecordset();
|
||||
deletePtrRecordset();
|
||||
deleteSrvRecordset();
|
||||
deleteTlsaRecordset();
|
||||
deleteTxtRecordset();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetARecordset.json
|
||||
*/
|
||||
async function getARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
|
@ -29,22 +32,20 @@ async function getARecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getARecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetAAAARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetAAAARecordset.json
|
||||
*/
|
||||
async function getAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
|
@ -54,22 +55,20 @@ async function getAaaaRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getAaaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetCaaRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCaaRecordset.json
|
||||
*/
|
||||
async function getCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
|
@ -79,22 +78,20 @@ async function getCaaRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getCaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetCNAMERecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCNAMERecordset.json
|
||||
*/
|
||||
async function getCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
|
@ -104,22 +101,43 @@ async function getCnameRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getCnameRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetMXRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDSRecordset.json
|
||||
*/
|
||||
async function getDsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "DS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetMXRecordset.json
|
||||
*/
|
||||
async function getMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
|
@ -129,22 +147,43 @@ async function getMxRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getMxRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetNSRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNAPTRRecordset.json
|
||||
*/
|
||||
async function getNaptrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NAPTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNSRecordset.json
|
||||
*/
|
||||
async function getNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
|
@ -154,22 +193,20 @@ async function getNsRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getNsRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetPTRRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetPTRRecordset.json
|
||||
*/
|
||||
async function getPtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
|
@ -179,22 +216,20 @@ async function getPtrRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getPtrRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetSOARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSOARecordset.json
|
||||
*/
|
||||
async function getSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
|
@ -204,22 +239,20 @@ async function getSoaRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getSoaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetSRVRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSRVRecordset.json
|
||||
*/
|
||||
async function getSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
|
@ -229,22 +262,43 @@ async function getSrvRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getSrvRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetTXTRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTLSARecordset.json
|
||||
*/
|
||||
async function getTlsaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TLSA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTXTRecordset.json
|
||||
*/
|
||||
async function getTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
|
@ -254,9 +308,25 @@ async function getTxtRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getTxtRecordset().catch(console.error);
|
||||
async function main() {
|
||||
getARecordset();
|
||||
getAaaaRecordset();
|
||||
getCaaRecordset();
|
||||
getCnameRecordset();
|
||||
getDsRecordset();
|
||||
getMxRecordset();
|
||||
getNaptrRecordset();
|
||||
getNsRecordset();
|
||||
getPtrRecordset();
|
||||
getSoaRecordset();
|
||||
getSrvRecordset();
|
||||
getTlsaRecordset();
|
||||
getTxtRecordset();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -10,27 +10,34 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists all record sets in a DNS zone.
|
||||
*
|
||||
* @summary Lists all record sets in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListRecordSetsByZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json
|
||||
*/
|
||||
async function listRecordsetsByZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
async function listAllRecordsetsByZone() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listAllByDnsZone(
|
||||
resourceGroupName,
|
||||
zoneName
|
||||
zoneName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listRecordsetsByZone().catch(console.error);
|
||||
async function main() {
|
||||
listAllRecordsetsByZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -10,27 +10,34 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists all record sets in a DNS zone.
|
||||
*
|
||||
* @summary Lists all record sets in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListRecordSetsByZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json
|
||||
*/
|
||||
async function listRecordsetsByZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listByDnsZone(
|
||||
resourceGroupName,
|
||||
zoneName
|
||||
zoneName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listRecordsetsByZone().catch(console.error);
|
||||
async function main() {
|
||||
listRecordsetsByZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListARecordset.json
|
||||
*/
|
||||
async function listARecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -28,24 +31,22 @@ async function listARecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listARecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListAAAARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListAAAARecordset.json
|
||||
*/
|
||||
async function listAaaaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "AAAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -54,24 +55,22 @@ async function listAaaaRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listAaaaRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCaaRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCaaRecordset.json
|
||||
*/
|
||||
async function listCaaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "CAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -80,24 +79,22 @@ async function listCaaRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCaaRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCNAMERecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCNAMERecordset.json
|
||||
*/
|
||||
async function listCnameRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "CNAME";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -106,24 +103,46 @@ async function listCnameRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCnameRecordsets().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDSRecordset.json
|
||||
*/
|
||||
async function listDsRecordsets() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "DS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListMXRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListMXRecordset.json
|
||||
*/
|
||||
async function listMxRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "MX";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -132,24 +151,46 @@ async function listMxRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listMxRecordsets().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNAPTRRecordset.json
|
||||
*/
|
||||
async function listNaptrRecordsets() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "NAPTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListNSRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNSRecordset.json
|
||||
*/
|
||||
async function listNsRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "NS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -158,24 +199,22 @@ async function listNsRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listNsRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListPTRRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListPTRRecordset.json
|
||||
*/
|
||||
async function listPtrRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const recordType = "PTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -184,24 +223,22 @@ async function listPtrRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listPtrRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSOARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSOARecordset.json
|
||||
*/
|
||||
async function listSoaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "SOA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -210,24 +247,22 @@ async function listSoaRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listSoaRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSRVRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSRVRecordset.json
|
||||
*/
|
||||
async function listSrvRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "SRV";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -236,24 +271,46 @@ async function listSrvRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listSrvRecordsets().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTLSARecordset.json
|
||||
*/
|
||||
async function listTlsaRecordsets() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "TLSA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListTXTRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTXTRecordset.json
|
||||
*/
|
||||
async function listTxtRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "TXT";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -262,11 +319,27 @@ async function listTxtRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listTxtRecordsets().catch(console.error);
|
||||
async function main() {
|
||||
listARecordsets();
|
||||
listAaaaRecordsets();
|
||||
listCaaRecordsets();
|
||||
listCnameRecordsets();
|
||||
listDsRecordsets();
|
||||
listMxRecordsets();
|
||||
listNaptrRecordsets();
|
||||
listNsRecordsets();
|
||||
listPtrRecordsets();
|
||||
listSoaRecordsets();
|
||||
listSrvRecordsets();
|
||||
listTlsaRecordsets();
|
||||
listTxtRecordsets();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { RecordSet, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchARecordset.json
|
||||
*/
|
||||
async function patchARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
|
@ -31,22 +34,20 @@ async function patchARecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchARecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchAAAARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchAAAARecordset.json
|
||||
*/
|
||||
async function patchAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
|
@ -58,22 +59,20 @@ async function patchAaaaRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchAaaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchCaaRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCaaRecordset.json
|
||||
*/
|
||||
async function patchCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
|
@ -85,22 +84,20 @@ async function patchCaaRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchCaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchCNAMERecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCNAMERecordset.json
|
||||
*/
|
||||
async function patchCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
|
@ -112,22 +109,45 @@ async function patchCnameRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchCnameRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchMXRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchDSRecordset.json
|
||||
*/
|
||||
async function patchDsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "DS";
|
||||
const parameters: RecordSet = { metadata: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchMXRecordset.json
|
||||
*/
|
||||
async function patchMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
|
@ -139,22 +159,45 @@ async function patchMxRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchMxRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchNSRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNAPTRRecordset.json
|
||||
*/
|
||||
async function patchNaptrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NAPTR";
|
||||
const parameters: RecordSet = { metadata: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNSRecordset.json
|
||||
*/
|
||||
async function patchNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
|
@ -166,22 +209,20 @@ async function patchNsRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchNsRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchPTRRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchPTRRecordset.json
|
||||
*/
|
||||
async function patchPtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
|
@ -193,22 +234,20 @@ async function patchPtrRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchPtrRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchSOARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSOARecordset.json
|
||||
*/
|
||||
async function patchSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
|
@ -220,22 +259,20 @@ async function patchSoaRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchSoaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchSRVRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSRVRecordset.json
|
||||
*/
|
||||
async function patchSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
|
@ -247,22 +284,45 @@ async function patchSrvRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchSrvRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchTXTRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTLSARecordset.json
|
||||
*/
|
||||
async function patchTlsaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TLSA";
|
||||
const parameters: RecordSet = { metadata: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTXTRecordset.json
|
||||
*/
|
||||
async function patchTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
|
@ -274,9 +334,25 @@ async function patchTxtRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchTxtRecordset().catch(console.error);
|
||||
async function main() {
|
||||
patchARecordset();
|
||||
patchAaaaRecordset();
|
||||
patchCaaRecordset();
|
||||
patchCnameRecordset();
|
||||
patchDsRecordset();
|
||||
patchMxRecordset();
|
||||
patchNaptrRecordset();
|
||||
patchNsRecordset();
|
||||
patchPtrRecordset();
|
||||
patchSoaRecordset();
|
||||
patchSrvRecordset();
|
||||
patchTlsaRecordset();
|
||||
patchTxtRecordset();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { Zone, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a DNS zone. Does not modify DNS records within the zone.
|
||||
*
|
||||
* @summary Creates or updates a DNS zone. Does not modify DNS records within the zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateZone.json
|
||||
*/
|
||||
async function createZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const parameters: Zone = { location: "Global", tags: { key1: "value1" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -27,9 +30,13 @@ async function createZone() {
|
|||
const result = await client.zones.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createZone().catch(console.error);
|
||||
async function main() {
|
||||
createZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -10,24 +10,31 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteZone.json
|
||||
*/
|
||||
async function deleteZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
zoneName
|
||||
zoneName,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteZone().catch(console.error);
|
||||
async function main() {
|
||||
deleteZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.
|
||||
*
|
||||
* @summary Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetZone.json
|
||||
*/
|
||||
async function getZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -27,4 +30,8 @@ async function getZone() {
|
|||
console.log(result);
|
||||
}
|
||||
|
||||
getZone().catch(console.error);
|
||||
async function main() {
|
||||
getZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the DNS zones within a resource group.
|
||||
*
|
||||
* @summary Lists the DNS zones within a resource group.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListZonesByResourceGroup.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesByResourceGroup.json
|
||||
*/
|
||||
async function listZonesByResourceGroup() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
|
@ -29,4 +32,8 @@ async function listZonesByResourceGroup() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listZonesByResourceGroup().catch(console.error);
|
||||
async function main() {
|
||||
listZonesByResourceGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -10,15 +10,18 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the DNS zones in all resource groups in a subscription.
|
||||
*
|
||||
* @summary Lists the DNS zones in all resource groups in a subscription.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListZonesBySubscription.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesBySubscription.json
|
||||
*/
|
||||
async function listZonesBySubscription() {
|
||||
const subscriptionId = "subid";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
|
@ -28,4 +31,8 @@ async function listZonesBySubscription() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listZonesBySubscription().catch(console.error);
|
||||
async function main() {
|
||||
listZonesBySubscription();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { ZoneUpdate, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a DNS zone. Does not modify DNS records within the zone.
|
||||
*
|
||||
* @summary Updates a DNS zone. Does not modify DNS records within the zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchZone.json
|
||||
*/
|
||||
async function patchZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const parameters: ZoneUpdate = { tags: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -27,9 +30,13 @@ async function patchZone() {
|
|||
const result = await client.zones.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchZone().catch(console.error);
|
||||
async function main() {
|
||||
patchZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
# client library samples for JavaScript (Beta)
|
||||
|
||||
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
|
||||
|
||||
| **File Name** | **Description** |
|
||||
| --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [dnsResourceReferenceGetByTargetResourcesSample.js][dnsresourcereferencegetbytargetresourcessample] | Returns the DNS records specified by the referencing targetResourceIds. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnsResourceReference.json |
|
||||
| [dnssecConfigsCreateOrUpdateSample.js][dnssecconfigscreateorupdatesample] | Creates or updates the DNSSEC configuration on a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDnssecConfig.json |
|
||||
| [dnssecConfigsDeleteSample.js][dnssecconfigsdeletesample] | Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDnssecConfig.json |
|
||||
| [dnssecConfigsGetSample.js][dnssecconfigsgetsample] | Gets the DNSSEC configuration. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnssecConfig.json |
|
||||
| [dnssecConfigsListByDnsZoneSample.js][dnssecconfigslistbydnszonesample] | Lists the DNSSEC configurations in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDnssecConfigsByZone.json |
|
||||
| [recordSetsCreateOrUpdateSample.js][recordsetscreateorupdatesample] | Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created). x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordset.json |
|
||||
| [recordSetsDeleteSample.js][recordsetsdeletesample] | Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteARecordset.json |
|
||||
| [recordSetsGetSample.js][recordsetsgetsample] | Gets a record set. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetARecordset.json |
|
||||
| [recordSetsListAllByDnsZoneSample.js][recordsetslistallbydnszonesample] | Lists all record sets in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json |
|
||||
| [recordSetsListByDnsZoneSample.js][recordsetslistbydnszonesample] | Lists all record sets in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json |
|
||||
| [recordSetsListByTypeSample.js][recordsetslistbytypesample] | Lists the record sets of a specified type in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListARecordset.json |
|
||||
| [recordSetsUpdateSample.js][recordsetsupdatesample] | Updates a record set within a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchARecordset.json |
|
||||
| [zonesCreateOrUpdateSample.js][zonescreateorupdatesample] | Creates or updates a DNS zone. Does not modify DNS records within the zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateZone.json |
|
||||
| [zonesDeleteSample.js][zonesdeletesample] | Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteZone.json |
|
||||
| [zonesGetSample.js][zonesgetsample] | Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetZone.json |
|
||||
| [zonesListByResourceGroupSample.js][zoneslistbyresourcegroupsample] | Lists the DNS zones within a resource group. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesByResourceGroup.json |
|
||||
| [zonesListSample.js][zoneslistsample] | Lists the DNS zones in all resource groups in a subscription. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesBySubscription.json |
|
||||
| [zonesUpdateSample.js][zonesupdatesample] | Updates a DNS zone. Does not modify DNS records within the zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchZone.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
|
||||
|
||||
You need [an Azure subscription][freesub] to run these sample programs.
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node dnsResourceReferenceGetByTargetResourcesSample.js
|
||||
```
|
||||
|
||||
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
|
||||
|
||||
```bash
|
||||
npx cross-env DNS_SUBSCRIPTION_ID="<dns subscription id>" node dnsResourceReferenceGetByTargetResourcesSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[dnsresourcereferencegetbytargetresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/dnsResourceReferenceGetByTargetResourcesSample.js
|
||||
[dnssecconfigscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/dnssecConfigsCreateOrUpdateSample.js
|
||||
[dnssecconfigsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/dnssecConfigsDeleteSample.js
|
||||
[dnssecconfigsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/dnssecConfigsGetSample.js
|
||||
[dnssecconfigslistbydnszonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/dnssecConfigsListByDnsZoneSample.js
|
||||
[recordsetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/recordSetsCreateOrUpdateSample.js
|
||||
[recordsetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/recordSetsDeleteSample.js
|
||||
[recordsetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/recordSetsGetSample.js
|
||||
[recordsetslistallbydnszonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/recordSetsListAllByDnsZoneSample.js
|
||||
[recordsetslistbydnszonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/recordSetsListByDnsZoneSample.js
|
||||
[recordsetslistbytypesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/recordSetsListByTypeSample.js
|
||||
[recordsetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/recordSetsUpdateSample.js
|
||||
[zonescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/zonesCreateOrUpdateSample.js
|
||||
[zonesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/zonesDeleteSample.js
|
||||
[zonesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/zonesGetSample.js
|
||||
[zoneslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/zonesListByResourceGroupSample.js
|
||||
[zoneslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/zonesListSample.js
|
||||
[zonesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/javascript/zonesUpdateSample.js
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-dns?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns/README.md
|
|
@ -10,15 +10,16 @@
|
|||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Returns the DNS records specified by the referencing targetResourceIds.
|
||||
*
|
||||
* @summary Returns the DNS records specified by the referencing targetResourceIds.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetDnsResourceReference.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnsResourceReference.json
|
||||
*/
|
||||
async function listZonesByResourceGroup() {
|
||||
const subscriptionId = "subid";
|
||||
async function getDnsResourceReference() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const parameters = {
|
||||
targetResources: [
|
||||
{
|
||||
|
@ -32,4 +33,8 @@ async function listZonesByResourceGroup() {
|
|||
console.log(result);
|
||||
}
|
||||
|
||||
listZonesByResourceGroup().catch(console.error);
|
||||
async function main() {
|
||||
getDnsResourceReference();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates the DNSSEC configuration on a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates the DNSSEC configuration on a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDnssecConfig.json
|
||||
*/
|
||||
async function createDnssecConfig() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnssecConfigs.beginCreateOrUpdateAndWait(resourceGroupName, zoneName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createDnssecConfig();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDnssecConfig.json
|
||||
*/
|
||||
async function deleteDnssecConfig() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnssecConfigs.beginDeleteAndWait(resourceGroupName, zoneName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteDnssecConfig();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the DNSSEC configuration.
|
||||
*
|
||||
* @summary Gets the DNSSEC configuration.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnssecConfig.json
|
||||
*/
|
||||
async function getDnssecConfig() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnssecConfigs.get(resourceGroupName, zoneName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getDnssecConfig();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the DNSSEC configurations in a DNS zone.
|
||||
*
|
||||
* @summary Lists the DNSSEC configurations in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDnssecConfigsByZone.json
|
||||
*/
|
||||
async function listDnssecConfigs() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.dnssecConfigs.listByDnsZone(resourceGroupName, zoneName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listDnssecConfigs();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-dns-js",
|
||||
"name": "@azure-samples/arm-dns-js-beta",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for JavaScript",
|
||||
"description": " client library samples for JavaScript (Beta)",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
|
@ -25,7 +25,7 @@
|
|||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns",
|
||||
"dependencies": {
|
||||
"@azure/arm-dns": "latest",
|
||||
"@azure/arm-dns": "next",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^4.2.1"
|
||||
}
|
|
@ -0,0 +1,505 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordset.json
|
||||
*/
|
||||
async function createARecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const parameters = {
|
||||
aRecords: [{ ipv4Address: "127.0.0.1" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordsetAlias.json
|
||||
*/
|
||||
async function createARecordsetWithAliasTargetResource() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const parameters = {
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
targetResource: {
|
||||
id: "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2",
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordSetTrafficManagementProfile.json
|
||||
*/
|
||||
async function createARecordsetWithTrafficManagementProfile() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const parameters = {
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
trafficManagementProfile: {
|
||||
id: "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2",
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateAAAARecordset.json
|
||||
*/
|
||||
async function createAaaaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
const parameters = {
|
||||
aaaaRecords: [{ ipv6Address: "::1" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCaaRecordset.json
|
||||
*/
|
||||
async function createCaaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
const parameters = {
|
||||
ttl: 3600,
|
||||
caaRecords: [{ flags: 0, tag: "issue", value: "ca.contoso.com" }],
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCNAMERecordset.json
|
||||
*/
|
||||
async function createCnameRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
const parameters = {
|
||||
cnameRecord: { cname: "contoso.com" },
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDSRecordset.json
|
||||
*/
|
||||
async function createDsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "DS";
|
||||
const parameters = {
|
||||
dsRecords: [
|
||||
{
|
||||
algorithm: 5,
|
||||
digest: {
|
||||
algorithmType: 1,
|
||||
value: "2BB183AF5F22588179A53B0A98631FAD1A292118",
|
||||
},
|
||||
keyTag: 60485,
|
||||
},
|
||||
],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateMXRecordset.json
|
||||
*/
|
||||
async function createMxRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
const parameters = {
|
||||
mxRecords: [{ exchange: "mail.contoso.com", preference: 0 }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNAPTRRecordset.json
|
||||
*/
|
||||
async function createNaptrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NAPTR";
|
||||
const parameters = {
|
||||
naptrRecords: [
|
||||
{
|
||||
flags: "U",
|
||||
order: 100,
|
||||
preference: 10,
|
||||
regexp: "!^.*$!sip:user@example.com!",
|
||||
replacement: "",
|
||||
services: "E2U+sip",
|
||||
},
|
||||
],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNSRecordset.json
|
||||
*/
|
||||
async function createNsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
const parameters = {
|
||||
nsRecords: [{ nsdname: "ns1.contoso.com" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdatePTRRecordset.json
|
||||
*/
|
||||
async function createPtrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
const parameters = {
|
||||
ptrRecords: [{ ptrdname: "localhost" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSOARecordset.json
|
||||
*/
|
||||
async function createSoaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
const parameters = {
|
||||
soaRecord: {
|
||||
email: "hostmaster.contoso.com",
|
||||
expireTime: 2419200,
|
||||
host: "ns1.contoso.com",
|
||||
minimumTtl: 300,
|
||||
refreshTime: 3600,
|
||||
retryTime: 300,
|
||||
serialNumber: 1,
|
||||
},
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSRVRecordset.json
|
||||
*/
|
||||
async function createSrvRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
const parameters = {
|
||||
srvRecords: [{ port: 80, priority: 0, target: "contoso.com", weight: 10 }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTLSARecordset.json
|
||||
*/
|
||||
async function createTlsaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TLSA";
|
||||
const parameters = {
|
||||
tlsaRecords: [
|
||||
{
|
||||
certAssociationData: "6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B",
|
||||
matchingType: 1,
|
||||
selector: 1,
|
||||
usage: 3,
|
||||
},
|
||||
],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTXTRecordset.json
|
||||
*/
|
||||
async function createTxtRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
const parameters = {
|
||||
ttl: 3600,
|
||||
txtRecords: [{ value: ["string1", "string2"] }],
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createARecordset();
|
||||
createARecordsetWithAliasTargetResource();
|
||||
createARecordsetWithTrafficManagementProfile();
|
||||
createAaaaRecordset();
|
||||
createCaaRecordset();
|
||||
createCnameRecordset();
|
||||
createDsRecordset();
|
||||
createMxRecordset();
|
||||
createNaptrRecordset();
|
||||
createNsRecordset();
|
||||
createPtrRecordset();
|
||||
createSoaRecordset();
|
||||
createSrvRecordset();
|
||||
createTlsaRecordset();
|
||||
createTxtRecordset();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,306 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteARecordset.json
|
||||
*/
|
||||
async function deleteARecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteAAAARecordset.json
|
||||
*/
|
||||
async function deleteAaaaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCaaRecordset.json
|
||||
*/
|
||||
async function deleteCaaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCNAMERecordset.json
|
||||
*/
|
||||
async function deleteCnameRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDSRecordset.json
|
||||
*/
|
||||
async function deleteDsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "DS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteMXRecordset.json
|
||||
*/
|
||||
async function deleteMxRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNAPTRRecordset.json
|
||||
*/
|
||||
async function deleteNaptrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NAPTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNSRecordset.json
|
||||
*/
|
||||
async function deleteNsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeletePTRRecordset.json
|
||||
*/
|
||||
async function deletePtrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteSRVRecordset.json
|
||||
*/
|
||||
async function deleteSrvRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTLSARecordset.json
|
||||
*/
|
||||
async function deleteTlsaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TLSA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTXTRecordset.json
|
||||
*/
|
||||
async function deleteTxtRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteARecordset();
|
||||
deleteAaaaRecordset();
|
||||
deleteCaaRecordset();
|
||||
deleteCnameRecordset();
|
||||
deleteDsRecordset();
|
||||
deleteMxRecordset();
|
||||
deleteNaptrRecordset();
|
||||
deleteNsRecordset();
|
||||
deletePtrRecordset();
|
||||
deleteSrvRecordset();
|
||||
deleteTlsaRecordset();
|
||||
deleteTxtRecordset();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,17 @@
|
|||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetARecordset.json
|
||||
*/
|
||||
async function getARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
|
@ -29,22 +30,20 @@ async function getARecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getARecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetAAAARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetAAAARecordset.json
|
||||
*/
|
||||
async function getAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
|
@ -54,22 +53,20 @@ async function getAaaaRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getAaaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetCaaRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCaaRecordset.json
|
||||
*/
|
||||
async function getCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
|
@ -79,22 +76,20 @@ async function getCaaRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getCaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetCNAMERecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCNAMERecordset.json
|
||||
*/
|
||||
async function getCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
|
@ -104,22 +99,43 @@ async function getCnameRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getCnameRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetMXRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDSRecordset.json
|
||||
*/
|
||||
async function getDsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "DS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetMXRecordset.json
|
||||
*/
|
||||
async function getMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
|
@ -129,22 +145,43 @@ async function getMxRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getMxRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetNSRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNAPTRRecordset.json
|
||||
*/
|
||||
async function getNaptrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NAPTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNSRecordset.json
|
||||
*/
|
||||
async function getNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
|
@ -154,22 +191,20 @@ async function getNsRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getNsRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetPTRRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetPTRRecordset.json
|
||||
*/
|
||||
async function getPtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
|
@ -179,22 +214,20 @@ async function getPtrRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getPtrRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetSOARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSOARecordset.json
|
||||
*/
|
||||
async function getSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
|
@ -204,22 +237,20 @@ async function getSoaRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getSoaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetSRVRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSRVRecordset.json
|
||||
*/
|
||||
async function getSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
|
@ -229,22 +260,43 @@ async function getSrvRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getSrvRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetTXTRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTLSARecordset.json
|
||||
*/
|
||||
async function getTlsaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TLSA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTXTRecordset.json
|
||||
*/
|
||||
async function getTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
|
@ -254,9 +306,25 @@ async function getTxtRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getTxtRecordset().catch(console.error);
|
||||
async function main() {
|
||||
getARecordset();
|
||||
getAaaaRecordset();
|
||||
getCaaRecordset();
|
||||
getCnameRecordset();
|
||||
getDsRecordset();
|
||||
getMxRecordset();
|
||||
getNaptrRecordset();
|
||||
getNsRecordset();
|
||||
getPtrRecordset();
|
||||
getSoaRecordset();
|
||||
getSrvRecordset();
|
||||
getTlsaRecordset();
|
||||
getTxtRecordset();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,17 @@
|
|||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists all record sets in a DNS zone.
|
||||
*
|
||||
* @summary Lists all record sets in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListRecordSetsByZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json
|
||||
*/
|
||||
async function listRecordsetsByZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
async function listAllRecordsetsByZone() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -30,4 +31,8 @@ async function listRecordsetsByZone() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listRecordsetsByZone().catch(console.error);
|
||||
async function main() {
|
||||
listAllRecordsetsByZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,17 @@
|
|||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists all record sets in a DNS zone.
|
||||
*
|
||||
* @summary Lists all record sets in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListRecordSetsByZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json
|
||||
*/
|
||||
async function listRecordsetsByZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -30,4 +31,8 @@ async function listRecordsetsByZone() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listRecordsetsByZone().catch(console.error);
|
||||
async function main() {
|
||||
listRecordsetsByZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,17 @@
|
|||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListARecordset.json
|
||||
*/
|
||||
async function listARecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -31,17 +32,15 @@ async function listARecordsets() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listARecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListAAAARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListAAAARecordset.json
|
||||
*/
|
||||
async function listAaaaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "AAAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -53,17 +52,15 @@ async function listAaaaRecordsets() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listAaaaRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCaaRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCaaRecordset.json
|
||||
*/
|
||||
async function listCaaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "CAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -75,17 +72,15 @@ async function listCaaRecordsets() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCaaRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCNAMERecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCNAMERecordset.json
|
||||
*/
|
||||
async function listCnameRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "CNAME";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -97,17 +92,35 @@ async function listCnameRecordsets() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCnameRecordsets().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDSRecordset.json
|
||||
*/
|
||||
async function listDsRecordsets() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "DS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListMXRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListMXRecordset.json
|
||||
*/
|
||||
async function listMxRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "MX";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -119,17 +132,35 @@ async function listMxRecordsets() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listMxRecordsets().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNAPTRRecordset.json
|
||||
*/
|
||||
async function listNaptrRecordsets() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "NAPTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListNSRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNSRecordset.json
|
||||
*/
|
||||
async function listNsRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "NS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -141,17 +172,15 @@ async function listNsRecordsets() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listNsRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListPTRRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListPTRRecordset.json
|
||||
*/
|
||||
async function listPtrRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const recordType = "PTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -163,17 +192,15 @@ async function listPtrRecordsets() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listPtrRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSOARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSOARecordset.json
|
||||
*/
|
||||
async function listSoaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "SOA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -185,17 +212,15 @@ async function listSoaRecordsets() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listSoaRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSRVRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSRVRecordset.json
|
||||
*/
|
||||
async function listSrvRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "SRV";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -207,17 +232,35 @@ async function listSrvRecordsets() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listSrvRecordsets().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTLSARecordset.json
|
||||
*/
|
||||
async function listTlsaRecordsets() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "TLSA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListTXTRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTXTRecordset.json
|
||||
*/
|
||||
async function listTxtRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "TXT";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -229,4 +272,20 @@ async function listTxtRecordsets() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listTxtRecordsets().catch(console.error);
|
||||
async function main() {
|
||||
listARecordsets();
|
||||
listAaaaRecordsets();
|
||||
listCaaRecordsets();
|
||||
listCnameRecordsets();
|
||||
listDsRecordsets();
|
||||
listMxRecordsets();
|
||||
listNaptrRecordsets();
|
||||
listNsRecordsets();
|
||||
listPtrRecordsets();
|
||||
listSoaRecordsets();
|
||||
listSrvRecordsets();
|
||||
listTlsaRecordsets();
|
||||
listTxtRecordsets();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,17 @@
|
|||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchARecordset.json
|
||||
*/
|
||||
async function patchARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
|
@ -31,22 +32,20 @@ async function patchARecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchARecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchAAAARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchAAAARecordset.json
|
||||
*/
|
||||
async function patchAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
|
@ -58,22 +57,20 @@ async function patchAaaaRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchAaaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchCaaRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCaaRecordset.json
|
||||
*/
|
||||
async function patchCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
|
@ -85,22 +82,20 @@ async function patchCaaRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchCaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchCNAMERecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCNAMERecordset.json
|
||||
*/
|
||||
async function patchCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
|
@ -112,22 +107,45 @@ async function patchCnameRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchCnameRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchMXRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchDSRecordset.json
|
||||
*/
|
||||
async function patchDsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "DS";
|
||||
const parameters = { metadata: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchMXRecordset.json
|
||||
*/
|
||||
async function patchMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
|
@ -139,22 +157,45 @@ async function patchMxRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchMxRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchNSRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNAPTRRecordset.json
|
||||
*/
|
||||
async function patchNaptrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NAPTR";
|
||||
const parameters = { metadata: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNSRecordset.json
|
||||
*/
|
||||
async function patchNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
|
@ -166,22 +207,20 @@ async function patchNsRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchNsRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchPTRRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchPTRRecordset.json
|
||||
*/
|
||||
async function patchPtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
|
@ -193,22 +232,20 @@ async function patchPtrRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchPtrRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchSOARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSOARecordset.json
|
||||
*/
|
||||
async function patchSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
|
@ -220,22 +257,20 @@ async function patchSoaRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchSoaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchSRVRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSRVRecordset.json
|
||||
*/
|
||||
async function patchSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
|
@ -247,22 +282,45 @@ async function patchSrvRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchSrvRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchTXTRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTLSARecordset.json
|
||||
*/
|
||||
async function patchTlsaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TLSA";
|
||||
const parameters = { metadata: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTXTRecordset.json
|
||||
*/
|
||||
async function patchTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
|
@ -274,9 +332,25 @@ async function patchTxtRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchTxtRecordset().catch(console.error);
|
||||
async function main() {
|
||||
patchARecordset();
|
||||
patchAaaaRecordset();
|
||||
patchCaaRecordset();
|
||||
patchCnameRecordset();
|
||||
patchDsRecordset();
|
||||
patchMxRecordset();
|
||||
patchNaptrRecordset();
|
||||
patchNsRecordset();
|
||||
patchPtrRecordset();
|
||||
patchSoaRecordset();
|
||||
patchSrvRecordset();
|
||||
patchTlsaRecordset();
|
||||
patchTxtRecordset();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,17 @@
|
|||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a DNS zone. Does not modify DNS records within the zone.
|
||||
*
|
||||
* @summary Creates or updates a DNS zone. Does not modify DNS records within the zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateZone.json
|
||||
*/
|
||||
async function createZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const parameters = { location: "Global", tags: { key1: "value1" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -28,4 +29,8 @@ async function createZone() {
|
|||
console.log(result);
|
||||
}
|
||||
|
||||
createZone().catch(console.error);
|
||||
async function main() {
|
||||
createZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,17 @@
|
|||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteZone.json
|
||||
*/
|
||||
async function deleteZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -27,4 +28,8 @@ async function deleteZone() {
|
|||
console.log(result);
|
||||
}
|
||||
|
||||
deleteZone().catch(console.error);
|
||||
async function main() {
|
||||
deleteZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,17 @@
|
|||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.
|
||||
*
|
||||
* @summary Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetZone.json
|
||||
*/
|
||||
async function getZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -27,4 +28,8 @@ async function getZone() {
|
|||
console.log(result);
|
||||
}
|
||||
|
||||
getZone().catch(console.error);
|
||||
async function main() {
|
||||
getZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,17 @@
|
|||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the DNS zones within a resource group.
|
||||
*
|
||||
* @summary Lists the DNS zones within a resource group.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListZonesByResourceGroup.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesByResourceGroup.json
|
||||
*/
|
||||
async function listZonesByResourceGroup() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
|
@ -29,4 +30,8 @@ async function listZonesByResourceGroup() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listZonesByResourceGroup().catch(console.error);
|
||||
async function main() {
|
||||
listZonesByResourceGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,15 +10,16 @@
|
|||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the DNS zones in all resource groups in a subscription.
|
||||
*
|
||||
* @summary Lists the DNS zones in all resource groups in a subscription.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListZonesBySubscription.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesBySubscription.json
|
||||
*/
|
||||
async function listZonesBySubscription() {
|
||||
const subscriptionId = "subid";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
|
@ -28,4 +29,8 @@ async function listZonesBySubscription() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listZonesBySubscription().catch(console.error);
|
||||
async function main() {
|
||||
listZonesBySubscription();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,17 @@
|
|||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a DNS zone. Does not modify DNS records within the zone.
|
||||
*
|
||||
* @summary Updates a DNS zone. Does not modify DNS records within the zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchZone.json
|
||||
*/
|
||||
async function patchZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const parameters = { tags: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -28,4 +29,8 @@ async function patchZone() {
|
|||
console.log(result);
|
||||
}
|
||||
|
||||
patchZone().catch(console.error);
|
||||
async function main() {
|
||||
patchZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,97 @@
|
|||
# client library samples for TypeScript (Beta)
|
||||
|
||||
These sample programs show how to use the TypeScript client libraries for in some common scenarios.
|
||||
|
||||
| **File Name** | **Description** |
|
||||
| --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [dnsResourceReferenceGetByTargetResourcesSample.ts][dnsresourcereferencegetbytargetresourcessample] | Returns the DNS records specified by the referencing targetResourceIds. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnsResourceReference.json |
|
||||
| [dnssecConfigsCreateOrUpdateSample.ts][dnssecconfigscreateorupdatesample] | Creates or updates the DNSSEC configuration on a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDnssecConfig.json |
|
||||
| [dnssecConfigsDeleteSample.ts][dnssecconfigsdeletesample] | Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDnssecConfig.json |
|
||||
| [dnssecConfigsGetSample.ts][dnssecconfigsgetsample] | Gets the DNSSEC configuration. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnssecConfig.json |
|
||||
| [dnssecConfigsListByDnsZoneSample.ts][dnssecconfigslistbydnszonesample] | Lists the DNSSEC configurations in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDnssecConfigsByZone.json |
|
||||
| [recordSetsCreateOrUpdateSample.ts][recordsetscreateorupdatesample] | Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created). x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordset.json |
|
||||
| [recordSetsDeleteSample.ts][recordsetsdeletesample] | Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteARecordset.json |
|
||||
| [recordSetsGetSample.ts][recordsetsgetsample] | Gets a record set. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetARecordset.json |
|
||||
| [recordSetsListAllByDnsZoneSample.ts][recordsetslistallbydnszonesample] | Lists all record sets in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json |
|
||||
| [recordSetsListByDnsZoneSample.ts][recordsetslistbydnszonesample] | Lists all record sets in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json |
|
||||
| [recordSetsListByTypeSample.ts][recordsetslistbytypesample] | Lists the record sets of a specified type in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListARecordset.json |
|
||||
| [recordSetsUpdateSample.ts][recordsetsupdatesample] | Updates a record set within a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchARecordset.json |
|
||||
| [zonesCreateOrUpdateSample.ts][zonescreateorupdatesample] | Creates or updates a DNS zone. Does not modify DNS records within the zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateZone.json |
|
||||
| [zonesDeleteSample.ts][zonesdeletesample] | Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteZone.json |
|
||||
| [zonesGetSample.ts][zonesgetsample] | Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetZone.json |
|
||||
| [zonesListByResourceGroupSample.ts][zoneslistbyresourcegroupsample] | Lists the DNS zones within a resource group. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesByResourceGroup.json |
|
||||
| [zonesListSample.ts][zoneslistsample] | Lists the DNS zones in all resource groups in a subscription. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesBySubscription.json |
|
||||
| [zonesUpdateSample.ts][zonesupdatesample] | Updates a DNS zone. Does not modify DNS records within the zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchZone.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
|
||||
|
||||
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
|
||||
|
||||
```bash
|
||||
npm install -g typescript
|
||||
```
|
||||
|
||||
You need [an Azure subscription][freesub] to run these sample programs.
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Compile the samples:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node dist/dnsResourceReferenceGetByTargetResourcesSample.js
|
||||
```
|
||||
|
||||
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
|
||||
|
||||
```bash
|
||||
npx cross-env DNS_SUBSCRIPTION_ID="<dns subscription id>" node dist/dnsResourceReferenceGetByTargetResourcesSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[dnsresourcereferencegetbytargetresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/dnsResourceReferenceGetByTargetResourcesSample.ts
|
||||
[dnssecconfigscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/dnssecConfigsCreateOrUpdateSample.ts
|
||||
[dnssecconfigsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/dnssecConfigsDeleteSample.ts
|
||||
[dnssecconfigsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/dnssecConfigsGetSample.ts
|
||||
[dnssecconfigslistbydnszonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/dnssecConfigsListByDnsZoneSample.ts
|
||||
[recordsetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/recordSetsCreateOrUpdateSample.ts
|
||||
[recordsetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/recordSetsDeleteSample.ts
|
||||
[recordsetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/recordSetsGetSample.ts
|
||||
[recordsetslistallbydnszonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/recordSetsListAllByDnsZoneSample.ts
|
||||
[recordsetslistbydnszonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/recordSetsListByDnsZoneSample.ts
|
||||
[recordsetslistbytypesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/recordSetsListByTypeSample.ts
|
||||
[recordsetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/recordSetsUpdateSample.ts
|
||||
[zonescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/zonesCreateOrUpdateSample.ts
|
||||
[zonesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/zonesDeleteSample.ts
|
||||
[zonesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/zonesGetSample.ts
|
||||
[zoneslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/zonesListByResourceGroupSample.ts
|
||||
[zoneslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/zonesListSample.ts
|
||||
[zonesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5-beta/typescript/src/zonesUpdateSample.ts
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-dns?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns/README.md
|
||||
[typescript]: https://www.typescriptlang.org/docs/home.html
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-dns-ts",
|
||||
"name": "@azure-samples/arm-dns-ts-beta",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for TypeScript",
|
||||
"description": " client library samples for TypeScript (Beta)",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
|
@ -29,7 +29,7 @@
|
|||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns",
|
||||
"dependencies": {
|
||||
"@azure/arm-dns": "latest",
|
||||
"@azure/arm-dns": "next",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^4.2.1"
|
||||
},
|
|
@ -10,32 +10,39 @@
|
|||
// Licensed under the MIT License.
|
||||
import {
|
||||
DnsResourceReferenceRequest,
|
||||
DnsManagementClient
|
||||
DnsManagementClient,
|
||||
} from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Returns the DNS records specified by the referencing targetResourceIds.
|
||||
*
|
||||
* @summary Returns the DNS records specified by the referencing targetResourceIds.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetDnsResourceReference.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnsResourceReference.json
|
||||
*/
|
||||
async function listZonesByResourceGroup() {
|
||||
const subscriptionId = "subid";
|
||||
async function getDnsResourceReference() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const parameters: DnsResourceReferenceRequest = {
|
||||
targetResources: [
|
||||
{
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/trafficManagerProfiles/testpp2"
|
||||
}
|
||||
]
|
||||
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/trafficManagerProfiles/testpp2",
|
||||
},
|
||||
],
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnsResourceReferenceOperations.getByTargetResources(
|
||||
parameters
|
||||
);
|
||||
const result =
|
||||
await client.dnsResourceReferenceOperations.getByTargetResources(
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
listZonesByResourceGroup().catch(console.error);
|
||||
async function main() {
|
||||
getDnsResourceReference();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates the DNSSEC configuration on a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates the DNSSEC configuration on a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDnssecConfig.json
|
||||
*/
|
||||
async function createDnssecConfig() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnssecConfigs.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createDnssecConfig();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDnssecConfig.json
|
||||
*/
|
||||
async function deleteDnssecConfig() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnssecConfigs.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteDnssecConfig();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the DNSSEC configuration.
|
||||
*
|
||||
* @summary Gets the DNSSEC configuration.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnssecConfig.json
|
||||
*/
|
||||
async function getDnssecConfig() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnssecConfigs.get(resourceGroupName, zoneName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getDnssecConfig();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the DNSSEC configurations in a DNS zone.
|
||||
*
|
||||
* @summary Lists the DNSSEC configurations in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDnssecConfigsByZone.json
|
||||
*/
|
||||
async function listDnssecConfigs() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.dnssecConfigs.listByDnsZone(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listDnssecConfigs();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,508 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { RecordSet, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordset.json
|
||||
*/
|
||||
async function createARecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const parameters: RecordSet = {
|
||||
aRecords: [{ ipv4Address: "127.0.0.1" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordsetAlias.json
|
||||
*/
|
||||
async function createARecordsetWithAliasTargetResource() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const parameters: RecordSet = {
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
targetResource: {
|
||||
id: "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2",
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordSetTrafficManagementProfile.json
|
||||
*/
|
||||
async function createARecordsetWithTrafficManagementProfile() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const parameters: RecordSet = {
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
trafficManagementProfile: {
|
||||
id: "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2",
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateAAAARecordset.json
|
||||
*/
|
||||
async function createAaaaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
const parameters: RecordSet = {
|
||||
aaaaRecords: [{ ipv6Address: "::1" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCaaRecordset.json
|
||||
*/
|
||||
async function createCaaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
const parameters: RecordSet = {
|
||||
ttl: 3600,
|
||||
caaRecords: [{ flags: 0, tag: "issue", value: "ca.contoso.com" }],
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCNAMERecordset.json
|
||||
*/
|
||||
async function createCnameRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
const parameters: RecordSet = {
|
||||
cnameRecord: { cname: "contoso.com" },
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDSRecordset.json
|
||||
*/
|
||||
async function createDsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "DS";
|
||||
const parameters: RecordSet = {
|
||||
dsRecords: [
|
||||
{
|
||||
algorithm: 5,
|
||||
digest: {
|
||||
algorithmType: 1,
|
||||
value: "2BB183AF5F22588179A53B0A98631FAD1A292118",
|
||||
},
|
||||
keyTag: 60485,
|
||||
},
|
||||
],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateMXRecordset.json
|
||||
*/
|
||||
async function createMxRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
const parameters: RecordSet = {
|
||||
mxRecords: [{ exchange: "mail.contoso.com", preference: 0 }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNAPTRRecordset.json
|
||||
*/
|
||||
async function createNaptrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NAPTR";
|
||||
const parameters: RecordSet = {
|
||||
naptrRecords: [
|
||||
{
|
||||
flags: "U",
|
||||
order: 100,
|
||||
preference: 10,
|
||||
regexp: "!^.*$!sip:user@example.com!",
|
||||
replacement: "",
|
||||
services: "E2U+sip",
|
||||
},
|
||||
],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNSRecordset.json
|
||||
*/
|
||||
async function createNsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
const parameters: RecordSet = {
|
||||
nsRecords: [{ nsdname: "ns1.contoso.com" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdatePTRRecordset.json
|
||||
*/
|
||||
async function createPtrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
const parameters: RecordSet = {
|
||||
ptrRecords: [{ ptrdname: "localhost" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSOARecordset.json
|
||||
*/
|
||||
async function createSoaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
const parameters: RecordSet = {
|
||||
soaRecord: {
|
||||
email: "hostmaster.contoso.com",
|
||||
expireTime: 2419200,
|
||||
host: "ns1.contoso.com",
|
||||
minimumTtl: 300,
|
||||
refreshTime: 3600,
|
||||
retryTime: 300,
|
||||
serialNumber: 1,
|
||||
},
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSRVRecordset.json
|
||||
*/
|
||||
async function createSrvRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
const parameters: RecordSet = {
|
||||
srvRecords: [{ port: 80, priority: 0, target: "contoso.com", weight: 10 }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTLSARecordset.json
|
||||
*/
|
||||
async function createTlsaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TLSA";
|
||||
const parameters: RecordSet = {
|
||||
tlsaRecords: [
|
||||
{
|
||||
certAssociationData:
|
||||
"6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B",
|
||||
matchingType: 1,
|
||||
selector: 1,
|
||||
usage: 3,
|
||||
},
|
||||
],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTXTRecordset.json
|
||||
*/
|
||||
async function createTxtRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
const parameters: RecordSet = {
|
||||
ttl: 3600,
|
||||
txtRecords: [{ value: ["string1", "string2"] }],
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createARecordset();
|
||||
createARecordsetWithAliasTargetResource();
|
||||
createARecordsetWithTrafficManagementProfile();
|
||||
createAaaaRecordset();
|
||||
createCaaRecordset();
|
||||
createCnameRecordset();
|
||||
createDsRecordset();
|
||||
createMxRecordset();
|
||||
createNaptrRecordset();
|
||||
createNsRecordset();
|
||||
createPtrRecordset();
|
||||
createSoaRecordset();
|
||||
createSrvRecordset();
|
||||
createTlsaRecordset();
|
||||
createTxtRecordset();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,308 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteARecordset.json
|
||||
*/
|
||||
async function deleteARecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteAAAARecordset.json
|
||||
*/
|
||||
async function deleteAaaaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCaaRecordset.json
|
||||
*/
|
||||
async function deleteCaaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCNAMERecordset.json
|
||||
*/
|
||||
async function deleteCnameRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDSRecordset.json
|
||||
*/
|
||||
async function deleteDsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "DS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteMXRecordset.json
|
||||
*/
|
||||
async function deleteMxRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNAPTRRecordset.json
|
||||
*/
|
||||
async function deleteNaptrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NAPTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNSRecordset.json
|
||||
*/
|
||||
async function deleteNsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeletePTRRecordset.json
|
||||
*/
|
||||
async function deletePtrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteSRVRecordset.json
|
||||
*/
|
||||
async function deleteSrvRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTLSARecordset.json
|
||||
*/
|
||||
async function deleteTlsaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TLSA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTXTRecordset.json
|
||||
*/
|
||||
async function deleteTxtRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteARecordset();
|
||||
deleteAaaaRecordset();
|
||||
deleteCaaRecordset();
|
||||
deleteCnameRecordset();
|
||||
deleteDsRecordset();
|
||||
deleteMxRecordset();
|
||||
deleteNaptrRecordset();
|
||||
deleteNsRecordset();
|
||||
deletePtrRecordset();
|
||||
deleteSrvRecordset();
|
||||
deleteTlsaRecordset();
|
||||
deleteTxtRecordset();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetARecordset.json
|
||||
*/
|
||||
async function getARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
|
@ -29,22 +32,20 @@ async function getARecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getARecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetAAAARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetAAAARecordset.json
|
||||
*/
|
||||
async function getAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
|
@ -54,22 +55,20 @@ async function getAaaaRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getAaaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetCaaRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCaaRecordset.json
|
||||
*/
|
||||
async function getCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
|
@ -79,22 +78,20 @@ async function getCaaRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getCaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetCNAMERecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCNAMERecordset.json
|
||||
*/
|
||||
async function getCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
|
@ -104,22 +101,43 @@ async function getCnameRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getCnameRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetMXRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDSRecordset.json
|
||||
*/
|
||||
async function getDsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "DS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetMXRecordset.json
|
||||
*/
|
||||
async function getMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
|
@ -129,22 +147,43 @@ async function getMxRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getMxRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetNSRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNAPTRRecordset.json
|
||||
*/
|
||||
async function getNaptrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NAPTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNSRecordset.json
|
||||
*/
|
||||
async function getNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
|
@ -154,22 +193,20 @@ async function getNsRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getNsRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetPTRRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetPTRRecordset.json
|
||||
*/
|
||||
async function getPtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
|
@ -179,22 +216,20 @@ async function getPtrRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getPtrRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetSOARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSOARecordset.json
|
||||
*/
|
||||
async function getSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
|
@ -204,22 +239,20 @@ async function getSoaRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getSoaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetSRVRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSRVRecordset.json
|
||||
*/
|
||||
async function getSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
|
@ -229,22 +262,43 @@ async function getSrvRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getSrvRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetTXTRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTLSARecordset.json
|
||||
*/
|
||||
async function getTlsaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TLSA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a record set.
|
||||
*
|
||||
* @summary Gets a record set.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTXTRecordset.json
|
||||
*/
|
||||
async function getTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
|
@ -254,9 +308,25 @@ async function getTxtRecordset() {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
recordType,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getTxtRecordset().catch(console.error);
|
||||
async function main() {
|
||||
getARecordset();
|
||||
getAaaaRecordset();
|
||||
getCaaRecordset();
|
||||
getCnameRecordset();
|
||||
getDsRecordset();
|
||||
getMxRecordset();
|
||||
getNaptrRecordset();
|
||||
getNsRecordset();
|
||||
getPtrRecordset();
|
||||
getSoaRecordset();
|
||||
getSrvRecordset();
|
||||
getTlsaRecordset();
|
||||
getTxtRecordset();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,27 +10,34 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists all record sets in a DNS zone.
|
||||
*
|
||||
* @summary Lists all record sets in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListRecordSetsByZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json
|
||||
*/
|
||||
async function listRecordsetsByZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
async function listAllRecordsetsByZone() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listAllByDnsZone(
|
||||
resourceGroupName,
|
||||
zoneName
|
||||
zoneName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listRecordsetsByZone().catch(console.error);
|
||||
async function main() {
|
||||
listAllRecordsetsByZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,27 +10,34 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists all record sets in a DNS zone.
|
||||
*
|
||||
* @summary Lists all record sets in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListRecordSetsByZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json
|
||||
*/
|
||||
async function listRecordsetsByZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listByDnsZone(
|
||||
resourceGroupName,
|
||||
zoneName
|
||||
zoneName,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listRecordsetsByZone().catch(console.error);
|
||||
async function main() {
|
||||
listRecordsetsByZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListARecordset.json
|
||||
*/
|
||||
async function listARecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -28,24 +31,22 @@ async function listARecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listARecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListAAAARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListAAAARecordset.json
|
||||
*/
|
||||
async function listAaaaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "AAAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -54,24 +55,22 @@ async function listAaaaRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listAaaaRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCaaRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCaaRecordset.json
|
||||
*/
|
||||
async function listCaaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "CAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -80,24 +79,22 @@ async function listCaaRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCaaRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCNAMERecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCNAMERecordset.json
|
||||
*/
|
||||
async function listCnameRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "CNAME";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -106,24 +103,46 @@ async function listCnameRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCnameRecordsets().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDSRecordset.json
|
||||
*/
|
||||
async function listDsRecordsets() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "DS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListMXRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListMXRecordset.json
|
||||
*/
|
||||
async function listMxRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "MX";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -132,24 +151,46 @@ async function listMxRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listMxRecordsets().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNAPTRRecordset.json
|
||||
*/
|
||||
async function listNaptrRecordsets() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "NAPTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListNSRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNSRecordset.json
|
||||
*/
|
||||
async function listNsRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "NS";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -158,24 +199,22 @@ async function listNsRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listNsRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListPTRRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListPTRRecordset.json
|
||||
*/
|
||||
async function listPtrRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const recordType = "PTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -184,24 +223,22 @@ async function listPtrRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listPtrRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSOARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSOARecordset.json
|
||||
*/
|
||||
async function listSoaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "SOA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -210,24 +247,22 @@ async function listSoaRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listSoaRecordsets().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSRVRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSRVRecordset.json
|
||||
*/
|
||||
async function listSrvRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "SRV";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -236,24 +271,46 @@ async function listSrvRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listSrvRecordsets().catch(console.error);
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTLSARecordset.json
|
||||
*/
|
||||
async function listTlsaRecordsets() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "TLSA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
|
||||
*
|
||||
* @summary Lists the record sets of a specified type in a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListTXTRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTXTRecordset.json
|
||||
*/
|
||||
async function listTxtRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "TXT";
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -262,11 +319,27 @@ async function listTxtRecordsets() {
|
|||
for await (let item of client.recordSets.listByType(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType
|
||||
recordType,
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listTxtRecordsets().catch(console.error);
|
||||
async function main() {
|
||||
listARecordsets();
|
||||
listAaaaRecordsets();
|
||||
listCaaRecordsets();
|
||||
listCnameRecordsets();
|
||||
listDsRecordsets();
|
||||
listMxRecordsets();
|
||||
listNaptrRecordsets();
|
||||
listNsRecordsets();
|
||||
listPtrRecordsets();
|
||||
listSoaRecordsets();
|
||||
listSrvRecordsets();
|
||||
listTlsaRecordsets();
|
||||
listTxtRecordsets();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { RecordSet, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchARecordset.json
|
||||
*/
|
||||
async function patchARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
|
@ -31,22 +34,20 @@ async function patchARecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchARecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchAAAARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchAAAARecordset.json
|
||||
*/
|
||||
async function patchAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
|
@ -58,22 +59,20 @@ async function patchAaaaRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchAaaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchCaaRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCaaRecordset.json
|
||||
*/
|
||||
async function patchCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
|
@ -85,22 +84,20 @@ async function patchCaaRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchCaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchCNAMERecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCNAMERecordset.json
|
||||
*/
|
||||
async function patchCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
|
@ -112,22 +109,45 @@ async function patchCnameRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchCnameRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchMXRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchDSRecordset.json
|
||||
*/
|
||||
async function patchDsRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "DS";
|
||||
const parameters: RecordSet = { metadata: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchMXRecordset.json
|
||||
*/
|
||||
async function patchMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
|
@ -139,22 +159,45 @@ async function patchMxRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchMxRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchNSRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNAPTRRecordset.json
|
||||
*/
|
||||
async function patchNaptrRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NAPTR";
|
||||
const parameters: RecordSet = { metadata: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNSRecordset.json
|
||||
*/
|
||||
async function patchNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
|
@ -166,22 +209,20 @@ async function patchNsRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchNsRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchPTRRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchPTRRecordset.json
|
||||
*/
|
||||
async function patchPtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
|
@ -193,22 +234,20 @@ async function patchPtrRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchPtrRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchSOARecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSOARecordset.json
|
||||
*/
|
||||
async function patchSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
|
@ -220,22 +259,20 @@ async function patchSoaRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchSoaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchSRVRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSRVRecordset.json
|
||||
*/
|
||||
async function patchSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
|
@ -247,22 +284,45 @@ async function patchSrvRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchSrvRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchTXTRecordset.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTLSARecordset.json
|
||||
*/
|
||||
async function patchTlsaRecordset() {
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TLSA";
|
||||
const parameters: RecordSet = { metadata: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTXTRecordset.json
|
||||
*/
|
||||
async function patchTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
|
@ -274,9 +334,25 @@ async function patchTxtRecordset() {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchTxtRecordset().catch(console.error);
|
||||
async function main() {
|
||||
patchARecordset();
|
||||
patchAaaaRecordset();
|
||||
patchCaaRecordset();
|
||||
patchCnameRecordset();
|
||||
patchDsRecordset();
|
||||
patchMxRecordset();
|
||||
patchNaptrRecordset();
|
||||
patchNsRecordset();
|
||||
patchPtrRecordset();
|
||||
patchSoaRecordset();
|
||||
patchSrvRecordset();
|
||||
patchTlsaRecordset();
|
||||
patchTxtRecordset();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { Zone, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a DNS zone. Does not modify DNS records within the zone.
|
||||
*
|
||||
* @summary Creates or updates a DNS zone. Does not modify DNS records within the zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateZone.json
|
||||
*/
|
||||
async function createZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const parameters: Zone = { location: "Global", tags: { key1: "value1" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -27,9 +30,13 @@ async function createZone() {
|
|||
const result = await client.zones.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createZone().catch(console.error);
|
||||
async function main() {
|
||||
createZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,24 +10,31 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteZone.json
|
||||
*/
|
||||
async function deleteZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
zoneName
|
||||
zoneName,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteZone().catch(console.error);
|
||||
async function main() {
|
||||
deleteZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.
|
||||
*
|
||||
* @summary Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetZone.json
|
||||
*/
|
||||
async function getZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
|
@ -27,4 +30,8 @@ async function getZone() {
|
|||
console.log(result);
|
||||
}
|
||||
|
||||
getZone().catch(console.error);
|
||||
async function main() {
|
||||
getZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the DNS zones within a resource group.
|
||||
*
|
||||
* @summary Lists the DNS zones within a resource group.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListZonesByResourceGroup.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesByResourceGroup.json
|
||||
*/
|
||||
async function listZonesByResourceGroup() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
|
@ -29,4 +32,8 @@ async function listZonesByResourceGroup() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listZonesByResourceGroup().catch(console.error);
|
||||
async function main() {
|
||||
listZonesByResourceGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,15 +10,18 @@
|
|||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the DNS zones in all resource groups in a subscription.
|
||||
*
|
||||
* @summary Lists the DNS zones in all resource groups in a subscription.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListZonesBySubscription.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesBySubscription.json
|
||||
*/
|
||||
async function listZonesBySubscription() {
|
||||
const subscriptionId = "subid";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
|
@ -28,4 +31,8 @@ async function listZonesBySubscription() {
|
|||
console.log(resArray);
|
||||
}
|
||||
|
||||
listZonesBySubscription().catch(console.error);
|
||||
async function main() {
|
||||
listZonesBySubscription();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -10,16 +10,19 @@
|
|||
// Licensed under the MIT License.
|
||||
import { ZoneUpdate, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a DNS zone. Does not modify DNS records within the zone.
|
||||
*
|
||||
* @summary Updates a DNS zone. Does not modify DNS records within the zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchZone.json
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchZone.json
|
||||
*/
|
||||
async function patchZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const subscriptionId = process.env["DNS_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["DNS_RESOURCE_GROUP"] || "rg1";
|
||||
const zoneName = "zone1";
|
||||
const parameters: ZoneUpdate = { tags: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
|
@ -27,9 +30,13 @@ async function patchZone() {
|
|||
const result = await client.zones.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
parameters
|
||||
parameters,
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchZone().catch(console.error);
|
||||
async function main() {
|
||||
patchZone();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2018",
|
||||
"target": "ES2020",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
|
@ -1,76 +0,0 @@
|
|||
# client library samples for JavaScript
|
||||
|
||||
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
|
||||
|
||||
| **File Name** | **Description** |
|
||||
| --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [dnsResourceReferenceGetByTargetResourcesSample.js][dnsresourcereferencegetbytargetresourcessample] | Returns the DNS records specified by the referencing targetResourceIds. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetDnsResourceReference.json |
|
||||
| [recordSetsCreateOrUpdateSample.js][recordsetscreateorupdatesample] | Creates or updates a record set within a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordset.json |
|
||||
| [recordSetsDeleteSample.js][recordsetsdeletesample] | Deletes a record set from a DNS zone. This operation cannot be undone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json |
|
||||
| [recordSetsGetSample.js][recordsetsgetsample] | Gets a record set. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetARecordset.json |
|
||||
| [recordSetsListAllByDnsZoneSample.js][recordsetslistallbydnszonesample] | Lists all record sets in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListRecordSetsByZone.json |
|
||||
| [recordSetsListByDnsZoneSample.js][recordsetslistbydnszonesample] | Lists all record sets in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListRecordSetsByZone.json |
|
||||
| [recordSetsListByTypeSample.js][recordsetslistbytypesample] | Lists the record sets of a specified type in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListARecordset.json |
|
||||
| [recordSetsUpdateSample.js][recordsetsupdatesample] | Updates a record set within a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchARecordset.json |
|
||||
| [zonesCreateOrUpdateSample.js][zonescreateorupdatesample] | Creates or updates a DNS zone. Does not modify DNS records within the zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateZone.json |
|
||||
| [zonesDeleteSample.js][zonesdeletesample] | Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteZone.json |
|
||||
| [zonesGetSample.js][zonesgetsample] | Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetZone.json |
|
||||
| [zonesListByResourceGroupSample.js][zoneslistbyresourcegroupsample] | Lists the DNS zones within a resource group. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListZonesByResourceGroup.json |
|
||||
| [zonesListSample.js][zoneslistsample] | Lists the DNS zones in all resource groups in a subscription. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListZonesBySubscription.json |
|
||||
| [zonesUpdateSample.js][zonesupdatesample] | Updates a DNS zone. Does not modify DNS records within the zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchZone.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
|
||||
|
||||
You need [an Azure subscription][freesub] to run these sample programs.
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node dnsResourceReferenceGetByTargetResourcesSample.js
|
||||
```
|
||||
|
||||
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
|
||||
|
||||
```bash
|
||||
npx cross-env node dnsResourceReferenceGetByTargetResourcesSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[dnsresourcereferencegetbytargetresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/dnsResourceReferenceGetByTargetResourcesSample.js
|
||||
[recordsetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/recordSetsCreateOrUpdateSample.js
|
||||
[recordsetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/recordSetsDeleteSample.js
|
||||
[recordsetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/recordSetsGetSample.js
|
||||
[recordsetslistallbydnszonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/recordSetsListAllByDnsZoneSample.js
|
||||
[recordsetslistbydnszonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/recordSetsListByDnsZoneSample.js
|
||||
[recordsetslistbytypesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/recordSetsListByTypeSample.js
|
||||
[recordsetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/recordSetsUpdateSample.js
|
||||
[zonescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/zonesCreateOrUpdateSample.js
|
||||
[zonesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/zonesDeleteSample.js
|
||||
[zonesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/zonesGetSample.js
|
||||
[zoneslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/zonesListByResourceGroupSample.js
|
||||
[zoneslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/zonesListSample.js
|
||||
[zonesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/javascript/zonesUpdateSample.js
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-dns?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns/README.md
|
|
@ -1,363 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordset.json
|
||||
*/
|
||||
async function createARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const parameters = {
|
||||
aRecords: [{ ipv4Address: "127.0.0.1" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createARecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordsetAlias.json
|
||||
*/
|
||||
async function createARecordsetWithAliasTargetResource() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const parameters = {
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
targetResource: {
|
||||
id: "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2",
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createARecordsetWithAliasTargetResource().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateAAAARecordset.json
|
||||
*/
|
||||
async function createAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
const parameters = {
|
||||
aaaaRecords: [{ ipv6Address: "::1" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createAaaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCaaRecordset.json
|
||||
*/
|
||||
async function createCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
const parameters = {
|
||||
ttl: 3600,
|
||||
caaRecords: [{ flags: 0, tag: "issue", value: "ca.contoso.com" }],
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createCaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCNAMERecordset.json
|
||||
*/
|
||||
async function createCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
const parameters = {
|
||||
cnameRecord: { cname: "contoso.com" },
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createCnameRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateMXRecordset.json
|
||||
*/
|
||||
async function createMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
const parameters = {
|
||||
mxRecords: [{ exchange: "mail.contoso.com", preference: 0 }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createMxRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateNSRecordset.json
|
||||
*/
|
||||
async function createNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
const parameters = {
|
||||
nsRecords: [{ nsdname: "ns1.contoso.com" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createNsRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdatePTRRecordset.json
|
||||
*/
|
||||
async function createPtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
const parameters = {
|
||||
ptrRecords: [{ ptrdname: "localhost" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createPtrRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSOARecordset.json
|
||||
*/
|
||||
async function createSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
const parameters = {
|
||||
soaRecord: {
|
||||
email: "hostmaster.contoso.com",
|
||||
expireTime: 2419200,
|
||||
host: "ns1.contoso.com",
|
||||
minimumTtl: 300,
|
||||
refreshTime: 3600,
|
||||
retryTime: 300,
|
||||
serialNumber: 1,
|
||||
},
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createSoaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSRVRecordset.json
|
||||
*/
|
||||
async function createSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
const parameters = {
|
||||
srvRecords: [{ port: 80, priority: 0, target: "contoso.com", weight: 10 }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createSrvRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateTXTRecordset.json
|
||||
*/
|
||||
async function createTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
const parameters = {
|
||||
ttl: 3600,
|
||||
txtRecords: [{ value: ["string1", "string2"] }],
|
||||
metadata: { key1: "value1" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createTxtRecordset().catch(console.error);
|
|
@ -1,237 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json
|
||||
*/
|
||||
async function deleteARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteARecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteAAAARecordset.json
|
||||
*/
|
||||
async function deleteAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteAaaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteCaaRecordset.json
|
||||
*/
|
||||
async function deleteCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteCaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json
|
||||
*/
|
||||
async function deleteCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteCnameRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json
|
||||
*/
|
||||
async function deleteMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteMxRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json
|
||||
*/
|
||||
async function deleteNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteNsRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeletePTRRecordset.json
|
||||
*/
|
||||
async function deletePtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deletePtrRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteSRVRecordset.json
|
||||
*/
|
||||
async function deleteSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteSrvRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteTXTRecordset.json
|
||||
*/
|
||||
async function deleteTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteTxtRecordset().catch(console.error);
|
|
@ -1,89 +0,0 @@
|
|||
# client library samples for TypeScript
|
||||
|
||||
These sample programs show how to use the TypeScript client libraries for in some common scenarios.
|
||||
|
||||
| **File Name** | **Description** |
|
||||
| --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [dnsResourceReferenceGetByTargetResourcesSample.ts][dnsresourcereferencegetbytargetresourcessample] | Returns the DNS records specified by the referencing targetResourceIds. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetDnsResourceReference.json |
|
||||
| [recordSetsCreateOrUpdateSample.ts][recordsetscreateorupdatesample] | Creates or updates a record set within a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordset.json |
|
||||
| [recordSetsDeleteSample.ts][recordsetsdeletesample] | Deletes a record set from a DNS zone. This operation cannot be undone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json |
|
||||
| [recordSetsGetSample.ts][recordsetsgetsample] | Gets a record set. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetARecordset.json |
|
||||
| [recordSetsListAllByDnsZoneSample.ts][recordsetslistallbydnszonesample] | Lists all record sets in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListRecordSetsByZone.json |
|
||||
| [recordSetsListByDnsZoneSample.ts][recordsetslistbydnszonesample] | Lists all record sets in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListRecordSetsByZone.json |
|
||||
| [recordSetsListByTypeSample.ts][recordsetslistbytypesample] | Lists the record sets of a specified type in a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListARecordset.json |
|
||||
| [recordSetsUpdateSample.ts][recordsetsupdatesample] | Updates a record set within a DNS zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchARecordset.json |
|
||||
| [zonesCreateOrUpdateSample.ts][zonescreateorupdatesample] | Creates or updates a DNS zone. Does not modify DNS records within the zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateZone.json |
|
||||
| [zonesDeleteSample.ts][zonesdeletesample] | Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteZone.json |
|
||||
| [zonesGetSample.ts][zonesgetsample] | Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetZone.json |
|
||||
| [zonesListByResourceGroupSample.ts][zoneslistbyresourcegroupsample] | Lists the DNS zones within a resource group. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListZonesByResourceGroup.json |
|
||||
| [zonesListSample.ts][zoneslistsample] | Lists the DNS zones in all resource groups in a subscription. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListZonesBySubscription.json |
|
||||
| [zonesUpdateSample.ts][zonesupdatesample] | Updates a DNS zone. Does not modify DNS records within the zone. x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchZone.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
|
||||
|
||||
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
|
||||
|
||||
```bash
|
||||
npm install -g typescript
|
||||
```
|
||||
|
||||
You need [an Azure subscription][freesub] to run these sample programs.
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Compile the samples:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node dist/dnsResourceReferenceGetByTargetResourcesSample.js
|
||||
```
|
||||
|
||||
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
|
||||
|
||||
```bash
|
||||
npx cross-env node dist/dnsResourceReferenceGetByTargetResourcesSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[dnsresourcereferencegetbytargetresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/dnsResourceReferenceGetByTargetResourcesSample.ts
|
||||
[recordsetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/recordSetsCreateOrUpdateSample.ts
|
||||
[recordsetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/recordSetsDeleteSample.ts
|
||||
[recordsetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/recordSetsGetSample.ts
|
||||
[recordsetslistallbydnszonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/recordSetsListAllByDnsZoneSample.ts
|
||||
[recordsetslistbydnszonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/recordSetsListByDnsZoneSample.ts
|
||||
[recordsetslistbytypesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/recordSetsListByTypeSample.ts
|
||||
[recordsetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/recordSetsUpdateSample.ts
|
||||
[zonescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/zonesCreateOrUpdateSample.ts
|
||||
[zonesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/zonesDeleteSample.ts
|
||||
[zonesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/zonesGetSample.ts
|
||||
[zoneslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/zonesListByResourceGroupSample.ts
|
||||
[zoneslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/zonesListSample.ts
|
||||
[zonesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/dns/arm-dns/samples/v5/typescript/src/zonesUpdateSample.ts
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-dns?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns/README.md
|
||||
[typescript]: https://www.typescriptlang.org/docs/home.html
|
|
@ -1,364 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { RecordSet, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordset.json
|
||||
*/
|
||||
async function createARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const parameters: RecordSet = {
|
||||
aRecords: [{ ipv4Address: "127.0.0.1" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createARecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordsetAlias.json
|
||||
*/
|
||||
async function createARecordsetWithAliasTargetResource() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const parameters: RecordSet = {
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" },
|
||||
targetResource: {
|
||||
id:
|
||||
"/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"
|
||||
}
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createARecordsetWithAliasTargetResource().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateAAAARecordset.json
|
||||
*/
|
||||
async function createAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
const parameters: RecordSet = {
|
||||
aaaaRecords: [{ ipv6Address: "::1" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createAaaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCaaRecordset.json
|
||||
*/
|
||||
async function createCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
const parameters: RecordSet = {
|
||||
ttl: 3600,
|
||||
caaRecords: [{ flags: 0, tag: "issue", value: "ca.contoso.com" }],
|
||||
metadata: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createCaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCNAMERecordset.json
|
||||
*/
|
||||
async function createCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
const parameters: RecordSet = {
|
||||
cnameRecord: { cname: "contoso.com" },
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createCnameRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateMXRecordset.json
|
||||
*/
|
||||
async function createMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
const parameters: RecordSet = {
|
||||
mxRecords: [{ exchange: "mail.contoso.com", preference: 0 }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createMxRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateNSRecordset.json
|
||||
*/
|
||||
async function createNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
const parameters: RecordSet = {
|
||||
nsRecords: [{ nsdname: "ns1.contoso.com" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createNsRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdatePTRRecordset.json
|
||||
*/
|
||||
async function createPtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
const parameters: RecordSet = {
|
||||
ptrRecords: [{ ptrdname: "localhost" }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createPtrRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSOARecordset.json
|
||||
*/
|
||||
async function createSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
const parameters: RecordSet = {
|
||||
soaRecord: {
|
||||
email: "hostmaster.contoso.com",
|
||||
expireTime: 2419200,
|
||||
host: "ns1.contoso.com",
|
||||
minimumTtl: 300,
|
||||
refreshTime: 3600,
|
||||
retryTime: 300,
|
||||
serialNumber: 1
|
||||
},
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createSoaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSRVRecordset.json
|
||||
*/
|
||||
async function createSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
const parameters: RecordSet = {
|
||||
srvRecords: [{ port: 80, priority: 0, target: "contoso.com", weight: 10 }],
|
||||
ttl: 3600,
|
||||
metadata: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createSrvRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a record set within a DNS zone.
|
||||
*
|
||||
* @summary Creates or updates a record set within a DNS zone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateTXTRecordset.json
|
||||
*/
|
||||
async function createTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
const parameters: RecordSet = {
|
||||
ttl: 3600,
|
||||
txtRecords: [{ value: ["string1", "string2"] }],
|
||||
metadata: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createTxtRecordset().catch(console.error);
|
|
@ -1,237 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json
|
||||
*/
|
||||
async function deleteARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteARecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteAAAARecordset.json
|
||||
*/
|
||||
async function deleteAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteAaaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteCaaRecordset.json
|
||||
*/
|
||||
async function deleteCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteCaaRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json
|
||||
*/
|
||||
async function deleteCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteCnameRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json
|
||||
*/
|
||||
async function deleteMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteMxRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json
|
||||
*/
|
||||
async function deleteNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteNsRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeletePTRRecordset.json
|
||||
*/
|
||||
async function deletePtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deletePtrRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteSRVRecordset.json
|
||||
*/
|
||||
async function deleteSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteSrvRecordset().catch(console.error);
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteTXTRecordset.json
|
||||
*/
|
||||
async function deleteTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.delete(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteTxtRecordset().catch(console.error);
|
|
@ -11,18 +11,20 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
|||
import {
|
||||
PipelineRequest,
|
||||
PipelineResponse,
|
||||
SendRequest
|
||||
SendRequest,
|
||||
} from "@azure/core-rest-pipeline";
|
||||
import * as coreAuth from "@azure/core-auth";
|
||||
import {
|
||||
DnssecConfigsImpl,
|
||||
RecordSetsImpl,
|
||||
ZonesImpl,
|
||||
DnsResourceReferenceOperationsImpl
|
||||
DnsResourceReferenceOperationsImpl,
|
||||
} from "./operations";
|
||||
import {
|
||||
DnssecConfigs,
|
||||
RecordSets,
|
||||
Zones,
|
||||
DnsResourceReferenceOperations
|
||||
DnsResourceReferenceOperations,
|
||||
} from "./operationsInterfaces";
|
||||
import { DnsManagementClientOptionalParams } from "./models";
|
||||
|
||||
|
@ -34,14 +36,13 @@ export class DnsManagementClient extends coreClient.ServiceClient {
|
|||
/**
|
||||
* Initializes a new instance of the DnsManagementClient class.
|
||||
* @param credentials Subscription credentials which uniquely identify client subscription.
|
||||
* @param subscriptionId Specifies the Azure subscription ID, which uniquely identifies the Microsoft
|
||||
* Azure subscription.
|
||||
* @param subscriptionId The ID of the target subscription.
|
||||
* @param options The parameter options
|
||||
*/
|
||||
constructor(
|
||||
credentials: coreAuth.TokenCredential,
|
||||
subscriptionId: string,
|
||||
options?: DnsManagementClientOptionalParams
|
||||
options?: DnsManagementClientOptionalParams,
|
||||
) {
|
||||
if (credentials === undefined) {
|
||||
throw new Error("'credentials' cannot be null");
|
||||
|
@ -56,10 +57,10 @@ export class DnsManagementClient extends coreClient.ServiceClient {
|
|||
}
|
||||
const defaults: DnsManagementClientOptionalParams = {
|
||||
requestContentType: "application/json; charset=utf-8",
|
||||
credential: credentials
|
||||
credential: credentials,
|
||||
};
|
||||
|
||||
const packageDetails = `azsdk-js-arm-dns/5.1.1`;
|
||||
const packageDetails = `azsdk-js-arm-dns/5.2.0-beta.1`;
|
||||
const userAgentPrefix =
|
||||
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
||||
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
||||
|
@ -69,20 +70,21 @@ export class DnsManagementClient extends coreClient.ServiceClient {
|
|||
...defaults,
|
||||
...options,
|
||||
userAgentOptions: {
|
||||
userAgentPrefix
|
||||
userAgentPrefix,
|
||||
},
|
||||
endpoint:
|
||||
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
||||
options.endpoint ?? options.baseUri ?? "https://management.azure.com",
|
||||
};
|
||||
super(optionsWithDefaults);
|
||||
|
||||
let bearerTokenAuthenticationPolicyFound: boolean = false;
|
||||
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
||||
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
||||
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =
|
||||
options.pipeline.getOrderedPolicies();
|
||||
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
||||
(pipelinePolicy) =>
|
||||
pipelinePolicy.name ===
|
||||
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
||||
coreRestPipeline.bearerTokenAuthenticationPolicyName,
|
||||
);
|
||||
}
|
||||
if (
|
||||
|
@ -92,7 +94,7 @@ export class DnsManagementClient extends coreClient.ServiceClient {
|
|||
!bearerTokenAuthenticationPolicyFound
|
||||
) {
|
||||
this.pipeline.removePolicy({
|
||||
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
||||
name: coreRestPipeline.bearerTokenAuthenticationPolicyName,
|
||||
});
|
||||
this.pipeline.addPolicy(
|
||||
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
||||
|
@ -102,9 +104,9 @@ export class DnsManagementClient extends coreClient.ServiceClient {
|
|||
`${optionsWithDefaults.endpoint}/.default`,
|
||||
challengeCallbacks: {
|
||||
authorizeRequestOnChallenge:
|
||||
coreClient.authorizeRequestOnClaimChallenge
|
||||
}
|
||||
})
|
||||
coreClient.authorizeRequestOnClaimChallenge,
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
// Parameter assignments
|
||||
|
@ -112,12 +114,12 @@ export class DnsManagementClient extends coreClient.ServiceClient {
|
|||
|
||||
// Assigning values to Constant parameters
|
||||
this.$host = options.$host || "https://management.azure.com";
|
||||
this.apiVersion = options.apiVersion || "2018-05-01";
|
||||
this.apiVersion = options.apiVersion || "2023-07-01-preview";
|
||||
this.dnssecConfigs = new DnssecConfigsImpl(this);
|
||||
this.recordSets = new RecordSetsImpl(this);
|
||||
this.zones = new ZonesImpl(this);
|
||||
this.dnsResourceReferenceOperations = new DnsResourceReferenceOperationsImpl(
|
||||
this
|
||||
);
|
||||
this.dnsResourceReferenceOperations =
|
||||
new DnsResourceReferenceOperationsImpl(this);
|
||||
this.addCustomApiVersionPolicy(options.apiVersion);
|
||||
}
|
||||
|
||||
|
@ -130,7 +132,7 @@ export class DnsManagementClient extends coreClient.ServiceClient {
|
|||
name: "CustomApiVersionPolicy",
|
||||
async sendRequest(
|
||||
request: PipelineRequest,
|
||||
next: SendRequest
|
||||
next: SendRequest,
|
||||
): Promise<PipelineResponse> {
|
||||
const param = request.url.split("?");
|
||||
if (param.length > 1) {
|
||||
|
@ -144,11 +146,12 @@ export class DnsManagementClient extends coreClient.ServiceClient {
|
|||
request.url = param[0] + "?" + newParams.join("&");
|
||||
}
|
||||
return next(request);
|
||||
}
|
||||
},
|
||||
};
|
||||
this.pipeline.addPolicy(apiVersionPolicy);
|
||||
}
|
||||
|
||||
dnssecConfigs: DnssecConfigs;
|
||||
recordSets: RecordSets;
|
||||
zones: Zones;
|
||||
dnsResourceReferenceOperations: DnsResourceReferenceOperations;
|
||||
|
|
|
@ -6,29 +6,37 @@
|
|||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
import { AbortSignalLike } from "@azure/abort-controller";
|
||||
import { LongRunningOperation, LroResponse } from "@azure/core-lro";
|
||||
|
||||
export class LroImpl<T> implements LongRunningOperation<T> {
|
||||
constructor(
|
||||
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
|
||||
private args: Record<string, unknown>,
|
||||
private spec: {
|
||||
readonly requestBody?: unknown;
|
||||
readonly path?: string;
|
||||
readonly httpMethod: string;
|
||||
} & Record<string, any>,
|
||||
public requestPath: string = spec.path!,
|
||||
public requestMethod: string = spec.httpMethod
|
||||
) {}
|
||||
public async sendInitialRequest(): Promise<LroResponse<T>> {
|
||||
return this.sendOperationFn(this.args, this.spec);
|
||||
}
|
||||
public async sendPollRequest(path: string): Promise<LroResponse<T>> {
|
||||
const { requestBody, ...restSpec } = this.spec;
|
||||
return this.sendOperationFn(this.args, {
|
||||
...restSpec,
|
||||
path,
|
||||
httpMethod: "GET"
|
||||
});
|
||||
}
|
||||
export function createLroSpec<T>(inputs: {
|
||||
sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;
|
||||
args: Record<string, unknown>;
|
||||
spec: {
|
||||
readonly requestBody?: unknown;
|
||||
readonly path?: string;
|
||||
readonly httpMethod: string;
|
||||
} & Record<string, any>;
|
||||
}): LongRunningOperation<T> {
|
||||
const { args, spec, sendOperationFn } = inputs;
|
||||
return {
|
||||
requestMethod: spec.httpMethod,
|
||||
requestPath: spec.path!,
|
||||
sendInitialRequest: () => sendOperationFn(args, spec),
|
||||
sendPollRequest: (
|
||||
path: string,
|
||||
options?: { abortSignal?: AbortSignalLike },
|
||||
) => {
|
||||
const { requestBody, ...restSpec } = spec;
|
||||
return sendOperationFn(args, {
|
||||
...restSpec,
|
||||
httpMethod: "GET",
|
||||
path,
|
||||
abortSignal: options?.abortSignal,
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,6 +8,140 @@
|
|||
|
||||
import * as coreClient from "@azure/core-client";
|
||||
|
||||
/** Represents the DNSSEC configuration. */
|
||||
export interface DnssecConfig {
|
||||
/**
|
||||
* The ID of the DNSSEC configuration.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly id?: string;
|
||||
/**
|
||||
* The name of the DNSSEC configuration.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly name?: string;
|
||||
/**
|
||||
* The type of the DNSSEC configuration.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly type?: string;
|
||||
/** The etag of the DNSSEC configuration. */
|
||||
etag?: string;
|
||||
/**
|
||||
* Metadata pertaining to creation and last modification of the resource.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly systemData?: SystemData;
|
||||
/**
|
||||
* Provisioning State of the DNSSEC configuration.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly provisioningState?: string;
|
||||
/**
|
||||
* The list of signing keys.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly signingKeys?: SigningKey[];
|
||||
}
|
||||
|
||||
/** Represents the signing key. */
|
||||
export interface SigningKey {
|
||||
/**
|
||||
* The delegation signer information.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly delegationSignerInfo?: DelegationSignerInfo[];
|
||||
/**
|
||||
* The flags specifies how the key is used.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly flags?: number;
|
||||
/**
|
||||
* The key tag value of the DNSKEY Resource Record.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly keyTag?: number;
|
||||
/**
|
||||
* The protocol value. The value is always 3.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly protocol?: number;
|
||||
/**
|
||||
* The public key, represented as a Base64 encoding.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly publicKey?: string;
|
||||
/**
|
||||
* The security algorithm type represents the standard security algorithm number of the DNSKEY Resource Record. See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly securityAlgorithmType?: number;
|
||||
}
|
||||
|
||||
/** The delegation signer information. */
|
||||
export interface DelegationSignerInfo {
|
||||
/**
|
||||
* The digest algorithm type represents the standard digest algorithm number used to construct the digest. See: https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly digestAlgorithmType?: number;
|
||||
/**
|
||||
* The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly digestValue?: string;
|
||||
/**
|
||||
* The record represents a delegation signer (DS) record.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly record?: string;
|
||||
}
|
||||
|
||||
/** Metadata pertaining to creation and last modification of the resource. */
|
||||
export interface SystemData {
|
||||
/** The identity that created the resource. */
|
||||
createdBy?: string;
|
||||
/** The type of identity that created the resource. */
|
||||
createdByType?: CreatedByType;
|
||||
/** The timestamp of resource creation (UTC). */
|
||||
createdAt?: Date;
|
||||
/** The identity that last modified the resource. */
|
||||
lastModifiedBy?: string;
|
||||
/** The type of identity that last modified the resource. */
|
||||
lastModifiedByType?: CreatedByType;
|
||||
/** The timestamp of resource last modification (UTC) */
|
||||
lastModifiedAt?: Date;
|
||||
}
|
||||
|
||||
/** An error response from the service. */
|
||||
export interface CloudError {
|
||||
/** Cloud error body. */
|
||||
error?: CloudErrorBody;
|
||||
}
|
||||
|
||||
/** An error response from the service. */
|
||||
export interface CloudErrorBody {
|
||||
/** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */
|
||||
code?: string;
|
||||
/** A message describing the error, intended to be suitable for display in a user interface. */
|
||||
message?: string;
|
||||
/** The target of the particular error. For example, the name of the property in error. */
|
||||
target?: string;
|
||||
/** A list of additional details about the error. */
|
||||
details?: CloudErrorBody[];
|
||||
}
|
||||
|
||||
/** The response to a List DNSSEC configurations operation. */
|
||||
export interface DnssecConfigListResult {
|
||||
/** Information about the DNSSEC configurations in the response. */
|
||||
value?: DnssecConfig[];
|
||||
/**
|
||||
* The continuation token for the next page of results.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly nextLink?: string;
|
||||
}
|
||||
|
||||
/** Describes a DNS record set (a collection of DNS records with the same name and type). */
|
||||
export interface RecordSet {
|
||||
/**
|
||||
|
@ -43,6 +177,8 @@ export interface RecordSet {
|
|||
readonly provisioningState?: string;
|
||||
/** A reference to an azure resource from where the dns resource value is taken. */
|
||||
targetResource?: SubResource;
|
||||
/** A reference to an azure traffic manager profile resource from where the dns resource value is taken. */
|
||||
trafficManagementProfile?: SubResource;
|
||||
/** The list of A records in the record set. */
|
||||
aRecords?: ARecord[];
|
||||
/** The list of AAAA records in the record set. */
|
||||
|
@ -63,6 +199,12 @@ export interface RecordSet {
|
|||
soaRecord?: SoaRecord;
|
||||
/** The list of CAA records in the record set. */
|
||||
caaRecords?: CaaRecord[];
|
||||
/** The list of DS records in the record set. */
|
||||
dsRecords?: DsRecord[];
|
||||
/** The list of TLSA records in the record set. */
|
||||
tlsaRecords?: TlsaRecord[];
|
||||
/** The list of NAPTR records in the record set. */
|
||||
naptrRecords?: NaptrRecord[];
|
||||
}
|
||||
|
||||
/** A reference to a another resource */
|
||||
|
@ -155,22 +297,50 @@ export interface CaaRecord {
|
|||
value?: string;
|
||||
}
|
||||
|
||||
/** An error response from the service. */
|
||||
export interface CloudError {
|
||||
/** Cloud error body. */
|
||||
error?: CloudErrorBody;
|
||||
/** A DS record. For more information about the DS record format, see RFC 4034: https://www.rfc-editor.org/rfc/rfc4034 */
|
||||
export interface DsRecord {
|
||||
/** The key tag value is used to determine which DNSKEY Resource Record is used for signature verification. */
|
||||
keyTag?: number;
|
||||
/** The security algorithm type represents the standard security algorithm number of the DNSKEY Resource Record. See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml */
|
||||
algorithm?: number;
|
||||
/** The digest entity. */
|
||||
digest?: Digest;
|
||||
}
|
||||
|
||||
/** An error response from the service. */
|
||||
export interface CloudErrorBody {
|
||||
/** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */
|
||||
code?: string;
|
||||
/** A message describing the error, intended to be suitable for display in a user interface. */
|
||||
message?: string;
|
||||
/** The target of the particular error. For example, the name of the property in error. */
|
||||
target?: string;
|
||||
/** A list of additional details about the error. */
|
||||
details?: CloudErrorBody[];
|
||||
/** A digest. */
|
||||
export interface Digest {
|
||||
/** The digest algorithm type represents the standard digest algorithm number used to construct the digest. See: https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml */
|
||||
algorithmType?: number;
|
||||
/** The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record. */
|
||||
value?: string;
|
||||
}
|
||||
|
||||
/** A TLSA record. For more information about the TLSA record format, see RFC 6698: https://www.rfc-editor.org/rfc/rfc6698 */
|
||||
export interface TlsaRecord {
|
||||
/** The usage specifies the provided association that will be used to match the certificate presented in the TLS handshake. */
|
||||
usage?: number;
|
||||
/** The selector specifies which part of the TLS certificate presented by the server will be matched against the association data. */
|
||||
selector?: number;
|
||||
/** The matching type specifies how the certificate association is presented. */
|
||||
matchingType?: number;
|
||||
/** This specifies the certificate association data to be matched. */
|
||||
certAssociationData?: string;
|
||||
}
|
||||
|
||||
/** A NAPTR record. For more information about the NAPTR record format, see RFC 3403: https://www.rfc-editor.org/rfc/rfc3403 */
|
||||
export interface NaptrRecord {
|
||||
/** The order in which the NAPTR records MUST be processed in order to accurately represent the ordered list of rules. The ordering is from lowest to highest. Valid values: 0-65535. */
|
||||
order?: number;
|
||||
/** The preference specifies the order in which NAPTR records with equal 'order' values should be processed, low numbers being processed before high numbers. Valid values: 0-65535. */
|
||||
preference?: number;
|
||||
/** The flags specific to DDDS applications. Values currently defined in RFC 3404 are uppercase and lowercase letters "A", "P", "S", and "U", and the empty string, "". Enclose Flags in quotation marks. */
|
||||
flags?: string;
|
||||
/** The services specific to DDDS applications. Enclose Services in quotation marks. */
|
||||
services?: string;
|
||||
/** The regular expression that the DDDS application uses to convert an input value into an output value. For example: an IP phone system might use a regular expression to convert a phone number that is entered by a user into a SIP URI. Enclose the regular expression in quotation marks. Specify either a value for 'regexp' or a value for 'replacement'. */
|
||||
regexp?: string;
|
||||
/** The replacement is a fully qualified domain name (FQDN) of the next domain name that you want the DDDS application to submit a DNS query for. The DDDS application replaces the input value with the value specified for replacement. Specify either a value for 'regexp' or a value for 'replacement'. If you specify a value for 'regexp', specify a dot (.) for 'replacement'. */
|
||||
replacement?: string;
|
||||
}
|
||||
|
||||
/** The response to a record set List operation. */
|
||||
|
@ -254,6 +424,11 @@ export interface RecordSetUpdateParameters {
|
|||
export interface Zone extends Resource {
|
||||
/** The etag of the zone. */
|
||||
etag?: string;
|
||||
/**
|
||||
* Metadata pertaining to creation and last modification of the resource.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly systemData?: SystemData;
|
||||
/**
|
||||
* The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
|
@ -280,8 +455,48 @@ export interface Zone extends Resource {
|
|||
registrationVirtualNetworks?: SubResource[];
|
||||
/** A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private. */
|
||||
resolutionVirtualNetworks?: SubResource[];
|
||||
/**
|
||||
* The list of signing keys.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly signingKeys?: SigningKey[];
|
||||
}
|
||||
|
||||
/** Defines headers for DnssecConfigs_delete operation. */
|
||||
export interface DnssecConfigsDeleteHeaders {
|
||||
/** Location URI to poll for result */
|
||||
location?: string;
|
||||
}
|
||||
|
||||
/** Defines headers for Zones_delete operation. */
|
||||
export interface ZonesDeleteHeaders {
|
||||
/** Location URI to poll for result */
|
||||
location?: string;
|
||||
}
|
||||
|
||||
/** Known values of {@link CreatedByType} that the service accepts. */
|
||||
export enum KnownCreatedByType {
|
||||
/** User */
|
||||
User = "User",
|
||||
/** Application */
|
||||
Application = "Application",
|
||||
/** ManagedIdentity */
|
||||
ManagedIdentity = "ManagedIdentity",
|
||||
/** Key */
|
||||
Key = "Key",
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for CreatedByType. \
|
||||
* {@link KnownCreatedByType} can be used interchangeably with CreatedByType,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **User** \
|
||||
* **Application** \
|
||||
* **ManagedIdentity** \
|
||||
* **Key**
|
||||
*/
|
||||
export type CreatedByType = string;
|
||||
/** Defines values for RecordType. */
|
||||
export type RecordType =
|
||||
| "A"
|
||||
|
@ -293,10 +508,61 @@ export type RecordType =
|
|||
| "PTR"
|
||||
| "SOA"
|
||||
| "SRV"
|
||||
| "TXT";
|
||||
| "TXT"
|
||||
| "TLSA"
|
||||
| "DS"
|
||||
| "NAPTR";
|
||||
/** Defines values for ZoneType. */
|
||||
export type ZoneType = "Public" | "Private";
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DnssecConfigsCreateOrUpdateOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. */
|
||||
ifMatch?: string;
|
||||
/** Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing DNSSEC configuration. Other values will be ignored. */
|
||||
ifNoneMatch?: string;
|
||||
/** Delay to wait until next poll, in milliseconds. */
|
||||
updateIntervalInMs?: number;
|
||||
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
|
||||
resumeFrom?: string;
|
||||
}
|
||||
|
||||
/** Contains response data for the createOrUpdate operation. */
|
||||
export type DnssecConfigsCreateOrUpdateResponse = DnssecConfig;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DnssecConfigsDeleteOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. */
|
||||
ifMatch?: string;
|
||||
/** Delay to wait until next poll, in milliseconds. */
|
||||
updateIntervalInMs?: number;
|
||||
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
|
||||
resumeFrom?: string;
|
||||
}
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DnssecConfigsGetOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the get operation. */
|
||||
export type DnssecConfigsGetResponse = DnssecConfig;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DnssecConfigsListByDnsZoneOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByDnsZone operation. */
|
||||
export type DnssecConfigsListByDnsZoneResponse = DnssecConfigListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DnssecConfigsListByDnsZoneNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByDnsZoneNext operation. */
|
||||
export type DnssecConfigsListByDnsZoneNextResponse = DnssecConfigListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface RecordSetsUpdateOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
|
@ -371,36 +637,21 @@ export type RecordSetsListAllByDnsZoneResponse = RecordSetListResult;
|
|||
|
||||
/** Optional parameters. */
|
||||
export interface RecordSetsListByTypeNextOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */
|
||||
top?: number;
|
||||
/** The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> */
|
||||
recordsetnamesuffix?: string;
|
||||
}
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByTypeNext operation. */
|
||||
export type RecordSetsListByTypeNextResponse = RecordSetListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface RecordSetsListByDnsZoneNextOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */
|
||||
top?: number;
|
||||
/** The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> */
|
||||
recordsetnamesuffix?: string;
|
||||
}
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByDnsZoneNext operation. */
|
||||
export type RecordSetsListByDnsZoneNextResponse = RecordSetListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface RecordSetsListAllByDnsZoneNextOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */
|
||||
top?: number;
|
||||
/** The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> */
|
||||
recordSetNameSuffix?: string;
|
||||
}
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listAllByDnsZoneNext operation. */
|
||||
export type RecordSetsListAllByDnsZoneNextResponse = RecordSetListResult;
|
||||
|
@ -463,20 +714,14 @@ export type ZonesListResponse = ZoneListResult;
|
|||
|
||||
/** Optional parameters. */
|
||||
export interface ZonesListByResourceGroupNextOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */
|
||||
top?: number;
|
||||
}
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByResourceGroupNext operation. */
|
||||
export type ZonesListByResourceGroupNextResponse = ZoneListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ZonesListNextOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** The maximum number of DNS zones to return. If not specified, returns up to 100 zones. */
|
||||
top?: number;
|
||||
}
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listNext operation. */
|
||||
export type ZonesListNextResponse = ZoneListResult;
|
||||
|
@ -486,7 +731,8 @@ export interface DnsResourceReferenceGetByTargetResourcesOptionalParams
|
|||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the getByTargetResources operation. */
|
||||
export type DnsResourceReferenceGetByTargetResourcesResponse = DnsResourceReferenceResult;
|
||||
export type DnsResourceReferenceGetByTargetResourcesResponse =
|
||||
DnsResourceReferenceResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DnsManagementClientOptionalParams
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -9,32 +9,15 @@
|
|||
import {
|
||||
OperationParameter,
|
||||
OperationURLParameter,
|
||||
OperationQueryParameter
|
||||
OperationQueryParameter,
|
||||
} from "@azure/core-client";
|
||||
import {
|
||||
RecordSet as RecordSetMapper,
|
||||
Zone as ZoneMapper,
|
||||
ZoneUpdate as ZoneUpdateMapper,
|
||||
DnsResourceReferenceRequest as DnsResourceReferenceRequestMapper
|
||||
DnsResourceReferenceRequest as DnsResourceReferenceRequestMapper,
|
||||
} from "../models/mappers";
|
||||
|
||||
export const contentType: OperationParameter = {
|
||||
parameterPath: ["options", "contentType"],
|
||||
mapper: {
|
||||
defaultValue: "application/json",
|
||||
isConstant: true,
|
||||
serializedName: "Content-Type",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const parameters: OperationParameter = {
|
||||
parameterPath: "parameters",
|
||||
mapper: RecordSetMapper
|
||||
};
|
||||
|
||||
export const accept: OperationParameter = {
|
||||
parameterPath: "accept",
|
||||
mapper: {
|
||||
|
@ -42,9 +25,9 @@ export const accept: OperationParameter = {
|
|||
isConstant: true,
|
||||
serializedName: "Accept",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const $host: OperationURLParameter = {
|
||||
|
@ -53,21 +36,25 @@ export const $host: OperationURLParameter = {
|
|||
serializedName: "$host",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
skipEncoding: true
|
||||
skipEncoding: true,
|
||||
};
|
||||
|
||||
export const resourceGroupName: OperationURLParameter = {
|
||||
parameterPath: "resourceGroupName",
|
||||
mapper: {
|
||||
constraints: {
|
||||
MaxLength: 90,
|
||||
MinLength: 1,
|
||||
},
|
||||
serializedName: "resourceGroupName",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const zoneName: OperationURLParameter = {
|
||||
|
@ -76,9 +63,84 @@ export const zoneName: OperationURLParameter = {
|
|||
serializedName: "zoneName",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const ifMatch: OperationParameter = {
|
||||
parameterPath: ["options", "ifMatch"],
|
||||
mapper: {
|
||||
serializedName: "If-Match",
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const ifNoneMatch: OperationParameter = {
|
||||
parameterPath: ["options", "ifNoneMatch"],
|
||||
mapper: {
|
||||
serializedName: "If-None-Match",
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const apiVersion: OperationQueryParameter = {
|
||||
parameterPath: "apiVersion",
|
||||
mapper: {
|
||||
defaultValue: "2023-07-01-preview",
|
||||
isConstant: true,
|
||||
serializedName: "api-version",
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const subscriptionId: OperationURLParameter = {
|
||||
parameterPath: "subscriptionId",
|
||||
mapper: {
|
||||
constraints: {
|
||||
MinLength: 1,
|
||||
},
|
||||
serializedName: "subscriptionId",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const nextLink: OperationURLParameter = {
|
||||
parameterPath: "nextLink",
|
||||
mapper: {
|
||||
serializedName: "nextLink",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
skipEncoding: true,
|
||||
};
|
||||
|
||||
export const contentType: OperationParameter = {
|
||||
parameterPath: ["options", "contentType"],
|
||||
mapper: {
|
||||
defaultValue: "application/json",
|
||||
isConstant: true,
|
||||
serializedName: "Content-Type",
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const parameters: OperationParameter = {
|
||||
parameterPath: "parameters",
|
||||
mapper: RecordSetMapper,
|
||||
};
|
||||
|
||||
export const relativeRecordSetName: OperationURLParameter = {
|
||||
|
@ -87,10 +149,10 @@ export const relativeRecordSetName: OperationURLParameter = {
|
|||
serializedName: "relativeRecordSetName",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
skipEncoding: true
|
||||
skipEncoding: true,
|
||||
};
|
||||
|
||||
export const recordType: OperationURLParameter = {
|
||||
|
@ -110,53 +172,13 @@ export const recordType: OperationURLParameter = {
|
|||
"PTR",
|
||||
"SOA",
|
||||
"SRV",
|
||||
"TXT"
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ifMatch: OperationParameter = {
|
||||
parameterPath: ["options", "ifMatch"],
|
||||
mapper: {
|
||||
serializedName: "If-Match",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const apiVersion: OperationQueryParameter = {
|
||||
parameterPath: "apiVersion",
|
||||
mapper: {
|
||||
defaultValue: "2018-05-01",
|
||||
isConstant: true,
|
||||
serializedName: "api-version",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const subscriptionId: OperationURLParameter = {
|
||||
parameterPath: "subscriptionId",
|
||||
mapper: {
|
||||
serializedName: "subscriptionId",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ifNoneMatch: OperationParameter = {
|
||||
parameterPath: ["options", "ifNoneMatch"],
|
||||
mapper: {
|
||||
serializedName: "If-None-Match",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
"TXT",
|
||||
"TLSA",
|
||||
"DS",
|
||||
"NAPTR",
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const top: OperationQueryParameter = {
|
||||
|
@ -164,9 +186,9 @@ export const top: OperationQueryParameter = {
|
|||
mapper: {
|
||||
serializedName: "$top",
|
||||
type: {
|
||||
name: "Number"
|
||||
}
|
||||
}
|
||||
name: "Number",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const recordsetnamesuffix: OperationQueryParameter = {
|
||||
|
@ -174,9 +196,9 @@ export const recordsetnamesuffix: OperationQueryParameter = {
|
|||
mapper: {
|
||||
serializedName: "$recordsetnamesuffix",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const recordSetNameSuffix: OperationQueryParameter = {
|
||||
|
@ -184,34 +206,22 @@ export const recordSetNameSuffix: OperationQueryParameter = {
|
|||
mapper: {
|
||||
serializedName: "$recordsetnamesuffix",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const nextLink: OperationURLParameter = {
|
||||
parameterPath: "nextLink",
|
||||
mapper: {
|
||||
serializedName: "nextLink",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
skipEncoding: true
|
||||
};
|
||||
|
||||
export const parameters1: OperationParameter = {
|
||||
parameterPath: "parameters",
|
||||
mapper: ZoneMapper
|
||||
mapper: ZoneMapper,
|
||||
};
|
||||
|
||||
export const parameters2: OperationParameter = {
|
||||
parameterPath: "parameters",
|
||||
mapper: ZoneUpdateMapper
|
||||
mapper: ZoneUpdateMapper,
|
||||
};
|
||||
|
||||
export const parameters3: OperationParameter = {
|
||||
parameterPath: "parameters",
|
||||
mapper: DnsResourceReferenceRequestMapper
|
||||
mapper: DnsResourceReferenceRequestMapper,
|
||||
};
|
||||
|
|
|
@ -14,12 +14,13 @@ import { DnsManagementClient } from "../dnsManagementClient";
|
|||
import {
|
||||
DnsResourceReferenceRequest,
|
||||
DnsResourceReferenceGetByTargetResourcesOptionalParams,
|
||||
DnsResourceReferenceGetByTargetResourcesResponse
|
||||
DnsResourceReferenceGetByTargetResourcesResponse,
|
||||
} from "../models";
|
||||
|
||||
/** Class containing DnsResourceReferenceOperations operations. */
|
||||
export class DnsResourceReferenceOperationsImpl
|
||||
implements DnsResourceReferenceOperations {
|
||||
implements DnsResourceReferenceOperations
|
||||
{
|
||||
private readonly client: DnsManagementClient;
|
||||
|
||||
/**
|
||||
|
@ -37,11 +38,11 @@ export class DnsResourceReferenceOperationsImpl
|
|||
*/
|
||||
getByTargetResources(
|
||||
parameters: DnsResourceReferenceRequest,
|
||||
options?: DnsResourceReferenceGetByTargetResourcesOptionalParams
|
||||
options?: DnsResourceReferenceGetByTargetResourcesOptionalParams,
|
||||
): Promise<DnsResourceReferenceGetByTargetResourcesResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ parameters, options },
|
||||
getByTargetResourcesOperationSpec
|
||||
getByTargetResourcesOperationSpec,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -49,21 +50,20 @@ export class DnsResourceReferenceOperationsImpl
|
|||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const getByTargetResourcesOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/providers/Microsoft.Network/getDnsResourceReference",
|
||||
path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/getDnsResourceReference",
|
||||
httpMethod: "POST",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.DnsResourceReferenceResult
|
||||
bodyMapper: Mappers.DnsResourceReferenceResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
requestBody: Parameters.parameters3,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
||||
headerParameters: [Parameters.contentType, Parameters.accept],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
|
|
|
@ -0,0 +1,468 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
||||
import { setContinuationToken } from "../pagingHelper";
|
||||
import { DnssecConfigs } from "../operationsInterfaces";
|
||||
import * as coreClient from "@azure/core-client";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { DnsManagementClient } from "../dnsManagementClient";
|
||||
import {
|
||||
SimplePollerLike,
|
||||
OperationState,
|
||||
createHttpPoller,
|
||||
} from "@azure/core-lro";
|
||||
import { createLroSpec } from "../lroImpl";
|
||||
import {
|
||||
DnssecConfig,
|
||||
DnssecConfigsListByDnsZoneNextOptionalParams,
|
||||
DnssecConfigsListByDnsZoneOptionalParams,
|
||||
DnssecConfigsListByDnsZoneResponse,
|
||||
DnssecConfigsCreateOrUpdateOptionalParams,
|
||||
DnssecConfigsCreateOrUpdateResponse,
|
||||
DnssecConfigsDeleteOptionalParams,
|
||||
DnssecConfigsGetOptionalParams,
|
||||
DnssecConfigsGetResponse,
|
||||
DnssecConfigsListByDnsZoneNextResponse,
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Class containing DnssecConfigs operations. */
|
||||
export class DnssecConfigsImpl implements DnssecConfigs {
|
||||
private readonly client: DnsManagementClient;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class DnssecConfigs class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: DnsManagementClient) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the DNSSEC configurations in a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public listByDnsZone(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsListByDnsZoneOptionalParams,
|
||||
): PagedAsyncIterableIterator<DnssecConfig> {
|
||||
const iter = this.listByDnsZonePagingAll(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
options,
|
||||
);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: (settings?: PageSettings) => {
|
||||
if (settings?.maxPageSize) {
|
||||
throw new Error("maxPageSize is not supported by this operation.");
|
||||
}
|
||||
return this.listByDnsZonePagingPage(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
options,
|
||||
settings,
|
||||
);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
private async *listByDnsZonePagingPage(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsListByDnsZoneOptionalParams,
|
||||
settings?: PageSettings,
|
||||
): AsyncIterableIterator<DnssecConfig[]> {
|
||||
let result: DnssecConfigsListByDnsZoneResponse;
|
||||
let continuationToken = settings?.continuationToken;
|
||||
if (!continuationToken) {
|
||||
result = await this._listByDnsZone(resourceGroupName, zoneName, options);
|
||||
let page = result.value || [];
|
||||
continuationToken = result.nextLink;
|
||||
setContinuationToken(page, continuationToken);
|
||||
yield page;
|
||||
}
|
||||
while (continuationToken) {
|
||||
result = await this._listByDnsZoneNext(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
continuationToken,
|
||||
options,
|
||||
);
|
||||
continuationToken = result.nextLink;
|
||||
let page = result.value || [];
|
||||
setContinuationToken(page, continuationToken);
|
||||
yield page;
|
||||
}
|
||||
}
|
||||
|
||||
private async *listByDnsZonePagingAll(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsListByDnsZoneOptionalParams,
|
||||
): AsyncIterableIterator<DnssecConfig> {
|
||||
for await (const page of this.listByDnsZonePagingPage(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
options,
|
||||
)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates or updates the DNSSEC configuration on a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginCreateOrUpdate(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsCreateOrUpdateOptionalParams,
|
||||
): Promise<
|
||||
SimplePollerLike<
|
||||
OperationState<DnssecConfigsCreateOrUpdateResponse>,
|
||||
DnssecConfigsCreateOrUpdateResponse
|
||||
>
|
||||
> {
|
||||
const directSendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec,
|
||||
): Promise<DnssecConfigsCreateOrUpdateResponse> => {
|
||||
return this.client.sendOperationRequest(args, spec);
|
||||
};
|
||||
const sendOperationFn = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec,
|
||||
) => {
|
||||
let currentRawResponse: coreClient.FullOperationResponse | undefined =
|
||||
undefined;
|
||||
const providedCallback = args.options?.onResponse;
|
||||
const callback: coreClient.RawResponseCallback = (
|
||||
rawResponse: coreClient.FullOperationResponse,
|
||||
flatResponse: unknown,
|
||||
) => {
|
||||
currentRawResponse = rawResponse;
|
||||
providedCallback?.(rawResponse, flatResponse);
|
||||
};
|
||||
const updatedArgs = {
|
||||
...args,
|
||||
options: {
|
||||
...args.options,
|
||||
onResponse: callback,
|
||||
},
|
||||
};
|
||||
const flatResponse = await directSendOperation(updatedArgs, spec);
|
||||
return {
|
||||
flatResponse,
|
||||
rawResponse: {
|
||||
statusCode: currentRawResponse!.status,
|
||||
body: currentRawResponse!.parsedBody,
|
||||
headers: currentRawResponse!.headers.toJSON(),
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const lro = createLroSpec({
|
||||
sendOperationFn,
|
||||
args: { resourceGroupName, zoneName, options },
|
||||
spec: createOrUpdateOperationSpec,
|
||||
});
|
||||
const poller = await createHttpPoller<
|
||||
DnssecConfigsCreateOrUpdateResponse,
|
||||
OperationState<DnssecConfigsCreateOrUpdateResponse>
|
||||
>(lro, {
|
||||
restoreFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs,
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates or updates the DNSSEC configuration on a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginCreateOrUpdateAndWait(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsCreateOrUpdateOptionalParams,
|
||||
): Promise<DnssecConfigsCreateOrUpdateResponse> {
|
||||
const poller = await this.beginCreateOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
options,
|
||||
);
|
||||
return poller.pollUntilDone();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginDelete(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsDeleteOptionalParams,
|
||||
): Promise<SimplePollerLike<OperationState<void>, void>> {
|
||||
const directSendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec,
|
||||
): Promise<void> => {
|
||||
return this.client.sendOperationRequest(args, spec);
|
||||
};
|
||||
const sendOperationFn = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec,
|
||||
) => {
|
||||
let currentRawResponse: coreClient.FullOperationResponse | undefined =
|
||||
undefined;
|
||||
const providedCallback = args.options?.onResponse;
|
||||
const callback: coreClient.RawResponseCallback = (
|
||||
rawResponse: coreClient.FullOperationResponse,
|
||||
flatResponse: unknown,
|
||||
) => {
|
||||
currentRawResponse = rawResponse;
|
||||
providedCallback?.(rawResponse, flatResponse);
|
||||
};
|
||||
const updatedArgs = {
|
||||
...args,
|
||||
options: {
|
||||
...args.options,
|
||||
onResponse: callback,
|
||||
},
|
||||
};
|
||||
const flatResponse = await directSendOperation(updatedArgs, spec);
|
||||
return {
|
||||
flatResponse,
|
||||
rawResponse: {
|
||||
statusCode: currentRawResponse!.status,
|
||||
body: currentRawResponse!.parsedBody,
|
||||
headers: currentRawResponse!.headers.toJSON(),
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const lro = createLroSpec({
|
||||
sendOperationFn,
|
||||
args: { resourceGroupName, zoneName, options },
|
||||
spec: deleteOperationSpec,
|
||||
});
|
||||
const poller = await createHttpPoller<void, OperationState<void>>(lro, {
|
||||
restoreFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs,
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginDeleteAndWait(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsDeleteOptionalParams,
|
||||
): Promise<void> {
|
||||
const poller = await this.beginDelete(resourceGroupName, zoneName, options);
|
||||
return poller.pollUntilDone();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the DNSSEC configuration.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsGetOptionalParams,
|
||||
): Promise<DnssecConfigsGetResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, zoneName, options },
|
||||
getOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the DNSSEC configurations in a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listByDnsZone(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsListByDnsZoneOptionalParams,
|
||||
): Promise<DnssecConfigsListByDnsZoneResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, zoneName, options },
|
||||
listByDnsZoneOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListByDnsZoneNext
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param nextLink The nextLink from the previous successful call to the ListByDnsZone method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listByDnsZoneNext(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
nextLink: string,
|
||||
options?: DnssecConfigsListByDnsZoneNextOptionalParams,
|
||||
): Promise<DnssecConfigsListByDnsZoneNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, zoneName, nextLink, options },
|
||||
listByDnsZoneNextOperationSpec,
|
||||
);
|
||||
}
|
||||
}
|
||||
// Operation Specifications
|
||||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs/default",
|
||||
httpMethod: "PUT",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.DnssecConfig,
|
||||
},
|
||||
201: {
|
||||
bodyMapper: Mappers.DnssecConfig,
|
||||
},
|
||||
202: {
|
||||
bodyMapper: Mappers.DnssecConfig,
|
||||
},
|
||||
204: {
|
||||
bodyMapper: Mappers.DnssecConfig,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId,
|
||||
],
|
||||
headerParameters: [
|
||||
Parameters.accept,
|
||||
Parameters.ifMatch,
|
||||
Parameters.ifNoneMatch,
|
||||
],
|
||||
serializer,
|
||||
};
|
||||
const deleteOperationSpec: coreClient.OperationSpec = {
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs/default",
|
||||
httpMethod: "DELETE",
|
||||
responses: {
|
||||
200: {},
|
||||
201: {},
|
||||
202: {},
|
||||
204: {},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId,
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.ifMatch],
|
||||
serializer,
|
||||
};
|
||||
const getOperationSpec: coreClient.OperationSpec = {
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs/default",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.DnssecConfig,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer,
|
||||
};
|
||||
const listByDnsZoneOperationSpec: coreClient.OperationSpec = {
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.DnssecConfigListResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer,
|
||||
};
|
||||
const listByDnsZoneNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.DnssecConfigListResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.nextLink,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer,
|
||||
};
|
|
@ -6,6 +6,7 @@
|
|||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
export * from "./dnssecConfigs";
|
||||
export * from "./recordSets";
|
||||
export * from "./zones";
|
||||
export * from "./dnsResourceReferenceOperations";
|
||||
|
|
|
@ -34,7 +34,7 @@ import {
|
|||
RecordSetsGetResponse,
|
||||
RecordSetsListByTypeNextResponse,
|
||||
RecordSetsListByDnsZoneNextResponse,
|
||||
RecordSetsListAllByDnsZoneNextResponse
|
||||
RecordSetsListAllByDnsZoneNextResponse,
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
|
@ -52,22 +52,22 @@ export class RecordSetsImpl implements RecordSets {
|
|||
|
||||
/**
|
||||
* Lists the record sets of a specified type in a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param recordType The type of record sets to enumerate.
|
||||
* @param recordType The type of DNS record in this record set.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public listByType(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
recordType: RecordType,
|
||||
options?: RecordSetsListByTypeOptionalParams
|
||||
options?: RecordSetsListByTypeOptionalParams,
|
||||
): PagedAsyncIterableIterator<RecordSet> {
|
||||
const iter = this.listByTypePagingAll(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType,
|
||||
options
|
||||
options,
|
||||
);
|
||||
return {
|
||||
next() {
|
||||
|
@ -85,9 +85,9 @@ export class RecordSetsImpl implements RecordSets {
|
|||
zoneName,
|
||||
recordType,
|
||||
options,
|
||||
settings
|
||||
settings,
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
zoneName: string,
|
||||
recordType: RecordType,
|
||||
options?: RecordSetsListByTypeOptionalParams,
|
||||
settings?: PageSettings
|
||||
settings?: PageSettings,
|
||||
): AsyncIterableIterator<RecordSet[]> {
|
||||
let result: RecordSetsListByTypeResponse;
|
||||
let continuationToken = settings?.continuationToken;
|
||||
|
@ -105,7 +105,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType,
|
||||
options
|
||||
options,
|
||||
);
|
||||
let page = result.value || [];
|
||||
continuationToken = result.nextLink;
|
||||
|
@ -118,7 +118,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
zoneName,
|
||||
recordType,
|
||||
continuationToken,
|
||||
options
|
||||
options,
|
||||
);
|
||||
continuationToken = result.nextLink;
|
||||
let page = result.value || [];
|
||||
|
@ -131,13 +131,13 @@ export class RecordSetsImpl implements RecordSets {
|
|||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
recordType: RecordType,
|
||||
options?: RecordSetsListByTypeOptionalParams
|
||||
options?: RecordSetsListByTypeOptionalParams,
|
||||
): AsyncIterableIterator<RecordSet> {
|
||||
for await (const page of this.listByTypePagingPage(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
recordType,
|
||||
options
|
||||
options,
|
||||
)) {
|
||||
yield* page;
|
||||
}
|
||||
|
@ -145,19 +145,19 @@ export class RecordSetsImpl implements RecordSets {
|
|||
|
||||
/**
|
||||
* Lists all record sets in a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public listByDnsZone(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: RecordSetsListByDnsZoneOptionalParams
|
||||
options?: RecordSetsListByDnsZoneOptionalParams,
|
||||
): PagedAsyncIterableIterator<RecordSet> {
|
||||
const iter = this.listByDnsZonePagingAll(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
options
|
||||
options,
|
||||
);
|
||||
return {
|
||||
next() {
|
||||
|
@ -174,9 +174,9 @@ export class RecordSetsImpl implements RecordSets {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
options,
|
||||
settings
|
||||
settings,
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: RecordSetsListByDnsZoneOptionalParams,
|
||||
settings?: PageSettings
|
||||
settings?: PageSettings,
|
||||
): AsyncIterableIterator<RecordSet[]> {
|
||||
let result: RecordSetsListByDnsZoneResponse;
|
||||
let continuationToken = settings?.continuationToken;
|
||||
|
@ -200,7 +200,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
continuationToken,
|
||||
options
|
||||
options,
|
||||
);
|
||||
continuationToken = result.nextLink;
|
||||
let page = result.value || [];
|
||||
|
@ -212,12 +212,12 @@ export class RecordSetsImpl implements RecordSets {
|
|||
private async *listByDnsZonePagingAll(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: RecordSetsListByDnsZoneOptionalParams
|
||||
options?: RecordSetsListByDnsZoneOptionalParams,
|
||||
): AsyncIterableIterator<RecordSet> {
|
||||
for await (const page of this.listByDnsZonePagingPage(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
options
|
||||
options,
|
||||
)) {
|
||||
yield* page;
|
||||
}
|
||||
|
@ -225,19 +225,19 @@ export class RecordSetsImpl implements RecordSets {
|
|||
|
||||
/**
|
||||
* Lists all record sets in a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public listAllByDnsZone(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: RecordSetsListAllByDnsZoneOptionalParams
|
||||
options?: RecordSetsListAllByDnsZoneOptionalParams,
|
||||
): PagedAsyncIterableIterator<RecordSet> {
|
||||
const iter = this.listAllByDnsZonePagingAll(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
options
|
||||
options,
|
||||
);
|
||||
return {
|
||||
next() {
|
||||
|
@ -254,9 +254,9 @@ export class RecordSetsImpl implements RecordSets {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
options,
|
||||
settings
|
||||
settings,
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: RecordSetsListAllByDnsZoneOptionalParams,
|
||||
settings?: PageSettings
|
||||
settings?: PageSettings,
|
||||
): AsyncIterableIterator<RecordSet[]> {
|
||||
let result: RecordSetsListAllByDnsZoneResponse;
|
||||
let continuationToken = settings?.continuationToken;
|
||||
|
@ -272,7 +272,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
result = await this._listAllByDnsZone(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
options
|
||||
options,
|
||||
);
|
||||
let page = result.value || [];
|
||||
continuationToken = result.nextLink;
|
||||
|
@ -284,7 +284,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
resourceGroupName,
|
||||
zoneName,
|
||||
continuationToken,
|
||||
options
|
||||
options,
|
||||
);
|
||||
continuationToken = result.nextLink;
|
||||
let page = result.value || [];
|
||||
|
@ -296,12 +296,12 @@ export class RecordSetsImpl implements RecordSets {
|
|||
private async *listAllByDnsZonePagingAll(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: RecordSetsListAllByDnsZoneOptionalParams
|
||||
options?: RecordSetsListAllByDnsZoneOptionalParams,
|
||||
): AsyncIterableIterator<RecordSet> {
|
||||
for await (const page of this.listAllByDnsZonePagingPage(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
options
|
||||
options,
|
||||
)) {
|
||||
yield* page;
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
|
||||
/**
|
||||
* Updates a record set within a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param relativeRecordSetName The name of the record set, relative to the name of the zone.
|
||||
* @param recordType The type of DNS record in this record set.
|
||||
|
@ -322,7 +322,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
relativeRecordSetName: string,
|
||||
recordType: RecordType,
|
||||
parameters: RecordSet,
|
||||
options?: RecordSetsUpdateOptionalParams
|
||||
options?: RecordSetsUpdateOptionalParams,
|
||||
): Promise<RecordSetsUpdateResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{
|
||||
|
@ -331,19 +331,19 @@ export class RecordSetsImpl implements RecordSets {
|
|||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
options
|
||||
options,
|
||||
},
|
||||
updateOperationSpec
|
||||
updateOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates or updates a record set within a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not
|
||||
* created (they are created when the DNS zone is created).
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param relativeRecordSetName The name of the record set, relative to the name of the zone.
|
||||
* @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated
|
||||
* but not created (they are created when the DNS zone is created).
|
||||
* @param recordType The type of DNS record in this record set.
|
||||
* @param parameters Parameters supplied to the CreateOrUpdate operation.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
|
@ -353,7 +353,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
relativeRecordSetName: string,
|
||||
recordType: RecordType,
|
||||
parameters: RecordSet,
|
||||
options?: RecordSetsCreateOrUpdateOptionalParams
|
||||
options?: RecordSetsCreateOrUpdateOptionalParams,
|
||||
): Promise<RecordSetsCreateOrUpdateResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{
|
||||
|
@ -362,19 +362,19 @@ export class RecordSetsImpl implements RecordSets {
|
|||
relativeRecordSetName,
|
||||
recordType,
|
||||
parameters,
|
||||
options
|
||||
options,
|
||||
},
|
||||
createOrUpdateOperationSpec
|
||||
createOrUpdateOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA
|
||||
* cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param relativeRecordSetName The name of the record set, relative to the name of the zone.
|
||||
* @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be
|
||||
* deleted (they are deleted when the DNS zone is deleted).
|
||||
* @param recordType The type of DNS record in this record set.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
delete(
|
||||
|
@ -382,7 +382,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
zoneName: string,
|
||||
relativeRecordSetName: string,
|
||||
recordType: RecordType,
|
||||
options?: RecordSetsDeleteOptionalParams
|
||||
options?: RecordSetsDeleteOptionalParams,
|
||||
): Promise<void> {
|
||||
return this.client.sendOperationRequest(
|
||||
{
|
||||
|
@ -390,15 +390,15 @@ export class RecordSetsImpl implements RecordSets {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
options
|
||||
options,
|
||||
},
|
||||
deleteOperationSpec
|
||||
deleteOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a record set.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param relativeRecordSetName The name of the record set, relative to the name of the zone.
|
||||
* @param recordType The type of DNS record in this record set.
|
||||
|
@ -409,7 +409,7 @@ export class RecordSetsImpl implements RecordSets {
|
|||
zoneName: string,
|
||||
relativeRecordSetName: string,
|
||||
recordType: RecordType,
|
||||
options?: RecordSetsGetOptionalParams
|
||||
options?: RecordSetsGetOptionalParams,
|
||||
): Promise<RecordSetsGetResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{
|
||||
|
@ -417,70 +417,70 @@ export class RecordSetsImpl implements RecordSets {
|
|||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType,
|
||||
options
|
||||
options,
|
||||
},
|
||||
getOperationSpec
|
||||
getOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the record sets of a specified type in a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param recordType The type of record sets to enumerate.
|
||||
* @param recordType The type of DNS record in this record set.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listByType(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
recordType: RecordType,
|
||||
options?: RecordSetsListByTypeOptionalParams
|
||||
options?: RecordSetsListByTypeOptionalParams,
|
||||
): Promise<RecordSetsListByTypeResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, zoneName, recordType, options },
|
||||
listByTypeOperationSpec
|
||||
listByTypeOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all record sets in a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listByDnsZone(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: RecordSetsListByDnsZoneOptionalParams
|
||||
options?: RecordSetsListByDnsZoneOptionalParams,
|
||||
): Promise<RecordSetsListByDnsZoneResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, zoneName, options },
|
||||
listByDnsZoneOperationSpec
|
||||
listByDnsZoneOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all record sets in a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listAllByDnsZone(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: RecordSetsListAllByDnsZoneOptionalParams
|
||||
options?: RecordSetsListAllByDnsZoneOptionalParams,
|
||||
): Promise<RecordSetsListAllByDnsZoneResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, zoneName, options },
|
||||
listAllByDnsZoneOperationSpec
|
||||
listAllByDnsZoneOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListByTypeNext
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param recordType The type of record sets to enumerate.
|
||||
* @param recordType The type of DNS record in this record set.
|
||||
* @param nextLink The nextLink from the previous successful call to the ListByType method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
|
@ -489,17 +489,17 @@ export class RecordSetsImpl implements RecordSets {
|
|||
zoneName: string,
|
||||
recordType: RecordType,
|
||||
nextLink: string,
|
||||
options?: RecordSetsListByTypeNextOptionalParams
|
||||
options?: RecordSetsListByTypeNextOptionalParams,
|
||||
): Promise<RecordSetsListByTypeNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, zoneName, recordType, nextLink, options },
|
||||
listByTypeNextOperationSpec
|
||||
listByTypeNextOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListByDnsZoneNext
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param nextLink The nextLink from the previous successful call to the ListByDnsZone method.
|
||||
* @param options The options parameters.
|
||||
|
@ -508,17 +508,17 @@ export class RecordSetsImpl implements RecordSets {
|
|||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
nextLink: string,
|
||||
options?: RecordSetsListByDnsZoneNextOptionalParams
|
||||
options?: RecordSetsListByDnsZoneNextOptionalParams,
|
||||
): Promise<RecordSetsListByDnsZoneNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, zoneName, nextLink, options },
|
||||
listByDnsZoneNextOperationSpec
|
||||
listByDnsZoneNextOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListAllByDnsZoneNext
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param nextLink The nextLink from the previous successful call to the ListAllByDnsZone method.
|
||||
* @param options The options parameters.
|
||||
|
@ -527,11 +527,11 @@ export class RecordSetsImpl implements RecordSets {
|
|||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
nextLink: string,
|
||||
options?: RecordSetsListAllByDnsZoneNextOptionalParams
|
||||
options?: RecordSetsListAllByDnsZoneNextOptionalParams,
|
||||
): Promise<RecordSetsListAllByDnsZoneNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, zoneName, nextLink, options },
|
||||
listAllByDnsZoneNextOperationSpec
|
||||
listAllByDnsZoneNextOperationSpec,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -539,16 +539,15 @@ export class RecordSetsImpl implements RecordSets {
|
|||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const updateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}",
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}",
|
||||
httpMethod: "PATCH",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.RecordSet
|
||||
bodyMapper: Mappers.RecordSet,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
requestBody: Parameters.parameters,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
|
@ -556,32 +555,31 @@ const updateOperationSpec: coreClient.OperationSpec = {
|
|||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.relativeRecordSetName,
|
||||
Parameters.recordType,
|
||||
Parameters.subscriptionId
|
||||
],
|
||||
headerParameters: [
|
||||
Parameters.contentType,
|
||||
Parameters.accept,
|
||||
Parameters.ifMatch
|
||||
Parameters.ifMatch,
|
||||
Parameters.contentType,
|
||||
],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}",
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}",
|
||||
httpMethod: "PUT",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.RecordSet
|
||||
bodyMapper: Mappers.RecordSet,
|
||||
},
|
||||
201: {
|
||||
bodyMapper: Mappers.RecordSet
|
||||
bodyMapper: Mappers.RecordSet,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
requestBody: Parameters.parameters,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
|
@ -589,221 +587,201 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
|||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.relativeRecordSetName,
|
||||
Parameters.recordType,
|
||||
Parameters.subscriptionId
|
||||
],
|
||||
headerParameters: [
|
||||
Parameters.contentType,
|
||||
Parameters.accept,
|
||||
Parameters.ifMatch,
|
||||
Parameters.ifNoneMatch
|
||||
Parameters.ifNoneMatch,
|
||||
Parameters.contentType,
|
||||
],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const deleteOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}",
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}",
|
||||
httpMethod: "DELETE",
|
||||
responses: {
|
||||
200: {},
|
||||
204: {},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.relativeRecordSetName,
|
||||
Parameters.recordType,
|
||||
Parameters.subscriptionId
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.ifMatch],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const getOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}",
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.RecordSet
|
||||
bodyMapper: Mappers.RecordSet,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.relativeRecordSetName,
|
||||
Parameters.recordType,
|
||||
Parameters.subscriptionId
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const listByTypeOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}",
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.RecordSetListResult
|
||||
bodyMapper: Mappers.RecordSetListResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [
|
||||
Parameters.apiVersion,
|
||||
Parameters.top,
|
||||
Parameters.recordsetnamesuffix
|
||||
Parameters.recordsetnamesuffix,
|
||||
],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.recordType,
|
||||
Parameters.subscriptionId
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const listByDnsZoneOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/recordsets",
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/recordsets",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.RecordSetListResult
|
||||
bodyMapper: Mappers.RecordSetListResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [
|
||||
Parameters.apiVersion,
|
||||
Parameters.top,
|
||||
Parameters.recordsetnamesuffix
|
||||
Parameters.recordsetnamesuffix,
|
||||
],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId
|
||||
Parameters.subscriptionId,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const listAllByDnsZoneOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/all",
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/all",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.RecordSetListResult
|
||||
bodyMapper: Mappers.RecordSetListResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [
|
||||
Parameters.apiVersion,
|
||||
Parameters.top,
|
||||
Parameters.recordSetNameSuffix
|
||||
Parameters.recordSetNameSuffix,
|
||||
],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId
|
||||
Parameters.subscriptionId,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const listByTypeNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.RecordSetListResult
|
||||
bodyMapper: Mappers.RecordSetListResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [
|
||||
Parameters.apiVersion,
|
||||
Parameters.top,
|
||||
Parameters.recordsetnamesuffix
|
||||
],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.recordType,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.nextLink
|
||||
Parameters.nextLink,
|
||||
Parameters.recordType,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const listByDnsZoneNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.RecordSetListResult
|
||||
bodyMapper: Mappers.RecordSetListResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [
|
||||
Parameters.apiVersion,
|
||||
Parameters.top,
|
||||
Parameters.recordsetnamesuffix
|
||||
],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.nextLink
|
||||
Parameters.nextLink,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const listAllByDnsZoneNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.RecordSetListResult
|
||||
bodyMapper: Mappers.RecordSetListResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [
|
||||
Parameters.apiVersion,
|
||||
Parameters.top,
|
||||
Parameters.recordSetNameSuffix
|
||||
],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.nextLink
|
||||
Parameters.nextLink,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
|
|
|
@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client";
|
|||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { DnsManagementClient } from "../dnsManagementClient";
|
||||
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
|
||||
import { LroImpl } from "../lroImpl";
|
||||
import {
|
||||
SimplePollerLike,
|
||||
OperationState,
|
||||
createHttpPoller,
|
||||
} from "@azure/core-lro";
|
||||
import { createLroSpec } from "../lroImpl";
|
||||
import {
|
||||
Zone,
|
||||
ZonesListByResourceGroupNextOptionalParams,
|
||||
|
@ -32,7 +36,7 @@ import {
|
|||
ZonesUpdateOptionalParams,
|
||||
ZonesUpdateResponse,
|
||||
ZonesListByResourceGroupNextResponse,
|
||||
ZonesListNextResponse
|
||||
ZonesListNextResponse,
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
|
@ -50,12 +54,12 @@ export class ZonesImpl implements Zones {
|
|||
|
||||
/**
|
||||
* Lists the DNS zones within a resource group.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public listByResourceGroup(
|
||||
resourceGroupName: string,
|
||||
options?: ZonesListByResourceGroupOptionalParams
|
||||
options?: ZonesListByResourceGroupOptionalParams,
|
||||
): PagedAsyncIterableIterator<Zone> {
|
||||
const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
|
||||
return {
|
||||
|
@ -72,16 +76,16 @@ export class ZonesImpl implements Zones {
|
|||
return this.listByResourceGroupPagingPage(
|
||||
resourceGroupName,
|
||||
options,
|
||||
settings
|
||||
settings,
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
private async *listByResourceGroupPagingPage(
|
||||
resourceGroupName: string,
|
||||
options?: ZonesListByResourceGroupOptionalParams,
|
||||
settings?: PageSettings
|
||||
settings?: PageSettings,
|
||||
): AsyncIterableIterator<Zone[]> {
|
||||
let result: ZonesListByResourceGroupResponse;
|
||||
let continuationToken = settings?.continuationToken;
|
||||
|
@ -96,7 +100,7 @@ export class ZonesImpl implements Zones {
|
|||
result = await this._listByResourceGroupNext(
|
||||
resourceGroupName,
|
||||
continuationToken,
|
||||
options
|
||||
options,
|
||||
);
|
||||
continuationToken = result.nextLink;
|
||||
let page = result.value || [];
|
||||
|
@ -107,11 +111,11 @@ export class ZonesImpl implements Zones {
|
|||
|
||||
private async *listByResourceGroupPagingAll(
|
||||
resourceGroupName: string,
|
||||
options?: ZonesListByResourceGroupOptionalParams
|
||||
options?: ZonesListByResourceGroupOptionalParams,
|
||||
): AsyncIterableIterator<Zone> {
|
||||
for await (const page of this.listByResourceGroupPagingPage(
|
||||
resourceGroupName,
|
||||
options
|
||||
options,
|
||||
)) {
|
||||
yield* page;
|
||||
}
|
||||
|
@ -122,7 +126,7 @@ export class ZonesImpl implements Zones {
|
|||
* @param options The options parameters.
|
||||
*/
|
||||
public list(
|
||||
options?: ZonesListOptionalParams
|
||||
options?: ZonesListOptionalParams,
|
||||
): PagedAsyncIterableIterator<Zone> {
|
||||
const iter = this.listPagingAll(options);
|
||||
return {
|
||||
|
@ -137,13 +141,13 @@ export class ZonesImpl implements Zones {
|
|||
throw new Error("maxPageSize is not supported by this operation.");
|
||||
}
|
||||
return this.listPagingPage(options, settings);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
private async *listPagingPage(
|
||||
options?: ZonesListOptionalParams,
|
||||
settings?: PageSettings
|
||||
settings?: PageSettings,
|
||||
): AsyncIterableIterator<Zone[]> {
|
||||
let result: ZonesListResponse;
|
||||
let continuationToken = settings?.continuationToken;
|
||||
|
@ -164,7 +168,7 @@ export class ZonesImpl implements Zones {
|
|||
}
|
||||
|
||||
private async *listPagingAll(
|
||||
options?: ZonesListOptionalParams
|
||||
options?: ZonesListOptionalParams,
|
||||
): AsyncIterableIterator<Zone> {
|
||||
for await (const page of this.listPagingPage(options)) {
|
||||
yield* page;
|
||||
|
@ -173,7 +177,7 @@ export class ZonesImpl implements Zones {
|
|||
|
||||
/**
|
||||
* Creates or updates a DNS zone. Does not modify DNS records within the zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param parameters Parameters supplied to the CreateOrUpdate operation.
|
||||
* @param options The options parameters.
|
||||
|
@ -182,43 +186,42 @@ export class ZonesImpl implements Zones {
|
|||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
parameters: Zone,
|
||||
options?: ZonesCreateOrUpdateOptionalParams
|
||||
options?: ZonesCreateOrUpdateOptionalParams,
|
||||
): Promise<ZonesCreateOrUpdateResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, zoneName, parameters, options },
|
||||
createOrUpdateOperationSpec
|
||||
createOrUpdateOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot
|
||||
* be undone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginDelete(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: ZonesDeleteOptionalParams
|
||||
): Promise<PollerLike<PollOperationState<void>, void>> {
|
||||
options?: ZonesDeleteOptionalParams,
|
||||
): Promise<SimplePollerLike<OperationState<void>, void>> {
|
||||
const directSendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
spec: coreClient.OperationSpec,
|
||||
): Promise<void> => {
|
||||
return this.client.sendOperationRequest(args, spec);
|
||||
};
|
||||
const sendOperation = async (
|
||||
const sendOperationFn = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
spec: coreClient.OperationSpec,
|
||||
) => {
|
||||
let currentRawResponse:
|
||||
| coreClient.FullOperationResponse
|
||||
| undefined = undefined;
|
||||
let currentRawResponse: coreClient.FullOperationResponse | undefined =
|
||||
undefined;
|
||||
const providedCallback = args.options?.onResponse;
|
||||
const callback: coreClient.RawResponseCallback = (
|
||||
rawResponse: coreClient.FullOperationResponse,
|
||||
flatResponse: unknown
|
||||
flatResponse: unknown,
|
||||
) => {
|
||||
currentRawResponse = rawResponse;
|
||||
providedCallback?.(rawResponse, flatResponse);
|
||||
|
@ -227,8 +230,8 @@ export class ZonesImpl implements Zones {
|
|||
...args,
|
||||
options: {
|
||||
...args.options,
|
||||
onResponse: callback
|
||||
}
|
||||
onResponse: callback,
|
||||
},
|
||||
};
|
||||
const flatResponse = await directSendOperation(updatedArgs, spec);
|
||||
return {
|
||||
|
@ -236,19 +239,19 @@ export class ZonesImpl implements Zones {
|
|||
rawResponse: {
|
||||
statusCode: currentRawResponse!.status,
|
||||
body: currentRawResponse!.parsedBody,
|
||||
headers: currentRawResponse!.headers.toJSON()
|
||||
}
|
||||
headers: currentRawResponse!.headers.toJSON(),
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const lro = new LroImpl(
|
||||
sendOperation,
|
||||
{ resourceGroupName, zoneName, options },
|
||||
deleteOperationSpec
|
||||
);
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs
|
||||
const lro = createLroSpec({
|
||||
sendOperationFn,
|
||||
args: { resourceGroupName, zoneName, options },
|
||||
spec: deleteOperationSpec,
|
||||
});
|
||||
const poller = await createHttpPoller<void, OperationState<void>>(lro, {
|
||||
restoreFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs,
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
|
@ -257,14 +260,14 @@ export class ZonesImpl implements Zones {
|
|||
/**
|
||||
* Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot
|
||||
* be undone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginDeleteAndWait(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: ZonesDeleteOptionalParams
|
||||
options?: ZonesDeleteOptionalParams,
|
||||
): Promise<void> {
|
||||
const poller = await this.beginDelete(resourceGroupName, zoneName, options);
|
||||
return poller.pollUntilDone();
|
||||
|
@ -272,24 +275,24 @@ export class ZonesImpl implements Zones {
|
|||
|
||||
/**
|
||||
* Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: ZonesGetOptionalParams
|
||||
options?: ZonesGetOptionalParams,
|
||||
): Promise<ZonesGetResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, zoneName, options },
|
||||
getOperationSpec
|
||||
getOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a DNS zone. Does not modify DNS records within the zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param parameters Parameters supplied to the Update operation.
|
||||
* @param options The options parameters.
|
||||
|
@ -298,26 +301,26 @@ export class ZonesImpl implements Zones {
|
|||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
parameters: ZoneUpdate,
|
||||
options?: ZonesUpdateOptionalParams
|
||||
options?: ZonesUpdateOptionalParams,
|
||||
): Promise<ZonesUpdateResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, zoneName, parameters, options },
|
||||
updateOperationSpec
|
||||
updateOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the DNS zones within a resource group.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listByResourceGroup(
|
||||
resourceGroupName: string,
|
||||
options?: ZonesListByResourceGroupOptionalParams
|
||||
options?: ZonesListByResourceGroupOptionalParams,
|
||||
): Promise<ZonesListByResourceGroupResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, options },
|
||||
listByResourceGroupOperationSpec
|
||||
listByResourceGroupOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -331,18 +334,18 @@ export class ZonesImpl implements Zones {
|
|||
|
||||
/**
|
||||
* ListByResourceGroupNext
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listByResourceGroupNext(
|
||||
resourceGroupName: string,
|
||||
nextLink: string,
|
||||
options?: ZonesListByResourceGroupNextOptionalParams
|
||||
options?: ZonesListByResourceGroupNextOptionalParams,
|
||||
): Promise<ZonesListByResourceGroupNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, nextLink, options },
|
||||
listByResourceGroupNextOperationSpec
|
||||
listByResourceGroupNextOperationSpec,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -353,11 +356,11 @@ export class ZonesImpl implements Zones {
|
|||
*/
|
||||
private _listNext(
|
||||
nextLink: string,
|
||||
options?: ZonesListNextOptionalParams
|
||||
options?: ZonesListNextOptionalParams,
|
||||
): Promise<ZonesListNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ nextLink, options },
|
||||
listNextOperationSpec
|
||||
listNextOperationSpec,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -365,19 +368,18 @@ export class ZonesImpl implements Zones {
|
|||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}",
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}",
|
||||
httpMethod: "PUT",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.Zone
|
||||
bodyMapper: Mappers.Zone,
|
||||
},
|
||||
201: {
|
||||
bodyMapper: Mappers.Zone
|
||||
bodyMapper: Mappers.Zone,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
requestBody: Parameters.parameters1,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
|
@ -385,20 +387,19 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
|||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId
|
||||
Parameters.subscriptionId,
|
||||
],
|
||||
headerParameters: [
|
||||
Parameters.contentType,
|
||||
Parameters.accept,
|
||||
Parameters.ifMatch,
|
||||
Parameters.ifNoneMatch
|
||||
Parameters.ifNoneMatch,
|
||||
Parameters.contentType,
|
||||
],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const deleteOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}",
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}",
|
||||
httpMethod: "DELETE",
|
||||
responses: {
|
||||
200: {},
|
||||
|
@ -406,52 +407,50 @@ const deleteOperationSpec: coreClient.OperationSpec = {
|
|||
202: {},
|
||||
204: {},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId
|
||||
Parameters.subscriptionId,
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.ifMatch],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const getOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}",
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.Zone
|
||||
bodyMapper: Mappers.Zone,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId
|
||||
Parameters.subscriptionId,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const updateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}",
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}",
|
||||
httpMethod: "PATCH",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.Zone
|
||||
bodyMapper: Mappers.Zone,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
requestBody: Parameters.parameters2,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
|
@ -459,91 +458,88 @@ const updateOperationSpec: coreClient.OperationSpec = {
|
|||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.zoneName,
|
||||
Parameters.subscriptionId
|
||||
Parameters.subscriptionId,
|
||||
],
|
||||
headerParameters: [
|
||||
Parameters.contentType,
|
||||
Parameters.accept,
|
||||
Parameters.ifMatch
|
||||
Parameters.ifMatch,
|
||||
Parameters.contentType,
|
||||
],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones",
|
||||
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ZoneListResult
|
||||
bodyMapper: Mappers.ZoneListResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion, Parameters.top],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.subscriptionId
|
||||
Parameters.subscriptionId,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const listOperationSpec: coreClient.OperationSpec = {
|
||||
path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/dnszones",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ZoneListResult
|
||||
bodyMapper: Mappers.ZoneListResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion, Parameters.top],
|
||||
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ZoneListResult
|
||||
bodyMapper: Mappers.ZoneListResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion, Parameters.top],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.nextLink
|
||||
Parameters.nextLink,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
const listNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ZoneListResult
|
||||
bodyMapper: Mappers.ZoneListResult,
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.CloudError
|
||||
}
|
||||
bodyMapper: Mappers.CloudError,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion, Parameters.top],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.nextLink
|
||||
Parameters.nextLink,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
serializer,
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import {
|
||||
DnsResourceReferenceRequest,
|
||||
DnsResourceReferenceGetByTargetResourcesOptionalParams,
|
||||
DnsResourceReferenceGetByTargetResourcesResponse
|
||||
DnsResourceReferenceGetByTargetResourcesResponse,
|
||||
} from "../models";
|
||||
|
||||
/** Interface representing a DnsResourceReferenceOperations. */
|
||||
|
@ -21,6 +21,6 @@ export interface DnsResourceReferenceOperations {
|
|||
*/
|
||||
getByTargetResources(
|
||||
parameters: DnsResourceReferenceRequest,
|
||||
options?: DnsResourceReferenceGetByTargetResourcesOptionalParams
|
||||
options?: DnsResourceReferenceGetByTargetResourcesOptionalParams,
|
||||
): Promise<DnsResourceReferenceGetByTargetResourcesResponse>;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
||||
import { SimplePollerLike, OperationState } from "@azure/core-lro";
|
||||
import {
|
||||
DnssecConfig,
|
||||
DnssecConfigsListByDnsZoneOptionalParams,
|
||||
DnssecConfigsCreateOrUpdateOptionalParams,
|
||||
DnssecConfigsCreateOrUpdateResponse,
|
||||
DnssecConfigsDeleteOptionalParams,
|
||||
DnssecConfigsGetOptionalParams,
|
||||
DnssecConfigsGetResponse,
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Interface representing a DnssecConfigs. */
|
||||
export interface DnssecConfigs {
|
||||
/**
|
||||
* Lists the DNSSEC configurations in a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listByDnsZone(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsListByDnsZoneOptionalParams,
|
||||
): PagedAsyncIterableIterator<DnssecConfig>;
|
||||
/**
|
||||
* Creates or updates the DNSSEC configuration on a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginCreateOrUpdate(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsCreateOrUpdateOptionalParams,
|
||||
): Promise<
|
||||
SimplePollerLike<
|
||||
OperationState<DnssecConfigsCreateOrUpdateResponse>,
|
||||
DnssecConfigsCreateOrUpdateResponse
|
||||
>
|
||||
>;
|
||||
/**
|
||||
* Creates or updates the DNSSEC configuration on a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginCreateOrUpdateAndWait(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsCreateOrUpdateOptionalParams,
|
||||
): Promise<DnssecConfigsCreateOrUpdateResponse>;
|
||||
/**
|
||||
* Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginDelete(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsDeleteOptionalParams,
|
||||
): Promise<SimplePollerLike<OperationState<void>, void>>;
|
||||
/**
|
||||
* Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginDeleteAndWait(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsDeleteOptionalParams,
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Gets the DNSSEC configuration.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: DnssecConfigsGetOptionalParams,
|
||||
): Promise<DnssecConfigsGetResponse>;
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
export * from "./dnssecConfigs";
|
||||
export * from "./recordSets";
|
||||
export * from "./zones";
|
||||
export * from "./dnsResourceReferenceOperations";
|
||||
|
|
|
@ -19,7 +19,7 @@ import {
|
|||
RecordSetsCreateOrUpdateResponse,
|
||||
RecordSetsDeleteOptionalParams,
|
||||
RecordSetsGetOptionalParams,
|
||||
RecordSetsGetResponse
|
||||
RecordSetsGetResponse,
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
|
@ -27,42 +27,42 @@ import {
|
|||
export interface RecordSets {
|
||||
/**
|
||||
* Lists the record sets of a specified type in a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param recordType The type of record sets to enumerate.
|
||||
* @param recordType The type of DNS record in this record set.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listByType(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
recordType: RecordType,
|
||||
options?: RecordSetsListByTypeOptionalParams
|
||||
options?: RecordSetsListByTypeOptionalParams,
|
||||
): PagedAsyncIterableIterator<RecordSet>;
|
||||
/**
|
||||
* Lists all record sets in a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listByDnsZone(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: RecordSetsListByDnsZoneOptionalParams
|
||||
options?: RecordSetsListByDnsZoneOptionalParams,
|
||||
): PagedAsyncIterableIterator<RecordSet>;
|
||||
/**
|
||||
* Lists all record sets in a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listAllByDnsZone(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: RecordSetsListAllByDnsZoneOptionalParams
|
||||
options?: RecordSetsListAllByDnsZoneOptionalParams,
|
||||
): PagedAsyncIterableIterator<RecordSet>;
|
||||
/**
|
||||
* Updates a record set within a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param relativeRecordSetName The name of the record set, relative to the name of the zone.
|
||||
* @param recordType The type of DNS record in this record set.
|
||||
|
@ -75,15 +75,15 @@ export interface RecordSets {
|
|||
relativeRecordSetName: string,
|
||||
recordType: RecordType,
|
||||
parameters: RecordSet,
|
||||
options?: RecordSetsUpdateOptionalParams
|
||||
options?: RecordSetsUpdateOptionalParams,
|
||||
): Promise<RecordSetsUpdateResponse>;
|
||||
/**
|
||||
* Creates or updates a record set within a DNS zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not
|
||||
* created (they are created when the DNS zone is created).
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param relativeRecordSetName The name of the record set, relative to the name of the zone.
|
||||
* @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated
|
||||
* but not created (they are created when the DNS zone is created).
|
||||
* @param recordType The type of DNS record in this record set.
|
||||
* @param parameters Parameters supplied to the CreateOrUpdate operation.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
|
@ -93,15 +93,15 @@ export interface RecordSets {
|
|||
relativeRecordSetName: string,
|
||||
recordType: RecordType,
|
||||
parameters: RecordSet,
|
||||
options?: RecordSetsCreateOrUpdateOptionalParams
|
||||
options?: RecordSetsCreateOrUpdateOptionalParams,
|
||||
): Promise<RecordSetsCreateOrUpdateResponse>;
|
||||
/**
|
||||
* Deletes a record set from a DNS zone. This operation cannot be undone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA
|
||||
* cannot be deleted (they are deleted when the DNS zone is deleted).
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param relativeRecordSetName The name of the record set, relative to the name of the zone.
|
||||
* @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be
|
||||
* deleted (they are deleted when the DNS zone is deleted).
|
||||
* @param recordType The type of DNS record in this record set.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
delete(
|
||||
|
@ -109,11 +109,11 @@ export interface RecordSets {
|
|||
zoneName: string,
|
||||
relativeRecordSetName: string,
|
||||
recordType: RecordType,
|
||||
options?: RecordSetsDeleteOptionalParams
|
||||
options?: RecordSetsDeleteOptionalParams,
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Gets a record set.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param relativeRecordSetName The name of the record set, relative to the name of the zone.
|
||||
* @param recordType The type of DNS record in this record set.
|
||||
|
@ -124,6 +124,6 @@ export interface RecordSets {
|
|||
zoneName: string,
|
||||
relativeRecordSetName: string,
|
||||
recordType: RecordType,
|
||||
options?: RecordSetsGetOptionalParams
|
||||
options?: RecordSetsGetOptionalParams,
|
||||
): Promise<RecordSetsGetResponse>;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
||||
import { PollerLike, PollOperationState } from "@azure/core-lro";
|
||||
import { SimplePollerLike, OperationState } from "@azure/core-lro";
|
||||
import {
|
||||
Zone,
|
||||
ZonesListByResourceGroupOptionalParams,
|
||||
|
@ -19,7 +19,7 @@ import {
|
|||
ZonesGetResponse,
|
||||
ZoneUpdate,
|
||||
ZonesUpdateOptionalParams,
|
||||
ZonesUpdateResponse
|
||||
ZonesUpdateResponse,
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
|
@ -27,12 +27,12 @@ import {
|
|||
export interface Zones {
|
||||
/**
|
||||
* Lists the DNS zones within a resource group.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listByResourceGroup(
|
||||
resourceGroupName: string,
|
||||
options?: ZonesListByResourceGroupOptionalParams
|
||||
options?: ZonesListByResourceGroupOptionalParams,
|
||||
): PagedAsyncIterableIterator<Zone>;
|
||||
/**
|
||||
* Lists the DNS zones in all resource groups in a subscription.
|
||||
|
@ -41,7 +41,7 @@ export interface Zones {
|
|||
list(options?: ZonesListOptionalParams): PagedAsyncIterableIterator<Zone>;
|
||||
/**
|
||||
* Creates or updates a DNS zone. Does not modify DNS records within the zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param parameters Parameters supplied to the CreateOrUpdate operation.
|
||||
* @param options The options parameters.
|
||||
|
@ -50,46 +50,46 @@ export interface Zones {
|
|||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
parameters: Zone,
|
||||
options?: ZonesCreateOrUpdateOptionalParams
|
||||
options?: ZonesCreateOrUpdateOptionalParams,
|
||||
): Promise<ZonesCreateOrUpdateResponse>;
|
||||
/**
|
||||
* Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot
|
||||
* be undone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginDelete(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: ZonesDeleteOptionalParams
|
||||
): Promise<PollerLike<PollOperationState<void>, void>>;
|
||||
options?: ZonesDeleteOptionalParams,
|
||||
): Promise<SimplePollerLike<OperationState<void>, void>>;
|
||||
/**
|
||||
* Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot
|
||||
* be undone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginDeleteAndWait(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: ZonesDeleteOptionalParams
|
||||
options?: ZonesDeleteOptionalParams,
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
options?: ZonesGetOptionalParams
|
||||
options?: ZonesGetOptionalParams,
|
||||
): Promise<ZonesGetResponse>;
|
||||
/**
|
||||
* Updates a DNS zone. Does not modify DNS records within the zone.
|
||||
* @param resourceGroupName The name of the resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param zoneName The name of the DNS zone (without a terminating dot).
|
||||
* @param parameters Parameters supplied to the Update operation.
|
||||
* @param options The options parameters.
|
||||
|
@ -98,6 +98,6 @@ export interface Zones {
|
|||
resourceGroupName: string,
|
||||
zoneName: string,
|
||||
parameters: ZoneUpdate,
|
||||
options?: ZonesUpdateOptionalParams
|
||||
options?: ZonesUpdateOptionalParams,
|
||||
): Promise<ZonesUpdateResponse>;
|
||||
}
|
||||
|
|
|
@ -13,11 +13,11 @@ export interface PageInfo {
|
|||
const pageMap = new WeakMap<object, PageInfo>();
|
||||
|
||||
/**
|
||||
* Given a result page from a pageable operation, returns a
|
||||
* continuation token that can be used to begin paging from
|
||||
* Given the last `.value` produced by the `byPage` iterator,
|
||||
* returns a continuation token that can be used to begin paging from
|
||||
* that point later.
|
||||
* @param page A result object from calling .byPage() on a paged operation.
|
||||
* @returns The continuation token that can be passed into byPage().
|
||||
* @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
|
||||
* @returns The continuation token that can be passed into byPage() during future calls.
|
||||
*/
|
||||
export function getContinuationToken(page: unknown): string | undefined {
|
||||
if (typeof page !== "object" || page === null) {
|
||||
|
@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined {
|
|||
|
||||
export function setContinuationToken(
|
||||
page: unknown,
|
||||
continuationToken: string | undefined
|
||||
continuationToken: string | undefined,
|
||||
): void {
|
||||
if (typeof page !== "object" || page === null || !continuationToken) {
|
||||
return;
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import {
|
||||
env,
|
||||
Recorder,
|
||||
RecorderStartOptions,
|
||||
delay,
|
||||
isPlaybackMode,
|
||||
} from "@azure-tools/test-recorder";
|
||||
import { createTestCredential } from "@azure-tools/test-credential";
|
||||
import { assert } from "chai";
|
||||
import { Context } from "mocha";
|
||||
import { DnsManagementClient } from "../src/dnsManagementClient";
|
||||
|
||||
const replaceableVariables: Record<string, string> = {
|
||||
SUBSCRIPTION_ID: "88888888-8888-8888-8888-888888888888"
|
||||
};
|
||||
|
||||
const recorderOptions: RecorderStartOptions = {
|
||||
envSetupForPlayback: replaceableVariables,
|
||||
removeCentralSanitizers: [
|
||||
"AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section
|
||||
"AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section
|
||||
],
|
||||
};
|
||||
|
||||
export const testPollingOptions = {
|
||||
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
|
||||
};
|
||||
|
||||
describe("Dns test", () => {
|
||||
let recorder: Recorder;
|
||||
let subscriptionId: string;
|
||||
let client: DnsManagementClient;
|
||||
let location: string;
|
||||
let resourceGroup: string;
|
||||
let resourcename: string;
|
||||
|
||||
beforeEach(async function (this: Context) {
|
||||
recorder = new Recorder(this.currentTest);
|
||||
await recorder.start(recorderOptions);
|
||||
subscriptionId = env.SUBSCRIPTION_ID || '';
|
||||
// This is an example of how the environment variables are used
|
||||
const credential = createTestCredential();
|
||||
client = new DnsManagementClient(credential, subscriptionId, recorder.configureClientOptions({}));
|
||||
location = "eastus";
|
||||
resourceGroup = "myjstest";
|
||||
resourcename = "resourcetest.com";
|
||||
|
||||
});
|
||||
|
||||
afterEach(async function () {
|
||||
await recorder.stop();
|
||||
});
|
||||
|
||||
it("zones create test", async function () {
|
||||
const res = await client.zones.createOrUpdate(
|
||||
resourceGroup,
|
||||
resourcename,
|
||||
{
|
||||
location: "Global",
|
||||
tags: {
|
||||
key1: "value1",
|
||||
},
|
||||
});
|
||||
assert.equal(res.name, resourcename);
|
||||
});
|
||||
|
||||
it("zones get test", async function () {
|
||||
const res = await client.zones.get(
|
||||
resourceGroup,
|
||||
resourcename
|
||||
);
|
||||
assert.equal(res.name, resourcename);
|
||||
});
|
||||
|
||||
it("zones list test", async function () {
|
||||
const resArray = new Array();
|
||||
for await (let item of client.zones.listByResourceGroup(resourceGroup)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
assert.equal(resArray.length, 1);
|
||||
});
|
||||
|
||||
it("zones delete test", async function () {
|
||||
const resArray = new Array();
|
||||
const res = await client.zones.beginDeleteAndWait(resourceGroup, resourcename
|
||||
)
|
||||
for await (let item of client.zones.listByResourceGroup(resourceGroup)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
assert.equal(resArray.length, 0);
|
||||
});
|
||||
})
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import {
|
||||
Recorder,
|
||||
RecorderStartOptions,
|
||||
env
|
||||
} from "@azure-tools/test-recorder";
|
||||
import { assert } from "chai";
|
||||
import { Context } from "mocha";
|
||||
|
||||
const replaceableVariables: Record<string, string> = {
|
||||
AZURE_CLIENT_ID: "azure_client_id",
|
||||
AZURE_CLIENT_SECRET: "azure_client_secret",
|
||||
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
|
||||
SUBSCRIPTION_ID: "azure_subscription_id"
|
||||
};
|
||||
|
||||
const recorderOptions: RecorderStartOptions = {
|
||||
envSetupForPlayback: replaceableVariables,
|
||||
removeCentralSanitizers: [
|
||||
"AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section
|
||||
"AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section
|
||||
],
|
||||
};
|
||||
|
||||
describe("My test", () => {
|
||||
let recorder: Recorder;
|
||||
|
||||
beforeEach(async function (this: Context) {
|
||||
recorder = new Recorder(this.currentTest);
|
||||
await recorder.start(recorderOptions);
|
||||
});
|
||||
|
||||
afterEach(async function () {
|
||||
await recorder.stop();
|
||||
});
|
||||
|
||||
it("sample test", async function () {
|
||||
console.log("Hi, I'm a test!");
|
||||
});
|
||||
});
|
Загрузка…
Ссылка в новой задаче