Refresh 8 (#21456)
* dns&digitalwins * dnsresolver * domainservices * eventhub * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update
This commit is contained in:
Родитель
e484d1ec10
Коммит
0379a2987b
|
@ -10647,7 +10647,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-digitaltwins.tgz:
|
||||
resolution: {integrity: sha512-UoYxvLJ6lsdjg2ko5jVsLEQQLC1nIjSFPc4lkFkwwUJAMFgceRXpPAcTMs+O0aICUIZSgs3Fw+sVW8m6ZbFsxA==, tarball: file:projects/arm-digitaltwins.tgz}
|
||||
resolution: {integrity: sha512-hW849ZUuBqPjs2hSiWFKM2L38jA29tgjpn1HSxr5gdGqSbkh+xJWb10tjhbByoPAGoC/xiLlmFsEzLWoIME2HQ==, tarball: file:projects/arm-digitaltwins.tgz}
|
||||
name: '@rush-temp/arm-digitaltwins'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -10703,34 +10703,35 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-dns.tgz:
|
||||
resolution: {integrity: sha512-lNH4104hmq8+MemTpwQgpthSZtz07RGeORUIpI1m5s+j0t7U8XMDGNvCdNtEduEW+8EIYlLy+gcvedWRAOoYMQ==, tarball: file:projects/arm-dns.tgz}
|
||||
resolution: {integrity: sha512-i8TiBoOj9lXLt99eF1caVtFXnXBsgTSYqSOCfIeXuc2gdgERBvRzng89bck00hj+4w1m6yyWvuiBln2rrwwlOg==, tarball: file:projects/arm-dns.tgz}
|
||||
name: '@rush-temp/arm-dns'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
'@azure-tools/test-recorder': 1.0.2
|
||||
'@azure/identity': 2.0.4
|
||||
'@microsoft/api-extractor': 7.22.1
|
||||
'@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@1.32.1
|
||||
'@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1
|
||||
'@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1
|
||||
'@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 1.32.1
|
||||
rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1
|
||||
rollup: 2.70.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1
|
||||
tslib: 2.3.1
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.15.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- debug
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
file:projects/arm-dnsresolver.tgz:
|
||||
resolution: {integrity: sha512-Mdpxepj5NOCwZ35IxyC3phiZypOZw1GGibXV0PcM8mUgh/0lDb7brPCSdardWT7MuEIEkdz/oSCKMpu245xLmA==, tarball: file:projects/arm-dnsresolver.tgz}
|
||||
resolution: {integrity: sha512-/2woKciaPYSducDVWATFhO8pzoOR1ek7mXhLE32uNcOK3Uq55pGydQHlrJ5dE/DgMjkqOVY/TsnugUBEGT+Ujg==, tarball: file:projects/arm-dnsresolver.tgz}
|
||||
name: '@rush-temp/arm-dnsresolver'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -10758,27 +10759,28 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-domainservices.tgz:
|
||||
resolution: {integrity: sha512-2fix9U6/4/u9dimkMVzAem51sezUnrpo7HOQCOKk8Z1N7xbGNLzbv25jILXCJCRFo7v4W+NCiByzxZvHS723CA==, tarball: file:projects/arm-domainservices.tgz}
|
||||
resolution: {integrity: sha512-lRm7SmbgT+t3kLpR7/Nq8ghNVB9Zu/DoTw8OAXwUMUodHlR1sOA8t4lKw8fFcLJbfKaiQ0/OUhkdThWdg8WfNQ==, tarball: file:projects/arm-domainservices.tgz}
|
||||
name: '@rush-temp/arm-domainservices'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
'@azure-tools/test-recorder': 1.0.2
|
||||
'@azure/identity': 2.0.4
|
||||
'@microsoft/api-extractor': 7.22.1
|
||||
'@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@1.32.1
|
||||
'@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1
|
||||
'@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1
|
||||
'@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 1.32.1
|
||||
rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1
|
||||
rollup: 2.70.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1
|
||||
tslib: 2.3.1
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.15.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- debug
|
||||
- encoding
|
||||
- supports-color
|
||||
|
@ -10841,7 +10843,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-eventhub.tgz:
|
||||
resolution: {integrity: sha512-PSXQZCbu3khNcog69nSkJIkxY5B/rrJrDzexztWggP8zv739TwQNKg4UU8bQ4D/FguT6lMaqLk/umLu+cQ9/Pg==, tarball: file:projects/arm-eventhub.tgz}
|
||||
resolution: {integrity: sha512-kR+bKe5j52c6mA6YtR4hc6P9e0HfvwguqHTSSs5ksanC+C2b30ywFUR1yWtDYBZR7INe5W9mdw3YNhg6Sgajhg==, tarball: file:projects/arm-eventhub.tgz}
|
||||
name: '@rush-temp/arm-eventhub'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -10850,18 +10852,19 @@ packages:
|
|||
'@microsoft/api-extractor': 7.22.1
|
||||
'@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 3.0.1_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 8.4.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.70.1
|
||||
rollup-plugin-sourcemaps: 0.4.2_rollup@2.70.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1
|
||||
tslib: 2.3.1
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.15.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- debug
|
||||
- encoding
|
||||
- supports-color
|
||||
|
@ -10894,7 +10897,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-features.tgz:
|
||||
resolution: {integrity: sha512-DViMNjyzmfMGkHCrqCMltWcpM4GVFaK+9KrcI9zjPE4EXEEpIhUL2raKgdvEfIscPJTlojobq5Xl8Z2qLx2w6A==, tarball: file:projects/arm-features.tgz}
|
||||
resolution: {integrity: sha512-RUfzOPPCnBBRZWam4z2V5DLc4KLILwKDYxblrA6wN4pAhDlphsCHYJnUV4C5dGhvCmO9z+bD2EOTZ53K7UWmww==, tarball: file:projects/arm-features.tgz}
|
||||
name: '@rush-temp/arm-features'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -10903,18 +10906,19 @@ packages:
|
|||
'@microsoft/api-extractor': 7.22.1
|
||||
'@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 3.0.1_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 8.4.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.70.1
|
||||
rollup-plugin-sourcemaps: 0.4.2_rollup@2.70.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1
|
||||
tslib: 2.3.1
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.15.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- debug
|
||||
- encoding
|
||||
- supports-color
|
||||
|
@ -11389,7 +11393,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-links.tgz:
|
||||
resolution: {integrity: sha512-5Jd8Lh92kFnuiPpGs8xqDFdDoXJ6jR7cQIrn3kg3anlCy2jFBCOlHmBtvw3vzYiOvDjnEsyC6DdT4wiwzCfaLQ==, tarball: file:projects/arm-links.tgz}
|
||||
resolution: {integrity: sha512-6b0saW24zzO4tUTRKUjbNs2SqnBRyHl1YulfkAXgClGdfHR7XPrlKfVSJ+/j8SY5xqS5MKz75e3VKaeAKIixYw==, tarball: file:projects/arm-links.tgz}
|
||||
name: '@rush-temp/arm-links'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -11398,18 +11402,19 @@ packages:
|
|||
'@microsoft/api-extractor': 7.22.1
|
||||
'@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 3.0.1_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 8.4.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.70.1
|
||||
rollup-plugin-sourcemaps: 0.4.2_rollup@2.70.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1
|
||||
tslib: 2.3.1
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.15.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- debug
|
||||
- encoding
|
||||
- supports-color
|
||||
|
@ -11471,7 +11476,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-locks.tgz:
|
||||
resolution: {integrity: sha512-IMmYQddkd+gIWuG+Pqk8kqtc8WGvvI/Rl8QIOCHdRvA6UDumqNIX0pczGEyALzbFfxREbSLOvwel8t5mMbTXTQ==, tarball: file:projects/arm-locks.tgz}
|
||||
resolution: {integrity: sha512-K1/Sb4eDySnq4tEFQIORBTnLOPe1NtdFrRXM+54drdqeKzgwnOpK58fxipfXQZLIv2X4sNkIdweIvaJUzT+PHg==, tarball: file:projects/arm-locks.tgz}
|
||||
name: '@rush-temp/arm-locks'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -11480,18 +11485,19 @@ packages:
|
|||
'@microsoft/api-extractor': 7.22.1
|
||||
'@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 3.0.1_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 8.4.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.70.1
|
||||
rollup-plugin-sourcemaps: 0.4.2_rollup@2.70.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1
|
||||
tslib: 2.3.1
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.15.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- debug
|
||||
- encoding
|
||||
- supports-color
|
||||
|
@ -11606,7 +11612,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-managedapplications.tgz:
|
||||
resolution: {integrity: sha512-mMzLzle8gAbHD2L40yoMw0R880/Ivgr8RNHtjGWetwzt0oGgrK/cnRd01WTAkYaL6u5mzW41Q1DO8ZATjet+Yw==, tarball: file:projects/arm-managedapplications.tgz}
|
||||
resolution: {integrity: sha512-5NkhwKrpUFE8CCIOg2BP8wrV8nR4HqAbsVjdX78ZaItpSRbHxhUleAmBk3i1E15xkxGgbj5LVmN91rh2LJkITA==, tarball: file:projects/arm-managedapplications.tgz}
|
||||
name: '@rush-temp/arm-managedapplications'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -11615,18 +11621,19 @@ packages:
|
|||
'@microsoft/api-extractor': 7.22.1
|
||||
'@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 3.0.1_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 8.4.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.70.1
|
||||
rollup-plugin-sourcemaps: 0.4.2_rollup@2.70.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1
|
||||
tslib: 2.3.1
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.15.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- debug
|
||||
- encoding
|
||||
- supports-color
|
||||
|
@ -12289,7 +12296,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-policy.tgz:
|
||||
resolution: {integrity: sha512-S8YG3gEBFiuJtwOTqFXRaiJ5J7LrDGd5Li68322L4lCwC2sTDtutjFpUFsgugYtMcf9aF+HlHt5XWLXzSEhDCA==, tarball: file:projects/arm-policy.tgz}
|
||||
resolution: {integrity: sha512-zD1xdPnloTYWj0aPhDUZF5PS8cOhTBrSrqkjT3ZQC8glip2qinzA9SlhvpYuSGkvMXHKpyYxDmgY6fTsFkaXdA==, tarball: file:projects/arm-policy.tgz}
|
||||
name: '@rush-temp/arm-policy'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -12298,18 +12305,19 @@ packages:
|
|||
'@microsoft/api-extractor': 7.22.1
|
||||
'@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 3.0.1_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 8.4.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.70.1
|
||||
rollup-plugin-sourcemaps: 0.4.2_rollup@2.70.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1
|
||||
tslib: 2.3.1
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.15.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- debug
|
||||
- encoding
|
||||
- supports-color
|
||||
|
@ -12860,7 +12868,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-resources-subscriptions.tgz:
|
||||
resolution: {integrity: sha512-0h4G+pEZRKtMpHvVKX1DESX7mhYYKHf++qaANFa2T6/nDKwr8hqOr8ZKL2moWOqLYm8k+hxvkL75HLDm+ATyUQ==, tarball: file:projects/arm-resources-subscriptions.tgz}
|
||||
resolution: {integrity: sha512-MeonSZa7jE2DoCM/Yl+DtKhcFQxSvyqbhjOjycW09J97mp5wI+LlzXivvsD6b2OmJKOmxTrAfXdzM1ZKL+x8fA==, tarball: file:projects/arm-resources-subscriptions.tgz}
|
||||
name: '@rush-temp/arm-resources-subscriptions'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -12869,25 +12877,26 @@ packages:
|
|||
'@microsoft/api-extractor': 7.22.1
|
||||
'@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 3.0.1_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 8.4.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.70.1
|
||||
rollup-plugin-sourcemaps: 0.4.2_rollup@2.70.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1
|
||||
tslib: 2.3.1
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.15.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- debug
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
file:projects/arm-resources.tgz:
|
||||
resolution: {integrity: sha512-y2FiCFtpnmiMB0OacO611Sqlsr0/UQ6oKTv/q6JonPxes4Lz3sRwCqn+lFWrEjF7Vn1xgm/WugoCXL7tp3eyEQ==, tarball: file:projects/arm-resources.tgz}
|
||||
resolution: {integrity: sha512-E0EJhA4/klMvBHqEWH7PCAPcWOJOLMIVx8TLdcH+wQduj2vdDfv8Ti9AcIw9oGHSfZ884WcT20ou3toGApXyLw==, tarball: file:projects/arm-resources.tgz}
|
||||
name: '@rush-temp/arm-resources'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -12896,18 +12905,19 @@ packages:
|
|||
'@microsoft/api-extractor': 7.22.1
|
||||
'@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 3.0.1_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 8.4.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.70.1
|
||||
rollup-plugin-sourcemaps: 0.4.2_rollup@2.70.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1
|
||||
tslib: 2.3.1
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.15.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- debug
|
||||
- encoding
|
||||
- supports-color
|
||||
|
@ -13543,7 +13553,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-templatespecs.tgz:
|
||||
resolution: {integrity: sha512-o0Qh5cZPGQDqFCFWt/CtLRecoYltLMkUY/VjMiVax5VpGJyOAHo8EWNlfh1p/QTqKhSGDiS+f9H4xASA7bExQQ==, tarball: file:projects/arm-templatespecs.tgz}
|
||||
resolution: {integrity: sha512-j9Oa28D2fvG7CgudfPFux9wFA28Oftvk3jVSKAj0qkMVSMk57Ah9kwp4pQ2r56pZ8/XSWTj1M9wBOswxDrCrGg==, tarball: file:projects/arm-templatespecs.tgz}
|
||||
name: '@rush-temp/arm-templatespecs'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -13552,18 +13562,19 @@ packages:
|
|||
'@microsoft/api-extractor': 7.22.1
|
||||
'@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 3.0.1_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 8.4.0_rollup@2.70.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1
|
||||
'@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.70.1
|
||||
rollup-plugin-sourcemaps: 0.4.2_rollup@2.70.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1
|
||||
tslib: 2.3.1
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.15.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- debug
|
||||
- encoding
|
||||
- supports-color
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
# Release History
|
||||
|
||||
## 5.0.1 (Unreleased)
|
||||
## 5.0.1 (2022-04-18)
|
||||
|
||||
### Features Added
|
||||
**features**
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
### Bugs Fixed
|
||||
|
||||
### Other Changes
|
||||
- Bug fix
|
||||
|
||||
## 5.0.0 (2022-01-13)
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 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
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -16,6 +16,8 @@ The DNS Management Client.
|
|||
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
|
||||
- Latest versions of Safari, Chrome, Edge and Firefox.
|
||||
|
||||
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- An [Azure subscription][azure_sub].
|
||||
|
@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this
|
|||
```javascript
|
||||
const { DnsManagementClient } = require("@azure/arm-dns");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
|
||||
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const client = new DnsManagementClient(new DefaultAzureCredential(), subscriptionId);
|
||||
|
||||
// For client-side applications running in the browser, use this code instead:
|
||||
// const credential = new InteractiveBrowserCredential({
|
||||
// tenantId: "<YOUR_TENANT_ID>",
|
||||
// clientId: "<YOUR_CLIENT_ID>"
|
||||
// });
|
||||
// const client = new DnsManagementClient(credential, subscriptionId);
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"commit": "1f1d5b0b9ce6cc94605b2fd619dce374fb6e033a",
|
||||
"readme": "specification/dns/resource-manager/readme.md",
|
||||
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/devspaces/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211217.1",
|
||||
"readme": "specification\\dns\\resource-manager\\readme.md",
|
||||
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\dns\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
|
||||
"use": "@autorest/typescript@6.0.0-alpha.16.20211217.1"
|
||||
}
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.2.6",
|
||||
"use": "@autorest/typescript@6.0.0-alpha.19.20220408.1"
|
||||
}
|
|
@ -1,18 +1,31 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
||||
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
|
||||
"docModel": { "enabled": true },
|
||||
"apiReport": { "enabled": true, "reportFolder": "./review" },
|
||||
"docModel": {
|
||||
"enabled": true
|
||||
},
|
||||
"apiReport": {
|
||||
"enabled": true,
|
||||
"reportFolder": "./review"
|
||||
},
|
||||
"dtsRollup": {
|
||||
"enabled": true,
|
||||
"untrimmedFilePath": "",
|
||||
"publicTrimmedFilePath": "./types/arm-dns.d.ts"
|
||||
},
|
||||
"messages": {
|
||||
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
|
||||
"tsdocMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
},
|
||||
"extractorMessageReporting": {
|
||||
"ae-missing-release-tag": { "logLevel": "none" },
|
||||
"ae-unresolved-link": { "logLevel": "none" }
|
||||
"ae-missing-release-tag": {
|
||||
"logLevel": "none"
|
||||
},
|
||||
"ae-unresolved-link": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,9 +11,9 @@
|
|||
"@azure/core-lro": "^2.2.0",
|
||||
"@azure/abort-controller": "^1.0.0",
|
||||
"@azure/core-paging": "^1.2.0",
|
||||
"@azure/core-client": "^1.0.0",
|
||||
"@azure/core-client": "^1.5.0",
|
||||
"@azure/core-auth": "^1.3.0",
|
||||
"@azure/core-rest-pipeline": "^1.1.0",
|
||||
"@azure/core-rest-pipeline": "^1.8.0",
|
||||
"tslib": "^2.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
|
@ -29,13 +29,13 @@
|
|||
"types": "./types/arm-dns.d.ts",
|
||||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "^7.18.11",
|
||||
"@rollup/plugin-commonjs": "11.0.2",
|
||||
"@rollup/plugin-json": "^4.0.0",
|
||||
"@rollup/plugin-multi-entry": "^3.0.0",
|
||||
"@rollup/plugin-node-resolve": "^8.0.0",
|
||||
"@rollup/plugin-commonjs": "^21.0.1",
|
||||
"@rollup/plugin-json": "^4.1.0",
|
||||
"@rollup/plugin-multi-entry": "^4.1.0",
|
||||
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||
"mkdirp": "^1.0.4",
|
||||
"rollup": "^1.16.3",
|
||||
"rollup-plugin-sourcemaps": "^0.4.2",
|
||||
"rollup": "^2.66.1",
|
||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||
"typescript": "~4.2.0",
|
||||
"uglify-js": "^3.4.9",
|
||||
"rimraf": "^3.0.0",
|
||||
|
@ -98,5 +98,21 @@
|
|||
"docs": "echo skipped"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"autoPublish": true
|
||||
"//metadata": {
|
||||
"constantPaths": [
|
||||
{
|
||||
"path": "src/dnsManagementClient.ts",
|
||||
"prefix": "packageDetails"
|
||||
}
|
||||
]
|
||||
},
|
||||
"autoPublish": true,
|
||||
"//sampleConfiguration": {
|
||||
"productName": "",
|
||||
"productSlugs": [
|
||||
"azure"
|
||||
],
|
||||
"disableDocsMs": true,
|
||||
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-dns?view=azure-node-preview"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,62 +14,14 @@ import json from "@rollup/plugin-json";
|
|||
|
||||
import nodeBuiltins from "builtin-modules";
|
||||
|
||||
/**
|
||||
* Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
|
||||
*
|
||||
* NOTE: this manual configuration is only needed because OpenTelemetry uses an
|
||||
* __exportStar downleveled helper function to declare its exports which confuses
|
||||
* rollup's automatic discovery mechanism.
|
||||
*
|
||||
* @returns an object reference that can be `...`'d into your cjs() configuration.
|
||||
*/
|
||||
export function openTelemetryCommonJs() {
|
||||
const namedExports = {};
|
||||
|
||||
for (const key of [
|
||||
"@opentelemetry/api",
|
||||
"@azure/core-tracing/node_modules/@opentelemetry/api"
|
||||
]) {
|
||||
namedExports[key] = [
|
||||
"SpanKind",
|
||||
"TraceFlags",
|
||||
"getSpan",
|
||||
"setSpan",
|
||||
"SpanStatusCode",
|
||||
"getSpanContext",
|
||||
"setSpanContext"
|
||||
];
|
||||
}
|
||||
|
||||
const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
|
||||
|
||||
for (const version of releasedOpenTelemetryVersions) {
|
||||
namedExports[
|
||||
// working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
|
||||
`../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
|
||||
] = [
|
||||
"SpanKind",
|
||||
"TraceFlags",
|
||||
"getSpan",
|
||||
"setSpan",
|
||||
"StatusCode",
|
||||
"CanonicalCode",
|
||||
"getSpanContext",
|
||||
"setSpanContext"
|
||||
];
|
||||
}
|
||||
|
||||
return namedExports;
|
||||
}
|
||||
|
||||
// #region Warning Handler
|
||||
|
||||
/**
|
||||
* A function that can determine whether a rollupwarning should be ignored. If
|
||||
* A function that can determine whether a rollup warning should be ignored. If
|
||||
* the function returns `true`, then the warning will not be displayed.
|
||||
*/
|
||||
|
||||
function ignoreNiseSinonEvalWarnings(warning) {
|
||||
function ignoreNiseSinonEval(warning) {
|
||||
return (
|
||||
warning.code === "EVAL" &&
|
||||
warning.id &&
|
||||
|
@ -78,17 +30,14 @@ function ignoreNiseSinonEvalWarnings(warning) {
|
|||
);
|
||||
}
|
||||
|
||||
function ignoreChaiCircularDependencyWarnings(warning) {
|
||||
function ignoreChaiCircularDependency(warning) {
|
||||
return (
|
||||
warning.code === "CIRCULAR_DEPENDENCY" &&
|
||||
warning.importer && warning.importer.includes("node_modules/chai") === true
|
||||
);
|
||||
}
|
||||
|
||||
const warningInhibitors = [
|
||||
ignoreChaiCircularDependencyWarnings,
|
||||
ignoreNiseSinonEvalWarnings
|
||||
];
|
||||
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
|
||||
|
||||
/**
|
||||
* Construct a warning handler for the shared rollup configuration
|
||||
|
@ -122,22 +71,7 @@ function makeBrowserTestConfig() {
|
|||
nodeResolve({
|
||||
mainFields: ["module", "browser"]
|
||||
}),
|
||||
cjs({
|
||||
namedExports: {
|
||||
// Chai's strange internal architecture makes it impossible to statically
|
||||
// analyze its exports.
|
||||
chai: [
|
||||
"version",
|
||||
"use",
|
||||
"util",
|
||||
"config",
|
||||
"expect",
|
||||
"should",
|
||||
"assert"
|
||||
],
|
||||
...openTelemetryCommonJs()
|
||||
}
|
||||
}),
|
||||
cjs(),
|
||||
json(),
|
||||
sourcemaps()
|
||||
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
|
||||
|
@ -173,7 +107,7 @@ export function makeConfig(pkg, options) {
|
|||
],
|
||||
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
|
||||
preserveSymlinks: false,
|
||||
plugins: [sourcemaps(), nodeResolve(), cjs()]
|
||||
plugins: [sourcemaps(), nodeResolve()]
|
||||
};
|
||||
|
||||
const config = [baseConfig];
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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 {
|
||||
DnsResourceReferenceRequest,
|
||||
DnsManagementClient
|
||||
} from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
async function listZonesByResourceGroup() {
|
||||
const subscriptionId = "subid";
|
||||
const parameters: DnsResourceReferenceRequest = {
|
||||
targetResources: [
|
||||
{
|
||||
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
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
listZonesByResourceGroup().catch(console.error);
|
|
@ -0,0 +1,364 @@
|
|||
/*
|
||||
* 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);
|
|
@ -0,0 +1,237 @@
|
|||
/*
|
||||
* 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);
|
|
@ -0,0 +1,262 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function getARecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getAaaaRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getCaaRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getPtrRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getSrvRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getTxtRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getTxtRecordset().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listRecordsetsByZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listRecordsetsByZone().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listRecordsetsByZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listRecordsetsByZone().catch(console.error);
|
|
@ -0,0 +1,272 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listARecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "A";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listAaaaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "AAAA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listCaaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "CAA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listCnameRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "CNAME";
|
||||
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);
|
||||
}
|
||||
|
||||
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/stable/2018-05-01/examples/ListMXRecordset.json
|
||||
*/
|
||||
async function listMxRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "MX";
|
||||
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);
|
||||
}
|
||||
|
||||
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/stable/2018-05-01/examples/ListNSRecordset.json
|
||||
*/
|
||||
async function listNsRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "NS";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listPtrRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const recordType = "PTR";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listSoaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "SOA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listSrvRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "SRV";
|
||||
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);
|
||||
}
|
||||
|
||||
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/stable/2018-05-01/examples/ListTXTRecordset.json
|
||||
*/
|
||||
async function listTxtRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "TXT";
|
||||
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);
|
||||
}
|
||||
|
||||
listTxtRecordsets().catch(console.error);
|
|
@ -0,0 +1,282 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function patchARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchPtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
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);
|
||||
}
|
||||
|
||||
patchTxtRecordset().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.
|
||||
import { Zone, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
async function createZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const parameters: Zone = { location: "Global", tags: { key1: "value1" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createZone().catch(console.error);
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function deleteZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
zoneName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteZone().catch(console.error);
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function getZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.get(resourceGroupName, zoneName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getZone().catch(console.error);
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listZonesByResourceGroup() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.zones.listByResourceGroup(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listZonesByResourceGroup().catch(console.error);
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listZonesBySubscription() {
|
||||
const subscriptionId = "subid";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.zones.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listZonesBySubscription().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.
|
||||
import { ZoneUpdate, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
async function patchZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const parameters: ZoneUpdate = { tags: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchZone().catch(console.error);
|
|
@ -0,0 +1,76 @@
|
|||
# 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://nodejs.org/about/releases/).
|
||||
|
||||
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
|
|
@ -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");
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
async function listZonesByResourceGroup() {
|
||||
const subscriptionId = "subid";
|
||||
const parameters = {
|
||||
targetResources: [
|
||||
{
|
||||
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);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
listZonesByResourceGroup().catch(console.error);
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-dns-js",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for JavaScript",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/dns/arm-dns"
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"azure",
|
||||
"typescript",
|
||||
"browser",
|
||||
"isomorphic"
|
||||
],
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns",
|
||||
"dependencies": {
|
||||
"@azure/arm-dns": "latest",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^2.0.1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,363 @@
|
|||
/*
|
||||
* 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);
|
|
@ -0,0 +1,237 @@
|
|||
/*
|
||||
* 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);
|
|
@ -0,0 +1,262 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function getARecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getAaaaRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getCaaRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getPtrRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getSrvRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getTxtRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getTxtRecordset().catch(console.error);
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listRecordsetsByZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listRecordsetsByZone().catch(console.error);
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listRecordsetsByZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listRecordsetsByZone().catch(console.error);
|
|
@ -0,0 +1,232 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listARecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "A";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listAaaaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "AAAA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listCaaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "CAA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listCnameRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "CNAME";
|
||||
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);
|
||||
}
|
||||
|
||||
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/stable/2018-05-01/examples/ListMXRecordset.json
|
||||
*/
|
||||
async function listMxRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "MX";
|
||||
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);
|
||||
}
|
||||
|
||||
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/stable/2018-05-01/examples/ListNSRecordset.json
|
||||
*/
|
||||
async function listNsRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "NS";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listPtrRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const recordType = "PTR";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listSoaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "SOA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listSrvRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "SRV";
|
||||
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);
|
||||
}
|
||||
|
||||
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/stable/2018-05-01/examples/ListTXTRecordset.json
|
||||
*/
|
||||
async function listTxtRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "TXT";
|
||||
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);
|
||||
}
|
||||
|
||||
listTxtRecordsets().catch(console.error);
|
|
@ -0,0 +1,282 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function patchARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchPtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
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);
|
||||
}
|
||||
|
||||
patchTxtRecordset().catch(console.error);
|
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function createZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const parameters = { location: "Global", tags: { key1: "value1" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.createOrUpdate(resourceGroupName, zoneName, parameters);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createZone().catch(console.error);
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function deleteZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.beginDeleteAndWait(resourceGroupName, zoneName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteZone().catch(console.error);
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function getZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.get(resourceGroupName, zoneName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getZone().catch(console.error);
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listZonesByResourceGroup() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.zones.listByResourceGroup(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listZonesByResourceGroup().catch(console.error);
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listZonesBySubscription() {
|
||||
const subscriptionId = "subid";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.zones.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listZonesBySubscription().catch(console.error);
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function patchZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const parameters = { tags: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.update(resourceGroupName, zoneName, parameters);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchZone().catch(console.error);
|
|
@ -0,0 +1,89 @@
|
|||
# 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://nodejs.org/about/releases/).
|
||||
|
||||
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
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-dns-ts",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for TypeScript",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"prebuild": "rimraf dist/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/dns/arm-dns"
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"azure",
|
||||
"typescript",
|
||||
"browser",
|
||||
"isomorphic"
|
||||
],
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns",
|
||||
"dependencies": {
|
||||
"@azure/arm-dns": "latest",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.0",
|
||||
"typescript": "~4.4.0",
|
||||
"rimraf": "latest"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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 {
|
||||
DnsResourceReferenceRequest,
|
||||
DnsManagementClient
|
||||
} from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
async function listZonesByResourceGroup() {
|
||||
const subscriptionId = "subid";
|
||||
const parameters: DnsResourceReferenceRequest = {
|
||||
targetResources: [
|
||||
{
|
||||
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
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
listZonesByResourceGroup().catch(console.error);
|
|
@ -0,0 +1,364 @@
|
|||
/*
|
||||
* 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);
|
|
@ -0,0 +1,237 @@
|
|||
/*
|
||||
* 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);
|
|
@ -0,0 +1,262 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function getARecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getAaaaRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getCaaRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getPtrRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.recordSets.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getSrvRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
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
|
||||
*/
|
||||
async function getTxtRecordset() {
|
||||
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.get(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
relativeRecordSetName,
|
||||
recordType
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getTxtRecordset().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listRecordsetsByZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listRecordsetsByZone().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listRecordsetsByZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "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
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listRecordsetsByZone().catch(console.error);
|
|
@ -0,0 +1,272 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listARecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "A";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listAaaaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "AAAA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listCaaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "CAA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listCnameRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "CNAME";
|
||||
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);
|
||||
}
|
||||
|
||||
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/stable/2018-05-01/examples/ListMXRecordset.json
|
||||
*/
|
||||
async function listMxRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "MX";
|
||||
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);
|
||||
}
|
||||
|
||||
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/stable/2018-05-01/examples/ListNSRecordset.json
|
||||
*/
|
||||
async function listNsRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "NS";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listPtrRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const recordType = "PTR";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listSoaRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "SOA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function listSrvRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "SRV";
|
||||
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);
|
||||
}
|
||||
|
||||
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/stable/2018-05-01/examples/ListTXTRecordset.json
|
||||
*/
|
||||
async function listTxtRecordsets() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const recordType = "TXT";
|
||||
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);
|
||||
}
|
||||
|
||||
listTxtRecordsets().catch(console.error);
|
|
@ -0,0 +1,282 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function patchARecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "A";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchAaaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "AAAA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchCaaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CAA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchCnameRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "CNAME";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchMxRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "MX";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchNsRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "NS";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchPtrRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "0.0.127.in-addr.arpa";
|
||||
const relativeRecordSetName = "1";
|
||||
const recordType = "PTR";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchSoaRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "@";
|
||||
const recordType = "SOA";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchSrvRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "SRV";
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
async function patchTxtRecordset() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const relativeRecordSetName = "record1";
|
||||
const recordType = "TXT";
|
||||
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);
|
||||
}
|
||||
|
||||
patchTxtRecordset().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.
|
||||
import { Zone, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
async function createZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const parameters: Zone = { location: "Global", tags: { key1: "value1" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.createOrUpdate(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createZone().catch(console.error);
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function deleteZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
zoneName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteZone().catch(console.error);
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function getZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.get(resourceGroupName, zoneName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getZone().catch(console.error);
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listZonesByResourceGroup() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.zones.listByResourceGroup(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listZonesByResourceGroup().catch(console.error);
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
async function listZonesBySubscription() {
|
||||
const subscriptionId = "subid";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.zones.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listZonesBySubscription().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.
|
||||
import { ZoneUpdate, DnsManagementClient } from "@azure/arm-dns";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
async function patchZone() {
|
||||
const subscriptionId = "subid";
|
||||
const resourceGroupName = "rg1";
|
||||
const zoneName = "zone1";
|
||||
const parameters: ZoneUpdate = { tags: { key2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsManagementClient(credential, subscriptionId);
|
||||
const result = await client.zones.update(
|
||||
resourceGroupName,
|
||||
zoneName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
patchZone().catch(console.error);
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2018",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"alwaysStrict": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": [
|
||||
"src/**.ts"
|
||||
]
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
import * as coreClient from "@azure/core-client";
|
||||
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
||||
import * as coreAuth from "@azure/core-auth";
|
||||
import {
|
||||
RecordSetsImpl,
|
||||
|
@ -53,7 +54,7 @@ export class DnsManagementClient extends coreClient.ServiceClient {
|
|||
credential: credentials
|
||||
};
|
||||
|
||||
const packageDetails = `azsdk-js-arm-dns/5.0.0`;
|
||||
const packageDetails = `azsdk-js-arm-dns/5.0.1`;
|
||||
const userAgentPrefix =
|
||||
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
||||
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
||||
|
@ -68,9 +69,33 @@ export class DnsManagementClient extends coreClient.ServiceClient {
|
|||
userAgentOptions: {
|
||||
userAgentPrefix
|
||||
},
|
||||
baseUri: options.endpoint || "https://management.azure.com"
|
||||
baseUri:
|
||||
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
||||
};
|
||||
super(optionsWithDefaults);
|
||||
|
||||
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
||||
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
||||
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
||||
(pipelinePolicy) =>
|
||||
pipelinePolicy.name ===
|
||||
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
||||
);
|
||||
if (!bearerTokenAuthenticationPolicyFound) {
|
||||
this.pipeline.removePolicy({
|
||||
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
||||
});
|
||||
this.pipeline.addPolicy(
|
||||
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
||||
scopes: `${optionsWithDefaults.baseUri}/.default`,
|
||||
challengeCallbacks: {
|
||||
authorizeRequestOnChallenge:
|
||||
coreClient.authorizeRequestOnClaimChallenge
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
// Parameter assignments
|
||||
this.subscriptionId = subscriptionId;
|
||||
|
||||
|
|
|
@ -217,10 +217,12 @@ export class ZonesImpl implements Zones {
|
|||
{ resourceGroupName, zoneName, options },
|
||||
deleteOperationSpec
|
||||
);
|
||||
return new LroEngine(lro, {
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,11 +9,25 @@
|
|||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"lib": ["es6", "dom"],
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"declaration": true,
|
||||
"outDir": "./dist-esm",
|
||||
"importHelpers": true
|
||||
"importHelpers": true,
|
||||
"paths": {
|
||||
"@azure/arm-dns": [
|
||||
"./src/index"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": ["./src/**/*.ts", "./test/**/*.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
"include": [
|
||||
"./src/**/*.ts",
|
||||
"./test/**/*.ts",
|
||||
"samples-dev/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
|
@ -9,8 +9,8 @@ trigger:
|
|||
paths:
|
||||
include:
|
||||
- sdk/dns/ci.mgmt.yml
|
||||
- sdk/dns/arm-dns/
|
||||
- sdk/dns/arm-dns-profile-2020-09-01-hybrid
|
||||
- sdk/dns/arm-dns
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
|
@ -23,8 +23,8 @@ pr:
|
|||
paths:
|
||||
include:
|
||||
- sdk/dns/ci.mgmt.yml
|
||||
- sdk/dns/arm-dns/
|
||||
- sdk/dns/arm-dns-profile-2020-09-01-hybrid
|
||||
- sdk/dns/arm-dns
|
||||
extends:
|
||||
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
|
||||
parameters:
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
# Release History
|
||||
|
||||
## 1.0.0-beta.2 (Unreleased)
|
||||
## 1.0.0-beta.3 (2022-04-18)
|
||||
|
||||
### Features Added
|
||||
**features**
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
### Bugs Fixed
|
||||
|
||||
### Other Changes
|
||||
- Bug fix
|
||||
|
||||
## 1.0.0-beta.1 (2022-02-16)
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@ The DNS Resolver Management Client.
|
|||
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
|
||||
- Latest versions of Safari, Chrome, Edge and Firefox.
|
||||
|
||||
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- An [Azure subscription][azure_sub].
|
||||
|
@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this
|
|||
```javascript
|
||||
const { DnsResolverManagementClient } = require("@azure/arm-dnsresolver");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
|
||||
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const client = new DnsResolverManagementClient(new DefaultAzureCredential(), subscriptionId);
|
||||
|
||||
// For client-side applications running in the browser, use this code instead:
|
||||
// const credential = new InteractiveBrowserCredential({
|
||||
// tenantId: "<YOUR_TENANT_ID>",
|
||||
// clientId: "<YOUR_CLIENT_ID>"
|
||||
// });
|
||||
// const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"commit": "ff4dffa3aa168c2ec0b58b9dbe9e9b13613208a2",
|
||||
"readme": "specification/dnsresolver/resource-manager/readme.md",
|
||||
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/dnsresolver/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220214.1 --generate-sample=true",
|
||||
"readme": "specification\\dnsresolver\\resource-manager\\readme.md",
|
||||
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\dnsresolver\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
|
||||
"use": "@autorest/typescript@6.0.0-alpha.16.20220214.1"
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.2.6",
|
||||
"use": "@autorest/typescript@6.0.0-alpha.19.20220408.1"
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
"sdk-type": "mgmt",
|
||||
"author": "Microsoft Corporation",
|
||||
"description": "A generated SDK for DnsResolverManagementClient.",
|
||||
"version": "1.0.0-beta.2",
|
||||
"version": "1.0.0-beta.3",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
|
@ -11,9 +11,9 @@
|
|||
"@azure/core-lro": "^2.2.0",
|
||||
"@azure/abort-controller": "^1.0.0",
|
||||
"@azure/core-paging": "^1.2.0",
|
||||
"@azure/core-client": "^1.0.0",
|
||||
"@azure/core-client": "^1.5.0",
|
||||
"@azure/core-auth": "^1.3.0",
|
||||
"@azure/core-rest-pipeline": "^1.1.0",
|
||||
"@azure/core-rest-pipeline": "^1.8.0",
|
||||
"tslib": "^2.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
|
@ -115,4 +115,4 @@
|
|||
"disableDocsMs": true,
|
||||
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-dnsresolver?view=azure-node-preview"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* 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 {
|
||||
DnsForwardingRuleset,
|
||||
DnsResolverManagementClient
|
||||
} from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a DNS forwarding ruleset.
|
||||
*
|
||||
* @summary Creates or updates a DNS forwarding ruleset.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_Put.json
|
||||
*/
|
||||
async function upsertDnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "samplednsForwardingRuleset";
|
||||
const parameters: DnsForwardingRuleset = {
|
||||
dnsResolverOutboundEndpoints: [
|
||||
{
|
||||
id:
|
||||
"/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint0"
|
||||
},
|
||||
{
|
||||
id:
|
||||
"/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint1"
|
||||
}
|
||||
],
|
||||
location: "westus2",
|
||||
tags: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnsForwardingRulesets.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
upsertDnsForwardingRuleset().catch(console.error);
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a DNS forwarding ruleset. WARNING: This operation cannot be undone. All forwarding rules within the ruleset will be deleted.
|
||||
*
|
||||
* @summary Deletes a DNS forwarding ruleset. WARNING: This operation cannot be undone. All forwarding rules within the ruleset will be deleted.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_Delete.json
|
||||
*/
|
||||
async function deleteDnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "samplednsForwardingRulesetName";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnsForwardingRulesets.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteDnsForwardingRuleset().catch(console.error);
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a DNS forwarding ruleset properties.
|
||||
*
|
||||
* @summary Gets a DNS forwarding ruleset properties.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_Get.json
|
||||
*/
|
||||
async function retrieveDnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "sampleDnsForwardingRuleset";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnsForwardingRulesets.get(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
retrieveDnsForwardingRuleset().catch(console.error);
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists DNS forwarding rulesets within a resource group.
|
||||
*
|
||||
* @summary Lists DNS forwarding rulesets within a resource group.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_ListByResourceGroup.json
|
||||
*/
|
||||
async function listDnsForwardingRulesetsByResourceGroup() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.dnsForwardingRulesets.listByResourceGroup(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listDnsForwardingRulesetsByResourceGroup().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists DNS forwarding ruleset resource IDs attached to a virtual network.
|
||||
*
|
||||
* @summary Lists DNS forwarding ruleset resource IDs attached to a virtual network.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_ListByVirtualNetwork.json
|
||||
*/
|
||||
async function listDnsForwardingRulesetsByVirtualNetwork() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const virtualNetworkName = "sampleVirtualNetwork";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.dnsForwardingRulesets.listByVirtualNetwork(
|
||||
resourceGroupName,
|
||||
virtualNetworkName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listDnsForwardingRulesetsByVirtualNetwork().catch(console.error);
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists DNS forwarding rulesets in all resource groups of a subscription.
|
||||
*
|
||||
* @summary Lists DNS forwarding rulesets in all resource groups of a subscription.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_ListBySubscription.json
|
||||
*/
|
||||
async function listDnsForwardingRulesetsBySubscription() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.dnsForwardingRulesets.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listDnsForwardingRulesetsBySubscription().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.
|
||||
import {
|
||||
DnsForwardingRulesetPatch,
|
||||
DnsResolverManagementClient
|
||||
} from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a DNS forwarding ruleset.
|
||||
*
|
||||
* @summary Updates a DNS forwarding ruleset.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_Patch.json
|
||||
*/
|
||||
async function updateDnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "sampleDnsForwardingRuleset";
|
||||
const parameters: DnsForwardingRulesetPatch = { tags: { key1: "value1" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnsForwardingRulesets.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateDnsForwardingRuleset().catch(console.error);
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 {
|
||||
DnsResolver,
|
||||
DnsResolverManagementClient
|
||||
} from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a DNS resolver.
|
||||
*
|
||||
* @summary Creates or updates a DNS resolver.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_Put.json
|
||||
*/
|
||||
async function upsertDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const parameters: DnsResolver = {
|
||||
location: "westus2",
|
||||
tags: { key1: "value1" },
|
||||
virtualNetwork: {
|
||||
id:
|
||||
"/subscriptions/cbb1387e-4b03-44f2-ad41-58d4677b9873/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"
|
||||
}
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnsResolvers.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
dnsResolverName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
upsertDnsResolver().catch(console.error);
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a DNS resolver. WARNING: This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a DNS resolver. WARNING: This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_Delete.json
|
||||
*/
|
||||
async function deleteDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnsResolvers.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
dnsResolverName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteDnsResolver().catch(console.error);
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets properties of a DNS resolver.
|
||||
*
|
||||
* @summary Gets properties of a DNS resolver.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_Get.json
|
||||
*/
|
||||
async function retrieveDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnsResolvers.get(
|
||||
resourceGroupName,
|
||||
dnsResolverName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
retrieveDnsResolver().catch(console.error);
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists DNS resolvers within a resource group.
|
||||
*
|
||||
* @summary Lists DNS resolvers within a resource group.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_ListByResourceGroup.json
|
||||
*/
|
||||
async function listDnsResolversByResourceGroup() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.dnsResolvers.listByResourceGroup(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listDnsResolversByResourceGroup().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists DNS resolver resource IDs linked to a virtual network.
|
||||
*
|
||||
* @summary Lists DNS resolver resource IDs linked to a virtual network.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_ListByVirtualNetwork.json
|
||||
*/
|
||||
async function listDnsResolversByVirtualNetwork() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const virtualNetworkName = "sampleVirtualNetwork";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.dnsResolvers.listByVirtualNetwork(
|
||||
resourceGroupName,
|
||||
virtualNetworkName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listDnsResolversByVirtualNetwork().catch(console.error);
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists DNS resolvers in all resource groups of a subscription.
|
||||
*
|
||||
* @summary Lists DNS resolvers in all resource groups of a subscription.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_ListBySubscription.json
|
||||
*/
|
||||
async function listDnsResolversBySubscription() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.dnsResolvers.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listDnsResolversBySubscription().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.
|
||||
import {
|
||||
DnsResolverPatch,
|
||||
DnsResolverManagementClient
|
||||
} from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a DNS resolver.
|
||||
*
|
||||
* @summary Updates a DNS resolver.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_Patch.json
|
||||
*/
|
||||
async function updateDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const parameters: DnsResolverPatch = { tags: { key1: "value1" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.dnsResolvers.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
dnsResolverName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateDnsResolver().catch(console.error);
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* 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 {
|
||||
ForwardingRule,
|
||||
DnsResolverManagementClient
|
||||
} from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a forwarding rule in a DNS forwarding ruleset.
|
||||
*
|
||||
* @summary Creates or updates a forwarding rule in a DNS forwarding ruleset.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_Put.json
|
||||
*/
|
||||
async function upsertForwardingRuleInADnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "sampleDnsForwardingRuleset";
|
||||
const forwardingRuleName = "sampleForwardingRule";
|
||||
const parameters: ForwardingRule = {
|
||||
domainName: "contoso.com.",
|
||||
forwardingRuleState: "Enabled",
|
||||
metadata: { additionalProp1: "value1" },
|
||||
targetDnsServers: [
|
||||
{ ipAddress: "10.0.0.1", port: 53 },
|
||||
{ ipAddress: "10.0.0.2", port: 53 }
|
||||
]
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.forwardingRules.createOrUpdate(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName,
|
||||
forwardingRuleName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
upsertForwardingRuleInADnsForwardingRuleset().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.
|
||||
import { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a forwarding rule in a DNS forwarding ruleset. WARNING: This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a forwarding rule in a DNS forwarding ruleset. WARNING: This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_Delete.json
|
||||
*/
|
||||
async function deleteForwardingRuleInADnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "sampleDnsForwardingRuleset";
|
||||
const forwardingRuleName = "sampleForwardingRule";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.forwardingRules.delete(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName,
|
||||
forwardingRuleName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteForwardingRuleInADnsForwardingRuleset().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.
|
||||
import { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets properties of a forwarding rule in a DNS forwarding ruleset.
|
||||
*
|
||||
* @summary Gets properties of a forwarding rule in a DNS forwarding ruleset.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_Get.json
|
||||
*/
|
||||
async function retrieveForwardingRuleInADnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "sampleDnsForwardingRuleset";
|
||||
const forwardingRuleName = "sampleForwardingRule";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.forwardingRules.get(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName,
|
||||
forwardingRuleName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
retrieveForwardingRuleInADnsForwardingRuleset().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists forwarding rules in a DNS forwarding ruleset.
|
||||
*
|
||||
* @summary Lists forwarding rules in a DNS forwarding ruleset.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_List.json
|
||||
*/
|
||||
async function listForwardingRulesInADnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "sampleDnsForwardingRuleset";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.forwardingRules.list(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listForwardingRulesInADnsForwardingRuleset().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 {
|
||||
ForwardingRulePatch,
|
||||
DnsResolverManagementClient
|
||||
} from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a forwarding rule in a DNS forwarding ruleset.
|
||||
*
|
||||
* @summary Updates a forwarding rule in a DNS forwarding ruleset.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_Patch.json
|
||||
*/
|
||||
async function updateForwardingRuleInADnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "sampleDnsForwardingRuleset";
|
||||
const forwardingRuleName = "sampleForwardingRule";
|
||||
const parameters: ForwardingRulePatch = {
|
||||
forwardingRuleState: "Disabled",
|
||||
metadata: { additionalProp2: "value2" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.forwardingRules.update(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName,
|
||||
forwardingRuleName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateForwardingRuleInADnsForwardingRuleset().catch(console.error);
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* 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 {
|
||||
InboundEndpoint,
|
||||
DnsResolverManagementClient
|
||||
} from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates an inbound endpoint for a DNS resolver.
|
||||
*
|
||||
* @summary Creates or updates an inbound endpoint for a DNS resolver.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/InboundEndpoint_Put.json
|
||||
*/
|
||||
async function upsertInboundEndpointForDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const inboundEndpointName = "sampleInboundEndpoint";
|
||||
const parameters: InboundEndpoint = {
|
||||
ipConfigurations: [
|
||||
{
|
||||
privateIpAddress: "255.255.255.255",
|
||||
privateIpAllocationMethod: "Static",
|
||||
subnet: {
|
||||
id:
|
||||
"/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"
|
||||
}
|
||||
}
|
||||
],
|
||||
location: "westus2",
|
||||
tags: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.inboundEndpoints.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
dnsResolverName,
|
||||
inboundEndpointName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
upsertInboundEndpointForDnsResolver().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.
|
||||
import { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes an inbound endpoint for a DNS resolver. WARNING: This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes an inbound endpoint for a DNS resolver. WARNING: This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/InboundEndpoint_Delete.json
|
||||
*/
|
||||
async function deleteInboundEndpointForDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const inboundEndpointName = "sampleInboundEndpoint";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.inboundEndpoints.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
dnsResolverName,
|
||||
inboundEndpointName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteInboundEndpointForDnsResolver().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.
|
||||
import { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets properties of an inbound endpoint for a DNS resolver.
|
||||
*
|
||||
* @summary Gets properties of an inbound endpoint for a DNS resolver.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/InboundEndpoint_Get.json
|
||||
*/
|
||||
async function retrieveInboundEndpointForDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const inboundEndpointName = "sampleInboundEndpoint";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.inboundEndpoints.get(
|
||||
resourceGroupName,
|
||||
dnsResolverName,
|
||||
inboundEndpointName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
retrieveInboundEndpointForDnsResolver().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists inbound endpoints for a DNS resolver.
|
||||
*
|
||||
* @summary Lists inbound endpoints for a DNS resolver.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/InboundEndpoint_List.json
|
||||
*/
|
||||
async function listInboundEndpointsByDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.inboundEndpoints.list(
|
||||
resourceGroupName,
|
||||
dnsResolverName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listInboundEndpointsByDnsResolver().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 {
|
||||
InboundEndpointPatch,
|
||||
DnsResolverManagementClient
|
||||
} from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates an inbound endpoint for a DNS resolver.
|
||||
*
|
||||
* @summary Updates an inbound endpoint for a DNS resolver.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/InboundEndpoint_Patch.json
|
||||
*/
|
||||
async function updateInboundEndpointForDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const inboundEndpointName = "sampleInboundEndpoint";
|
||||
const parameters: InboundEndpointPatch = { tags: { key1: "value1" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.inboundEndpoints.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
dnsResolverName,
|
||||
inboundEndpointName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateInboundEndpointForDnsResolver().catch(console.error);
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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 {
|
||||
OutboundEndpoint,
|
||||
DnsResolverManagementClient
|
||||
} from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates an outbound endpoint for a DNS resolver.
|
||||
*
|
||||
* @summary Creates or updates an outbound endpoint for a DNS resolver.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/OutboundEndpoint_Put.json
|
||||
*/
|
||||
async function upsertOutboundEndpointForDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const outboundEndpointName = "sampleOutboundEndpoint";
|
||||
const parameters: OutboundEndpoint = {
|
||||
location: "westus2",
|
||||
subnet: {
|
||||
id:
|
||||
"/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"
|
||||
},
|
||||
tags: { key1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.outboundEndpoints.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
dnsResolverName,
|
||||
outboundEndpointName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
upsertOutboundEndpointForDnsResolver().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.
|
||||
import { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes an outbound endpoint for a DNS resolver. WARNING: This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes an outbound endpoint for a DNS resolver. WARNING: This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/OutboundEndpoint_Delete.json
|
||||
*/
|
||||
async function deleteOutboundEndpointForDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const outboundEndpointName = "sampleOutboundEndpoint";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.outboundEndpoints.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
dnsResolverName,
|
||||
outboundEndpointName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteOutboundEndpointForDnsResolver().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.
|
||||
import { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets properties of an outbound endpoint for a DNS resolver.
|
||||
*
|
||||
* @summary Gets properties of an outbound endpoint for a DNS resolver.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/OutboundEndpoint_Get.json
|
||||
*/
|
||||
async function retrieveOutboundEndpointForDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const outboundEndpointName = "sampleOutboundEndpoint";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.outboundEndpoints.get(
|
||||
resourceGroupName,
|
||||
dnsResolverName,
|
||||
outboundEndpointName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
retrieveOutboundEndpointForDnsResolver().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists outbound endpoints for a DNS resolver.
|
||||
*
|
||||
* @summary Lists outbound endpoints for a DNS resolver.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/OutboundEndpoint_List.json
|
||||
*/
|
||||
async function listOutboundEndpointsByDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.outboundEndpoints.list(
|
||||
resourceGroupName,
|
||||
dnsResolverName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listOutboundEndpointsByDnsResolver().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 {
|
||||
OutboundEndpointPatch,
|
||||
DnsResolverManagementClient
|
||||
} from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates an outbound endpoint for a DNS resolver.
|
||||
*
|
||||
* @summary Updates an outbound endpoint for a DNS resolver.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/OutboundEndpoint_Patch.json
|
||||
*/
|
||||
async function updateOutboundEndpointForDnsResolver() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsResolverName = "sampleDnsResolver";
|
||||
const outboundEndpointName = "sampleOutboundEndpoint";
|
||||
const parameters: OutboundEndpointPatch = { tags: { key1: "value1" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.outboundEndpoints.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
dnsResolverName,
|
||||
outboundEndpointName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateOutboundEndpointForDnsResolver().catch(console.error);
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* 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 {
|
||||
VirtualNetworkLink,
|
||||
DnsResolverManagementClient
|
||||
} from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a virtual network link to a DNS forwarding ruleset.
|
||||
*
|
||||
* @summary Creates or updates a virtual network link to a DNS forwarding ruleset.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/VirtualNetworkLink_Put.json
|
||||
*/
|
||||
async function upsertVirtualNetworkLinkToADnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "sampleDnsForwardingRuleset";
|
||||
const virtualNetworkLinkName = "sampleVirtualNetworkLink";
|
||||
const parameters: VirtualNetworkLink = {
|
||||
metadata: { additionalProp1: "value1" },
|
||||
virtualNetwork: {
|
||||
id:
|
||||
"/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"
|
||||
}
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkLinks.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName,
|
||||
virtualNetworkLinkName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
upsertVirtualNetworkLinkToADnsForwardingRuleset().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.
|
||||
import { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a virtual network link to a DNS forwarding ruleset. WARNING: This operation cannot be undone.
|
||||
*
|
||||
* @summary Deletes a virtual network link to a DNS forwarding ruleset. WARNING: This operation cannot be undone.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/VirtualNetworkLink_Delete.json
|
||||
*/
|
||||
async function deleteVirtualNetworkLinkToADnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "sampleDnsForwardingRuleset";
|
||||
const virtualNetworkLinkName = "sampleVirtualNetworkLink";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkLinks.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName,
|
||||
virtualNetworkLinkName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteVirtualNetworkLinkToADnsForwardingRuleset().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.
|
||||
import { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets properties of a virtual network link to a DNS forwarding ruleset.
|
||||
*
|
||||
* @summary Gets properties of a virtual network link to a DNS forwarding ruleset.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/VirtualNetworkLink_Get.json
|
||||
*/
|
||||
async function retrieveVirtualNetworkLinkToADnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "sampleDnsForwardingRuleset";
|
||||
const virtualNetworkLinkName = "sampleVirtualNetworkLink";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkLinks.get(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName,
|
||||
virtualNetworkLinkName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
retrieveVirtualNetworkLinkToADnsForwardingRuleset().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 { DnsResolverManagementClient } from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists virtual network links to a DNS forwarding ruleset.
|
||||
*
|
||||
* @summary Lists virtual network links to a DNS forwarding ruleset.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/VirtualNetworkLink_List.json
|
||||
*/
|
||||
async function listVirtualNetworkLinksToADnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "sampleDnsForwardingRuleset";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.virtualNetworkLinks.list(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listVirtualNetworkLinksToADnsForwardingRuleset().catch(console.error);
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* 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 {
|
||||
VirtualNetworkLinkPatch,
|
||||
DnsResolverManagementClient
|
||||
} from "@azure/arm-dnsresolver";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a virtual network link to a DNS forwarding ruleset.
|
||||
*
|
||||
* @summary Updates a virtual network link to a DNS forwarding ruleset.
|
||||
* x-ms-original-file: specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/VirtualNetworkLink_Patch.json
|
||||
*/
|
||||
async function updateVirtualNetworkLinkToADnsForwardingRuleset() {
|
||||
const subscriptionId = "abdd4249-9f34-4cc6-8e42-c2e32110603e";
|
||||
const resourceGroupName = "sampleResourceGroup";
|
||||
const dnsForwardingRulesetName = "sampleDnsForwardingRuleset";
|
||||
const virtualNetworkLinkName = "sampleVirtualNetworkLink";
|
||||
const parameters: VirtualNetworkLinkPatch = {
|
||||
metadata: { additionalProp1: "value1" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new DnsResolverManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkLinks.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
dnsForwardingRulesetName,
|
||||
virtualNetworkLinkName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateVirtualNetworkLinkToADnsForwardingRuleset().catch(console.error);
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче