recording refresh 24 (#24318)
* recording refresh 24 * update files * update files * update files * update files * update files * update files * update files
This commit is contained in:
Родитель
7973e98e0e
Коммит
b188f520a1
|
@ -3784,7 +3784,7 @@ packages:
|
|||
dependencies:
|
||||
semver: 7.3.8
|
||||
shelljs: 0.8.5
|
||||
typescript: 5.0.0-dev.20221221
|
||||
typescript: 5.0.0-dev.20221222
|
||||
dev: false
|
||||
|
||||
/downlevel-dts/0.7.0:
|
||||
|
@ -8488,8 +8488,8 @@ packages:
|
|||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/typescript/5.0.0-dev.20221221:
|
||||
resolution: {integrity: sha512-QpKFAtn9fFixtDNPVmOYlpmSGh1N/YP5vJq5xX5yVUiPOUrsAsEQFJxqBkGiiKrZAI132fVyM32GrhUXorp2gQ==}
|
||||
/typescript/5.0.0-dev.20221222:
|
||||
resolution: {integrity: sha512-9YjbBpzM8BrO3WcbFEE63qQtipPlBP+WFmQDpI/j1W1DInACLJESbWsVAeYBC6PUvIBMzKIVO33cJUUv2l/pmw==}
|
||||
engines: {node: '>=4.2.0'}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
@ -13044,7 +13044,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-network-profile-2020-09-01-hybrid.tgz:
|
||||
resolution: {integrity: sha512-Hz8Gz41MPZy2UY8vsAxEt/bVG0f0EKSrd5GNpY+rHh5fm7D9/+tSGJLFAJyHgViY8WoX9zFcEI9pDiskQzHfEg==, tarball: file:projects/arm-network-profile-2020-09-01-hybrid.tgz}
|
||||
resolution: {integrity: sha512-PkBFe9t5oHar5Spgj62KlYy3/fxxVqkF3ZJuEPfGWu9mIFLRbfh4uQ81Ng0f1BE7PjGcE6h3p0XO6vkpSqjdRw==, tarball: file:projects/arm-network-profile-2020-09-01-hybrid.tgz}
|
||||
name: '@rush-temp/arm-network-profile-2020-09-01-hybrid'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -13055,18 +13055,20 @@ packages:
|
|||
'@rollup/plugin-json': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
|
||||
'@types/chai': 4.3.4
|
||||
'@types/node': 14.18.33
|
||||
chai: 4.3.7
|
||||
cross-env: 7.0.3
|
||||
dotenv: 8.6.0
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444
|
||||
tslib: 2.4.1
|
||||
typescript: 4.2.4
|
||||
typescript: 4.8.4
|
||||
uglify-js: 3.17.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
|
@ -13334,7 +13336,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-policy-profile-2020-09-01-hybrid.tgz:
|
||||
resolution: {integrity: sha512-42k6NgBkqVa0Fp7nu86aKxAiSWInf6jcfDw/M6o43aNAjtFllryStccIPMOoNGghDyFo353wV/ukHzKV14yEGg==, tarball: file:projects/arm-policy-profile-2020-09-01-hybrid.tgz}
|
||||
resolution: {integrity: sha512-X0tPE22aV5Azuo0eVPDWnSpITM/HsGOOlaIT7GFg//mZA7D9Yg7PGy9cu88W/i9Xk+Jx9gGruK+2hNaB2ZFFbg==, tarball: file:projects/arm-policy-profile-2020-09-01-hybrid.tgz}
|
||||
name: '@rush-temp/arm-policy-profile-2020-09-01-hybrid'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -13345,18 +13347,20 @@ packages:
|
|||
'@rollup/plugin-json': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
|
||||
'@types/chai': 4.3.4
|
||||
'@types/node': 14.18.33
|
||||
chai: 4.3.7
|
||||
cross-env: 7.0.3
|
||||
dotenv: 8.6.0
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444
|
||||
tslib: 2.4.1
|
||||
typescript: 4.2.4
|
||||
typescript: 4.8.4
|
||||
uglify-js: 3.17.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
|
@ -13442,7 +13446,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-postgresql-flexible.tgz:
|
||||
resolution: {integrity: sha512-+4ZsSAlzBc9H+Lb/drKyoyIPW1xp/5ijxaTokvtS0e20AZdoEvZfJ3sLq/Aoa68x69wo9dUx/+xNvOPlGcLogg==, tarball: file:projects/arm-postgresql-flexible.tgz}
|
||||
resolution: {integrity: sha512-jdFQE2aDxnLQq2q6peHgplVa0kp4gJ0xoRb2ajCDuA0vJR5oxN7o/3vgWYW9Hg+B/A7bCpxQIoQji4mXzcn++g==, tarball: file:projects/arm-postgresql-flexible.tgz}
|
||||
name: '@rush-temp/arm-postgresql-flexible'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -13453,18 +13457,20 @@ packages:
|
|||
'@rollup/plugin-json': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
|
||||
'@types/chai': 4.3.4
|
||||
'@types/node': 14.18.33
|
||||
chai: 4.3.7
|
||||
cross-env: 7.0.3
|
||||
dotenv: 8.6.0
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444
|
||||
tslib: 2.4.1
|
||||
typescript: 4.2.4
|
||||
typescript: 4.8.4
|
||||
uglify-js: 3.17.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
|
@ -13939,7 +13945,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-resources-profile-2020-09-01-hybrid.tgz:
|
||||
resolution: {integrity: sha512-ATsKeGfQUHgY7etJoB+1DsxFh2s3PEMr+RLFYD/kGga1oui7pP2+kMAV2CBUKs7mzihgwMiMCsb+fhBF/ATNVA==, tarball: file:projects/arm-resources-profile-2020-09-01-hybrid.tgz}
|
||||
resolution: {integrity: sha512-JVwy8SQBeyPyGZvruzbJXk55mgUgZcoVBxDXxiSkb/jxkM4dZu4mPNojX67sBgRJTSW5HrLp1CT8vufec+WJcg==, tarball: file:projects/arm-resources-profile-2020-09-01-hybrid.tgz}
|
||||
name: '@rush-temp/arm-resources-profile-2020-09-01-hybrid'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -13950,18 +13956,20 @@ packages:
|
|||
'@rollup/plugin-json': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
|
||||
'@types/chai': 4.3.4
|
||||
'@types/node': 14.18.33
|
||||
chai: 4.3.7
|
||||
cross-env: 7.0.3
|
||||
dotenv: 8.6.0
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444
|
||||
tslib: 2.4.1
|
||||
typescript: 4.2.4
|
||||
typescript: 4.8.4
|
||||
uglify-js: 3.17.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
|
@ -14448,7 +14456,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-storage-profile-2020-09-01-hybrid.tgz:
|
||||
resolution: {integrity: sha512-10YDqx9GnCIctv7snNDXH54ftm1Cl0JO1BBkXtqGkv3swyDVECVNs7VfvQ5uyQsH7RcyiuYvwXQjR4rXMy5zbg==, tarball: file:projects/arm-storage-profile-2020-09-01-hybrid.tgz}
|
||||
resolution: {integrity: sha512-oEh8oRzA6fyKBQsQIkAGhDK85UZgfRZaxGgIo9X873vLNdUqPjwGr2OZ/z48oLTkJA4iTM1GBag7QEsEGDqPoA==, tarball: file:projects/arm-storage-profile-2020-09-01-hybrid.tgz}
|
||||
name: '@rush-temp/arm-storage-profile-2020-09-01-hybrid'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -14459,18 +14467,20 @@ packages:
|
|||
'@rollup/plugin-json': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
|
||||
'@types/chai': 4.3.4
|
||||
'@types/node': 14.18.33
|
||||
chai: 4.3.7
|
||||
cross-env: 7.0.3
|
||||
dotenv: 8.6.0
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444
|
||||
tslib: 2.4.1
|
||||
typescript: 4.2.4
|
||||
typescript: 4.8.4
|
||||
uglify-js: 3.17.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
|
@ -14668,7 +14678,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-subscriptions-profile-2020-09-01-hybrid.tgz:
|
||||
resolution: {integrity: sha512-1jdYKXu7XxtKu1uVkx92KftB4vh8u9AygXH2URq5dJVNdiEvHwG8uELXljUCJbwJ9z749mls489s1qwV9gr3Cw==, tarball: file:projects/arm-subscriptions-profile-2020-09-01-hybrid.tgz}
|
||||
resolution: {integrity: sha512-cIzQus770G3+CG561lmmuapHMUUgqA9q0v/aizUGA62bfEyehOVTg0VHgoiWf7ioa/TC5YcM3AcrQLcK/1rXsg==, tarball: file:projects/arm-subscriptions-profile-2020-09-01-hybrid.tgz}
|
||||
name: '@rush-temp/arm-subscriptions-profile-2020-09-01-hybrid'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -14679,18 +14689,20 @@ packages:
|
|||
'@rollup/plugin-json': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
|
||||
'@types/chai': 4.3.4
|
||||
'@types/node': 14.18.33
|
||||
chai: 4.3.7
|
||||
cross-env: 7.0.3
|
||||
dotenv: 8.6.0
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444
|
||||
tslib: 2.4.1
|
||||
typescript: 4.2.4
|
||||
typescript: 4.8.4
|
||||
uglify-js: 3.17.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
|
|
|
@ -1,15 +1,50 @@
|
|||
# Release History
|
||||
|
||||
## 2.1.0 (2022-12-22)
|
||||
|
||||
**Features**
|
||||
|
||||
## 2.0.1 (Unreleased)
|
||||
|
||||
### Features Added
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
### Bugs Fixed
|
||||
|
||||
### Other Changes
|
||||
|
||||
- Added Interface ApplicationGatewayBackendAddressPool
|
||||
- Added Interface ApplicationSecurityGroup
|
||||
- Added Interface BackendAddressPool
|
||||
- Added Interface ConnectionSharedKey
|
||||
- Added Interface Delegation
|
||||
- Added Interface FrontendIPConfiguration
|
||||
- Added Interface InboundNatPool
|
||||
- Added Interface InboundNatRule
|
||||
- Added Interface InterfaceEndpoint
|
||||
- Added Interface IPConfiguration
|
||||
- Added Interface IPConfigurationProfile
|
||||
- Added Interface LoadBalancer
|
||||
- Added Interface LoadBalancingRule
|
||||
- Added Interface LocalNetworkGateway
|
||||
- Added Interface NetworkInterface
|
||||
- Added Interface NetworkInterfaceIPConfiguration
|
||||
- Added Interface NetworkInterfaceTapConfiguration
|
||||
- Added Interface NetworkSecurityGroup
|
||||
- Added Interface OutboundRule
|
||||
- Added Interface Probe
|
||||
- Added Interface PublicIPAddress
|
||||
- Added Interface ResourceNavigationLink
|
||||
- Added Interface Route
|
||||
- Added Interface RouteTable
|
||||
- Added Interface SecurityRule
|
||||
- Added Interface ServiceAssociationLink
|
||||
- Added Interface ServiceEndpointPolicy
|
||||
- Added Interface ServiceEndpointPolicyDefinition
|
||||
- Added Interface Subnet
|
||||
- Added Interface VirtualNetwork
|
||||
- Added Interface VirtualNetworkGateway
|
||||
- Added Interface VirtualNetworkGatewayConnection
|
||||
- Added Interface VirtualNetworkGatewayConnectionListEntity
|
||||
- Added Interface VirtualNetworkGatewayIPConfiguration
|
||||
- Added Interface VirtualNetworkPeering
|
||||
- Added Interface VirtualNetworkTap
|
||||
- Added Interface VpnClientRevokedCertificate
|
||||
- Added Interface VpnClientRootCertificate
|
||||
- Added function getContinuationToken
|
||||
|
||||
|
||||
## 2.0.0 (2022-03-09)
|
||||
|
||||
The package of @azure/arm-network-profile-2020-09-01-hybrid is using our next generation design principles since version 2.0.0, which contains breaking changes.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"commit": "1067b78669466324a1a2666adf053433c61e7f77",
|
||||
"readme": "specification/network/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\\network\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-beta.16 --tag=profile-hybrid-2020-09-01 --profile-content=profile-hybrid-2020-09-01",
|
||||
"autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\network\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.5.20221215.1 --generate-sample=true --profile-content=profile-hybrid-2020-09-01",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.1.1",
|
||||
"use": "@autorest/typescript@6.0.0-beta.16"
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.5.4",
|
||||
"use": "@autorest/typescript@6.0.0-rc.5.20221215.1"
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
"sdk-type": "mgmt",
|
||||
"author": "Microsoft Corporation",
|
||||
"description": "A generated SDK for NetworkManagementClient.",
|
||||
"version": "2.0.1",
|
||||
"version": "2.1.0",
|
||||
"engines": {
|
||||
"node": ">=14.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.6.1",
|
||||
"@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": [
|
||||
|
@ -36,15 +36,20 @@
|
|||
"mkdirp": "^1.0.4",
|
||||
"rollup": "^2.66.1",
|
||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||
"typescript": "~4.2.0",
|
||||
"typescript": "~4.8.0",
|
||||
"uglify-js": "^3.4.9",
|
||||
"rimraf": "^3.0.0",
|
||||
"dotenv": "^8.2.0",
|
||||
"@azure/identity": "^2.0.1",
|
||||
"@azure-tools/test-recorder": "^1.0.0",
|
||||
"@azure-tools/test-recorder": "^2.0.0",
|
||||
"@azure-tools/test-credential": "^1.0.0",
|
||||
"mocha": "^7.1.1",
|
||||
"cross-env": "^7.0.2"
|
||||
"@types/chai": "^4.2.8",
|
||||
"chai": "^4.2.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"@types/node": "^14.0.0",
|
||||
"@azure/dev-tool": "^1.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/network/arm-network-profile-2020-09-01-hybrid",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js.git"
|
||||
|
@ -93,9 +98,8 @@
|
|||
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
|
||||
"unit-test:browser": "echo skipped",
|
||||
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
||||
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
|
||||
"integration-test:browser": "echo skipped",
|
||||
"docs": "echo skipped"
|
||||
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
|
||||
"integration-test:browser": "echo skipped"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"//metadata": {
|
||||
|
@ -106,5 +110,14 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"autoPublish": true
|
||||
}
|
||||
"autoPublish": true,
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/network/arm-network-profile-2020-09-01-hybrid",
|
||||
"//sampleConfiguration": {
|
||||
"productName": "",
|
||||
"productSlugs": [
|
||||
"azure"
|
||||
],
|
||||
"disableDocsMs": true,
|
||||
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-network-profile-2020-09-01-hybrid?view=azure-node-preview"
|
||||
}
|
||||
}
|
4
sdk/network/arm-network-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.json
сгенерированный
Normal file
4
sdk/network/arm-network-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.json
сгенерированный
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"Entries": [],
|
||||
"Variables": {}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the specified default network security rule.
|
||||
*
|
||||
* @summary Get the specified default network security rule.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/DefaultSecurityRuleGet.json
|
||||
*/
|
||||
async function defaultSecurityRuleGet() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const networkSecurityGroupName = "nsg1";
|
||||
const defaultSecurityRuleName = "AllowVnetInBound";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.defaultSecurityRules.get(
|
||||
resourceGroupName,
|
||||
networkSecurityGroupName,
|
||||
defaultSecurityRuleName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
defaultSecurityRuleGet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all default security rules in a network security group.
|
||||
*
|
||||
* @summary Gets all default security rules in a network security group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/DefaultSecurityRuleList.json
|
||||
*/
|
||||
async function defaultSecurityRuleList() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const networkSecurityGroupName = "nsg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.defaultSecurityRules.list(
|
||||
resourceGroupName,
|
||||
networkSecurityGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
defaultSecurityRuleList();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* 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 {
|
||||
InboundNatRule,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a load balancer inbound nat rule.
|
||||
*
|
||||
* @summary Creates or updates a load balancer inbound nat rule.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/InboundNatRuleCreate.json
|
||||
*/
|
||||
async function inboundNatRuleCreate() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb1";
|
||||
const inboundNatRuleName = "natRule1.1";
|
||||
const inboundNatRuleParameters: InboundNatRule = {
|
||||
backendPort: 3389,
|
||||
enableFloatingIP: false,
|
||||
enableTcpReset: true,
|
||||
frontendIPConfiguration: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"
|
||||
},
|
||||
frontendPort: 3390,
|
||||
idleTimeoutInMinutes: 4,
|
||||
protocol: "Tcp"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.inboundNatRules.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
inboundNatRuleName,
|
||||
inboundNatRuleParameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
inboundNatRuleCreate();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified load balancer inbound nat rule.
|
||||
*
|
||||
* @summary Deletes the specified load balancer inbound nat rule.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/InboundNatRuleDelete.json
|
||||
*/
|
||||
async function inboundNatRuleDelete() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb1";
|
||||
const inboundNatRuleName = "natRule1.1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.inboundNatRules.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
inboundNatRuleName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
inboundNatRuleDelete();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified load balancer inbound nat rule.
|
||||
*
|
||||
* @summary Gets the specified load balancer inbound nat rule.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/InboundNatRuleGet.json
|
||||
*/
|
||||
async function inboundNatRuleGet() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb1";
|
||||
const inboundNatRuleName = "natRule1.1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.inboundNatRules.get(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
inboundNatRuleName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
inboundNatRuleGet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all the inbound nat rules in a load balancer.
|
||||
*
|
||||
* @summary Gets all the inbound nat rules in a load balancer.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/InboundNatRuleList.json
|
||||
*/
|
||||
async function inboundNatRuleList() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.inboundNatRules.list(
|
||||
resourceGroupName,
|
||||
loadBalancerName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
inboundNatRuleList();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets load balancer backend address pool.
|
||||
*
|
||||
* @summary Gets load balancer backend address pool.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerBackendAddressPoolGet.json
|
||||
*/
|
||||
async function loadBalancerBackendAddressPoolGet() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb";
|
||||
const backendAddressPoolName = "backend";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancerBackendAddressPools.get(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
backendAddressPoolName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
loadBalancerBackendAddressPoolGet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all the load balancer backed address pools.
|
||||
*
|
||||
* @summary Gets all the load balancer backed address pools.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerBackendAddressPoolList.json
|
||||
*/
|
||||
async function loadBalancerBackendAddressPoolList() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.loadBalancerBackendAddressPools.list(
|
||||
resourceGroupName,
|
||||
loadBalancerName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
loadBalancerBackendAddressPoolList();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets load balancer frontend IP configuration.
|
||||
*
|
||||
* @summary Gets load balancer frontend IP configuration.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerFrontendIPConfigurationGet.json
|
||||
*/
|
||||
async function loadBalancerFrontendIPConfigurationGet() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb";
|
||||
const frontendIPConfigurationName = "frontend";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancerFrontendIPConfigurations.get(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
frontendIPConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
loadBalancerFrontendIPConfigurationGet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all the load balancer frontend IP configurations.
|
||||
*
|
||||
* @summary Gets all the load balancer frontend IP configurations.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerFrontendIPConfigurationList.json
|
||||
*/
|
||||
async function loadBalancerFrontendIPConfigurationList() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.loadBalancerFrontendIPConfigurations.list(
|
||||
resourceGroupName,
|
||||
loadBalancerName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
loadBalancerFrontendIPConfigurationList();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified load balancer load balancing rule.
|
||||
*
|
||||
* @summary Gets the specified load balancer load balancing rule.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerLoadBalancingRuleGet.json
|
||||
*/
|
||||
async function loadBalancerLoadBalancingRuleGet() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb1";
|
||||
const loadBalancingRuleName = "rule1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancerLoadBalancingRules.get(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
loadBalancingRuleName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
loadBalancerLoadBalancingRuleGet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all the load balancing rules in a load balancer.
|
||||
*
|
||||
* @summary Gets all the load balancing rules in a load balancer.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerLoadBalancingRuleList.json
|
||||
*/
|
||||
async function loadBalancerLoadBalancingRuleList() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.loadBalancerLoadBalancingRules.list(
|
||||
resourceGroupName,
|
||||
loadBalancerName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
loadBalancerLoadBalancingRuleList();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* 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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets associated load balancer network interfaces.
|
||||
*
|
||||
* @summary Gets associated load balancer network interfaces.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerNetworkInterfaceListSimple.json
|
||||
*/
|
||||
async function loadBalancerNetworkInterfaceListSimple() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.loadBalancerNetworkInterfaces.list(
|
||||
resourceGroupName,
|
||||
loadBalancerName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets associated load balancer network interfaces.
|
||||
*
|
||||
* @summary Gets associated load balancer network interfaces.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerNetworkInterfaceListVmss.json
|
||||
*/
|
||||
async function loadBalancerNetworkInterfaceListVmss() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.loadBalancerNetworkInterfaces.list(
|
||||
resourceGroupName,
|
||||
loadBalancerName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
loadBalancerNetworkInterfaceListSimple();
|
||||
loadBalancerNetworkInterfaceListVmss();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified load balancer outbound rule.
|
||||
*
|
||||
* @summary Gets the specified load balancer outbound rule.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerOutboundRuleGet.json
|
||||
*/
|
||||
async function loadBalancerOutboundRuleGet() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb1";
|
||||
const outboundRuleName = "rule1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancerOutboundRules.get(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
outboundRuleName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
loadBalancerOutboundRuleGet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all the outbound rules in a load balancer.
|
||||
*
|
||||
* @summary Gets all the outbound rules in a load balancer.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerOutboundRuleList.json
|
||||
*/
|
||||
async function loadBalancerOutboundRuleList() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.loadBalancerOutboundRules.list(
|
||||
resourceGroupName,
|
||||
loadBalancerName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
loadBalancerOutboundRuleList();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets load balancer probe.
|
||||
*
|
||||
* @summary Gets load balancer probe.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerProbeGet.json
|
||||
*/
|
||||
async function loadBalancerProbeGet() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb";
|
||||
const probeName = "probe1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancerProbes.get(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
probeName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
loadBalancerProbeGet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all the load balancer probes.
|
||||
*
|
||||
* @summary Gets all the load balancer probes.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerProbeList.json
|
||||
*/
|
||||
async function loadBalancerProbeList() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const loadBalancerName = "lb";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.loadBalancerProbes.list(
|
||||
resourceGroupName,
|
||||
loadBalancerName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
loadBalancerProbeList();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,435 @@
|
|||
/*
|
||||
* 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 {
|
||||
LoadBalancer,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a load balancer.
|
||||
*
|
||||
* @summary Creates or updates a load balancer.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerCreate.json
|
||||
*/
|
||||
async function createLoadBalancer() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const loadBalancerName = "lb";
|
||||
const parameters: LoadBalancer = {
|
||||
backendAddressPools: [{ name: "be-lb" }],
|
||||
frontendIPConfigurations: [
|
||||
{
|
||||
name: "fe-lb",
|
||||
subnet: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
|
||||
}
|
||||
}
|
||||
],
|
||||
inboundNatPools: [],
|
||||
inboundNatRules: [
|
||||
{
|
||||
name: "in-nat-rule",
|
||||
backendPort: 3389,
|
||||
enableFloatingIP: true,
|
||||
enableTcpReset: true,
|
||||
frontendIPConfiguration: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
|
||||
},
|
||||
frontendPort: 3389,
|
||||
idleTimeoutInMinutes: 15,
|
||||
protocol: "Tcp"
|
||||
}
|
||||
],
|
||||
loadBalancingRules: [
|
||||
{
|
||||
name: "rulelb",
|
||||
backendAddressPool: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
|
||||
},
|
||||
backendPort: 80,
|
||||
enableFloatingIP: true,
|
||||
enableTcpReset: true,
|
||||
frontendIPConfiguration: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
|
||||
},
|
||||
frontendPort: 80,
|
||||
idleTimeoutInMinutes: 15,
|
||||
loadDistribution: "Default",
|
||||
probe: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
|
||||
},
|
||||
protocol: "Tcp"
|
||||
}
|
||||
],
|
||||
probes: [
|
||||
{
|
||||
name: "probe-lb",
|
||||
intervalInSeconds: 15,
|
||||
numberOfProbes: 2,
|
||||
port: 80,
|
||||
requestPath: "healthcheck.aspx",
|
||||
protocol: "Http"
|
||||
}
|
||||
]
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a load balancer.
|
||||
*
|
||||
* @summary Creates or updates a load balancer.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerCreateWithZones.json
|
||||
*/
|
||||
async function createLoadBalancerWithFrontendIPInZone1() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const loadBalancerName = "lb";
|
||||
const parameters: LoadBalancer = {
|
||||
backendAddressPools: [{ name: "be-lb" }],
|
||||
frontendIPConfigurations: [
|
||||
{
|
||||
name: "fe-lb",
|
||||
subnet: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
|
||||
},
|
||||
zones: ["1"]
|
||||
}
|
||||
],
|
||||
inboundNatPools: [],
|
||||
inboundNatRules: [
|
||||
{
|
||||
name: "in-nat-rule",
|
||||
backendPort: 3389,
|
||||
enableFloatingIP: true,
|
||||
frontendIPConfiguration: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
|
||||
},
|
||||
frontendPort: 3389,
|
||||
idleTimeoutInMinutes: 15,
|
||||
protocol: "Tcp"
|
||||
}
|
||||
],
|
||||
loadBalancingRules: [
|
||||
{
|
||||
name: "rulelb",
|
||||
backendAddressPool: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
|
||||
},
|
||||
backendPort: 80,
|
||||
enableFloatingIP: true,
|
||||
frontendIPConfiguration: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
|
||||
},
|
||||
frontendPort: 80,
|
||||
idleTimeoutInMinutes: 15,
|
||||
loadDistribution: "Default",
|
||||
probe: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
|
||||
},
|
||||
protocol: "Tcp"
|
||||
}
|
||||
],
|
||||
outboundRules: [],
|
||||
probes: [
|
||||
{
|
||||
name: "probe-lb",
|
||||
intervalInSeconds: 15,
|
||||
numberOfProbes: 2,
|
||||
port: 80,
|
||||
requestPath: "healthcheck.aspx",
|
||||
protocol: "Http"
|
||||
}
|
||||
],
|
||||
sku: { name: "Standard" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a load balancer.
|
||||
*
|
||||
* @summary Creates or updates a load balancer.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerCreateStandardSku.json
|
||||
*/
|
||||
async function createLoadBalancerWithStandardSku() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const loadBalancerName = "lb";
|
||||
const parameters: LoadBalancer = {
|
||||
backendAddressPools: [{ name: "be-lb" }],
|
||||
frontendIPConfigurations: [
|
||||
{
|
||||
name: "fe-lb",
|
||||
subnet: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"
|
||||
}
|
||||
}
|
||||
],
|
||||
inboundNatPools: [],
|
||||
inboundNatRules: [
|
||||
{
|
||||
name: "in-nat-rule",
|
||||
backendPort: 3389,
|
||||
enableFloatingIP: true,
|
||||
frontendIPConfiguration: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
|
||||
},
|
||||
frontendPort: 3389,
|
||||
idleTimeoutInMinutes: 15,
|
||||
protocol: "Tcp"
|
||||
}
|
||||
],
|
||||
loadBalancingRules: [
|
||||
{
|
||||
name: "rulelb",
|
||||
backendAddressPool: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
|
||||
},
|
||||
backendPort: 80,
|
||||
enableFloatingIP: true,
|
||||
frontendIPConfiguration: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
|
||||
},
|
||||
frontendPort: 80,
|
||||
idleTimeoutInMinutes: 15,
|
||||
loadDistribution: "Default",
|
||||
probe: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
|
||||
},
|
||||
protocol: "Tcp"
|
||||
}
|
||||
],
|
||||
outboundRules: [],
|
||||
probes: [
|
||||
{
|
||||
name: "probe-lb",
|
||||
intervalInSeconds: 15,
|
||||
numberOfProbes: 2,
|
||||
port: 80,
|
||||
requestPath: "healthcheck.aspx",
|
||||
protocol: "Http"
|
||||
}
|
||||
],
|
||||
sku: { name: "Standard" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a load balancer.
|
||||
*
|
||||
* @summary Creates or updates a load balancer.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerCreateWithInboundNatPool.json
|
||||
*/
|
||||
async function createLoadBalancerWithInboundNatPool() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const loadBalancerName = "lb";
|
||||
const parameters: LoadBalancer = {
|
||||
backendAddressPools: [],
|
||||
frontendIPConfigurations: [
|
||||
{
|
||||
name: "test",
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test",
|
||||
privateIPAllocationMethod: "Dynamic",
|
||||
subnet: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet",
|
||||
resourceNavigationLinks: [],
|
||||
serviceEndpoints: []
|
||||
},
|
||||
zones: []
|
||||
}
|
||||
],
|
||||
inboundNatPools: [
|
||||
{
|
||||
name: "test",
|
||||
backendPort: 8888,
|
||||
enableFloatingIP: true,
|
||||
enableTcpReset: true,
|
||||
frontendIPConfiguration: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"
|
||||
},
|
||||
frontendPortRangeEnd: 8085,
|
||||
frontendPortRangeStart: 8080,
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test",
|
||||
idleTimeoutInMinutes: 10,
|
||||
protocol: "Tcp"
|
||||
}
|
||||
],
|
||||
inboundNatRules: [],
|
||||
loadBalancingRules: [],
|
||||
outboundRules: [],
|
||||
probes: [],
|
||||
sku: { name: "Standard" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a load balancer.
|
||||
*
|
||||
* @summary Creates or updates a load balancer.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerCreateWithOutboundRules.json
|
||||
*/
|
||||
async function createLoadBalancerWithOutboundRules() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const loadBalancerName = "lb";
|
||||
const parameters: LoadBalancer = {
|
||||
backendAddressPools: [{ name: "be-lb" }],
|
||||
frontendIPConfigurations: [
|
||||
{
|
||||
name: "fe-lb",
|
||||
publicIPAddress: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"
|
||||
}
|
||||
}
|
||||
],
|
||||
inboundNatPools: [],
|
||||
inboundNatRules: [
|
||||
{
|
||||
name: "in-nat-rule",
|
||||
backendPort: 3389,
|
||||
enableFloatingIP: true,
|
||||
frontendIPConfiguration: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
|
||||
},
|
||||
frontendPort: 3389,
|
||||
idleTimeoutInMinutes: 15,
|
||||
protocol: "Tcp"
|
||||
}
|
||||
],
|
||||
loadBalancingRules: [
|
||||
{
|
||||
name: "rulelb",
|
||||
backendAddressPool: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
|
||||
},
|
||||
backendPort: 80,
|
||||
disableOutboundSnat: true,
|
||||
enableFloatingIP: true,
|
||||
frontendIPConfiguration: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
|
||||
},
|
||||
frontendPort: 80,
|
||||
idleTimeoutInMinutes: 15,
|
||||
loadDistribution: "Default",
|
||||
probe: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"
|
||||
},
|
||||
protocol: "Tcp"
|
||||
}
|
||||
],
|
||||
location: "eastus",
|
||||
outboundRules: [
|
||||
{
|
||||
name: "rule1",
|
||||
backendAddressPool: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"
|
||||
},
|
||||
frontendIPConfigurations: [
|
||||
{
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"
|
||||
}
|
||||
],
|
||||
protocol: "All"
|
||||
}
|
||||
],
|
||||
probes: [
|
||||
{
|
||||
name: "probe-lb",
|
||||
intervalInSeconds: 15,
|
||||
numberOfProbes: 2,
|
||||
port: 80,
|
||||
requestPath: "healthcheck.aspx",
|
||||
protocol: "Http"
|
||||
}
|
||||
],
|
||||
sku: { name: "Standard" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancers.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createLoadBalancer();
|
||||
createLoadBalancerWithFrontendIPInZone1();
|
||||
createLoadBalancerWithStandardSku();
|
||||
createLoadBalancerWithInboundNatPool();
|
||||
createLoadBalancerWithOutboundRules();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified load balancer.
|
||||
*
|
||||
* @summary Deletes the specified load balancer.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerDelete.json
|
||||
*/
|
||||
async function deleteLoadBalancer() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const loadBalancerName = "lb";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancers.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
loadBalancerName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteLoadBalancer();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified load balancer.
|
||||
*
|
||||
* @summary Gets the specified load balancer.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerGet.json
|
||||
*/
|
||||
async function getLoadBalancer() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const loadBalancerName = "lb";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancers.get(
|
||||
resourceGroupName,
|
||||
loadBalancerName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getLoadBalancer();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all the load balancers in a subscription.
|
||||
*
|
||||
* @summary Gets all the load balancers in a subscription.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerListAll.json
|
||||
*/
|
||||
async function listAllLoadBalancers() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.loadBalancers.listAll()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllLoadBalancers();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all the load balancers in a resource group.
|
||||
*
|
||||
* @summary Gets all the load balancers in a resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerList.json
|
||||
*/
|
||||
async function listLoadBalancersInResourceGroup() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.loadBalancers.list(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listLoadBalancersInResourceGroup();
|
||||
}
|
||||
|
||||
main().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 {
|
||||
TagsObject,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a load balancer tags.
|
||||
*
|
||||
* @summary Updates a load balancer tags.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LoadBalancerUpdateTags.json
|
||||
*/
|
||||
async function updateLoadBalancerTags() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const loadBalancerName = "lb";
|
||||
const parameters: TagsObject = { tags: { tag1: "value1", tag2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.loadBalancers.beginUpdateTagsAndWait(
|
||||
resourceGroupName,
|
||||
loadBalancerName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
updateLoadBalancerTags();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* 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 {
|
||||
LocalNetworkGateway,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a local network gateway in the specified resource group.
|
||||
*
|
||||
* @summary Creates or updates a local network gateway in the specified resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LocalNetworkGatewayCreate.json
|
||||
*/
|
||||
async function createLocalNetworkGateway() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const localNetworkGatewayName = "localgw";
|
||||
const parameters: LocalNetworkGateway = {
|
||||
gatewayIpAddress: "x.x.x.x",
|
||||
localNetworkAddressSpace: { addressPrefixes: ["10.1.0.0/16"] },
|
||||
location: "Central US"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.localNetworkGateways.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
localNetworkGatewayName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createLocalNetworkGateway();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified local network gateway.
|
||||
*
|
||||
* @summary Deletes the specified local network gateway.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LocalNetworkGatewayDelete.json
|
||||
*/
|
||||
async function deleteLocalNetworkGateway() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const localNetworkGatewayName = "localgw";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.localNetworkGateways.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
localNetworkGatewayName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteLocalNetworkGateway();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified local network gateway in a resource group.
|
||||
*
|
||||
* @summary Gets the specified local network gateway in a resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LocalNetworkGatewayGet.json
|
||||
*/
|
||||
async function getLocalNetworkGateway() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const localNetworkGatewayName = "localgw";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.localNetworkGateways.get(
|
||||
resourceGroupName,
|
||||
localNetworkGatewayName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getLocalNetworkGateway();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all the local network gateways in a resource group.
|
||||
*
|
||||
* @summary Gets all the local network gateways in a resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LocalNetworkGatewayList.json
|
||||
*/
|
||||
async function listLocalNetworkGateways() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.localNetworkGateways.list(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listLocalNetworkGateways();
|
||||
}
|
||||
|
||||
main().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 {
|
||||
TagsObject,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a local network gateway tags.
|
||||
*
|
||||
* @summary Updates a local network gateway tags.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/LocalNetworkGatewayUpdateTags.json
|
||||
*/
|
||||
async function updateLocalNetworkGatewayTags() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const localNetworkGatewayName = "lgw";
|
||||
const parameters: TagsObject = { tags: { tag1: "value1", tag2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.localNetworkGateways.beginUpdateTagsAndWait(
|
||||
resourceGroupName,
|
||||
localNetworkGatewayName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
updateLocalNetworkGatewayTags();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified network interface ip configuration.
|
||||
*
|
||||
* @summary Gets the specified network interface ip configuration.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceIPConfigurationGet.json
|
||||
*/
|
||||
async function networkInterfaceIPConfigurationGet() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const networkInterfaceName = "mynic";
|
||||
const ipConfigurationName = "ipconfig1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkInterfaceIPConfigurations.get(
|
||||
resourceGroupName,
|
||||
networkInterfaceName,
|
||||
ipConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
networkInterfaceIPConfigurationGet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all ip configurations in a network interface
|
||||
*
|
||||
* @summary Get all ip configurations in a network interface
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceIPConfigurationList.json
|
||||
*/
|
||||
async function networkInterfaceIPConfigurationList() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const networkInterfaceName = "nic1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.networkInterfaceIPConfigurations.list(
|
||||
resourceGroupName,
|
||||
networkInterfaceName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
networkInterfaceIPConfigurationList();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List all load balancers in a network interface.
|
||||
*
|
||||
* @summary List all load balancers in a network interface.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceLoadBalancerList.json
|
||||
*/
|
||||
async function networkInterfaceLoadBalancerList() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const networkInterfaceName = "nic1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.networkInterfaceLoadBalancers.list(
|
||||
resourceGroupName,
|
||||
networkInterfaceName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
networkInterfaceLoadBalancerList();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* 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 {
|
||||
NetworkInterfaceTapConfiguration,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a Tap configuration in the specified NetworkInterface.
|
||||
*
|
||||
* @summary Creates or updates a Tap configuration in the specified NetworkInterface.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceTapConfigurationCreate.json
|
||||
*/
|
||||
async function createNetworkInterfaceTapConfigurations() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const networkInterfaceName = "mynic";
|
||||
const tapConfigurationName = "tapconfiguration1";
|
||||
const tapConfigurationParameters: NetworkInterfaceTapConfiguration = {
|
||||
virtualNetworkTap: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"
|
||||
}
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkInterfaceTapConfigurations.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
networkInterfaceName,
|
||||
tapConfigurationName,
|
||||
tapConfigurationParameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createNetworkInterfaceTapConfigurations();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified tap configuration from the NetworkInterface.
|
||||
*
|
||||
* @summary Deletes the specified tap configuration from the NetworkInterface.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceTapConfigurationDelete.json
|
||||
*/
|
||||
async function deleteTapConfiguration() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkInterfaceName = "test-networkinterface";
|
||||
const tapConfigurationName = "test-tapconfiguration";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkInterfaceTapConfigurations.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
networkInterfaceName,
|
||||
tapConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteTapConfiguration();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the specified tap configuration on a network interface.
|
||||
*
|
||||
* @summary Get the specified tap configuration on a network interface.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceTapConfigurationGet.json
|
||||
*/
|
||||
async function getNetworkInterfaceTapConfigurations() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const networkInterfaceName = "mynic";
|
||||
const tapConfigurationName = "tapconfiguration1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkInterfaceTapConfigurations.get(
|
||||
resourceGroupName,
|
||||
networkInterfaceName,
|
||||
tapConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkInterfaceTapConfigurations();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get all Tap configurations in a network interface
|
||||
*
|
||||
* @summary Get all Tap configurations in a network interface
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceTapConfigurationList.json
|
||||
*/
|
||||
async function listVirtualNetworkTapConfigurations() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkInterfaceName = "mynic";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.networkInterfaceTapConfigurations.list(
|
||||
resourceGroupName,
|
||||
networkInterfaceName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listVirtualNetworkTapConfigurations();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* 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 {
|
||||
NetworkInterface,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a network interface.
|
||||
*
|
||||
* @summary Creates or updates a network interface.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceCreate.json
|
||||
*/
|
||||
async function createNetworkInterface() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkInterfaceName = "test-nic";
|
||||
const parameters: NetworkInterface = {
|
||||
enableAcceleratedNetworking: true,
|
||||
ipConfigurations: [
|
||||
{
|
||||
name: "ipconfig1",
|
||||
publicIPAddress: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"
|
||||
},
|
||||
subnet: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkInterfaces.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
networkInterfaceName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createNetworkInterface();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified network interface.
|
||||
*
|
||||
* @summary Deletes the specified network interface.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceDelete.json
|
||||
*/
|
||||
async function deleteNetworkInterface() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkInterfaceName = "test-nic";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkInterfaces.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
networkInterfaceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteNetworkInterface();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all route tables applied to a network interface.
|
||||
*
|
||||
* @summary Gets all route tables applied to a network interface.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceEffectiveRouteTableList.json
|
||||
*/
|
||||
async function showNetworkInterfaceEffectiveRouteTables() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkInterfaceName = "nic1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkInterfaces.beginGetEffectiveRouteTableAndWait(
|
||||
resourceGroupName,
|
||||
networkInterfaceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
showNetworkInterfaceEffectiveRouteTables();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets information about the specified network interface.
|
||||
*
|
||||
* @summary Gets information about the specified network interface.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceGet.json
|
||||
*/
|
||||
async function getNetworkInterface() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkInterfaceName = "test-nic";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkInterfaces.get(
|
||||
resourceGroupName,
|
||||
networkInterfaceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkInterface();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all network interfaces in a subscription.
|
||||
*
|
||||
* @summary Gets all network interfaces in a subscription.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceListAll.json
|
||||
*/
|
||||
async function listAllNetworkInterfaces() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.networkInterfaces.listAll()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllNetworkInterfaces();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all network security groups applied to a network interface.
|
||||
*
|
||||
* @summary Gets all network security groups applied to a network interface.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceEffectiveNSGList.json
|
||||
*/
|
||||
async function listNetworkInterfaceEffectiveNetworkSecurityGroups() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkInterfaceName = "nic1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkInterfaces.beginListEffectiveNetworkSecurityGroupsAndWait(
|
||||
resourceGroupName,
|
||||
networkInterfaceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listNetworkInterfaceEffectiveNetworkSecurityGroups();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all network interfaces in a resource group.
|
||||
*
|
||||
* @summary Gets all network interfaces in a resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceList.json
|
||||
*/
|
||||
async function listNetworkInterfacesInResourceGroup() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.networkInterfaces.list(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listNetworkInterfacesInResourceGroup();
|
||||
}
|
||||
|
||||
main().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 {
|
||||
TagsObject,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a network interface tags.
|
||||
*
|
||||
* @summary Updates a network interface tags.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkInterfaceUpdateTags.json
|
||||
*/
|
||||
async function updateNetworkInterfaceTags() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkInterfaceName = "test-nic";
|
||||
const parameters: TagsObject = { tags: { tag1: "value1", tag2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkInterfaces.beginUpdateTagsAndWait(
|
||||
resourceGroupName,
|
||||
networkInterfaceName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
updateNetworkInterfaceTags();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* 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 {
|
||||
NetworkSecurityGroup,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a network security group in the specified resource group.
|
||||
*
|
||||
* @summary Creates or updates a network security group in the specified resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkSecurityGroupCreate.json
|
||||
*/
|
||||
async function createNetworkSecurityGroup() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkSecurityGroupName = "testnsg";
|
||||
const parameters: NetworkSecurityGroup = {};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkSecurityGroups.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
networkSecurityGroupName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a network security group in the specified resource group.
|
||||
*
|
||||
* @summary Creates or updates a network security group in the specified resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkSecurityGroupCreateWithRule.json
|
||||
*/
|
||||
async function createNetworkSecurityGroupWithRule() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkSecurityGroupName = "testnsg";
|
||||
const parameters: NetworkSecurityGroup = {
|
||||
securityRules: [
|
||||
{
|
||||
name: "rule1",
|
||||
access: "Allow",
|
||||
destinationAddressPrefix: "*",
|
||||
destinationPortRange: "80",
|
||||
direction: "Inbound",
|
||||
priority: 130,
|
||||
sourceAddressPrefix: "*",
|
||||
sourcePortRange: "*",
|
||||
protocol: "*"
|
||||
}
|
||||
]
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkSecurityGroups.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
networkSecurityGroupName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createNetworkSecurityGroup();
|
||||
createNetworkSecurityGroupWithRule();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified network security group.
|
||||
*
|
||||
* @summary Deletes the specified network security group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkSecurityGroupDelete.json
|
||||
*/
|
||||
async function deleteNetworkSecurityGroup() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkSecurityGroupName = "testnsg";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkSecurityGroups.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
networkSecurityGroupName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteNetworkSecurityGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified network security group.
|
||||
*
|
||||
* @summary Gets the specified network security group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkSecurityGroupGet.json
|
||||
*/
|
||||
async function getNetworkSecurityGroup() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkSecurityGroupName = "testnsg";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkSecurityGroups.get(
|
||||
resourceGroupName,
|
||||
networkSecurityGroupName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkSecurityGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all network security groups in a subscription.
|
||||
*
|
||||
* @summary Gets all network security groups in a subscription.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkSecurityGroupListAll.json
|
||||
*/
|
||||
async function listAllNetworkSecurityGroups() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.networkSecurityGroups.listAll()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllNetworkSecurityGroups();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all network security groups in a resource group.
|
||||
*
|
||||
* @summary Gets all network security groups in a resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkSecurityGroupList.json
|
||||
*/
|
||||
async function listNetworkSecurityGroupsInResourceGroup() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.networkSecurityGroups.list(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listNetworkSecurityGroupsInResourceGroup();
|
||||
}
|
||||
|
||||
main().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 {
|
||||
TagsObject,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a network security group tags.
|
||||
*
|
||||
* @summary Updates a network security group tags.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkSecurityGroupUpdateTags.json
|
||||
*/
|
||||
async function updateNetworkSecurityGroupTags() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkSecurityGroupName = "testnsg";
|
||||
const parameters: TagsObject = { tags: { tag1: "value1", tag2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.networkSecurityGroups.beginUpdateTagsAndWait(
|
||||
resourceGroupName,
|
||||
networkSecurityGroupName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
updateNetworkSecurityGroupTags();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists all of the available Network Rest API operations.
|
||||
*
|
||||
* @summary Lists all of the available Network Rest API operations.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/OperationList.json
|
||||
*/
|
||||
async function getAListOfOperationsForAResourceProvider() {
|
||||
const subscriptionId =
|
||||
process.env["NETWORK_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.operations.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getAListOfOperationsForAResourceProvider();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
* 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 {
|
||||
PublicIPAddress,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a static or dynamic public IP address.
|
||||
*
|
||||
* @summary Creates or updates a static or dynamic public IP address.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/PublicIpAddressCreateDns.json
|
||||
*/
|
||||
async function createPublicIPAddressDns() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const publicIpAddressName = "test-ip";
|
||||
const parameters: PublicIPAddress = {
|
||||
dnsSettings: { domainNameLabel: "dnslbl" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.publicIPAddresses.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
publicIpAddressName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a static or dynamic public IP address.
|
||||
*
|
||||
* @summary Creates or updates a static or dynamic public IP address.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/PublicIpAddressCreateCustomizedValues.json
|
||||
*/
|
||||
async function createPublicIPAddressAllocationMethod() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const publicIpAddressName = "test-ip";
|
||||
const parameters: PublicIPAddress = {
|
||||
idleTimeoutInMinutes: 10,
|
||||
publicIPAddressVersion: "IPv4",
|
||||
publicIPAllocationMethod: "Static",
|
||||
sku: { name: "Standard" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.publicIPAddresses.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
publicIpAddressName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a static or dynamic public IP address.
|
||||
*
|
||||
* @summary Creates or updates a static or dynamic public IP address.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/PublicIpAddressCreateDefaults.json
|
||||
*/
|
||||
async function createPublicIPAddressDefaults() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const publicIpAddressName = "test-ip";
|
||||
const parameters: PublicIPAddress = {};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.publicIPAddresses.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
publicIpAddressName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createPublicIPAddressDns();
|
||||
createPublicIPAddressAllocationMethod();
|
||||
createPublicIPAddressDefaults();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified public IP address.
|
||||
*
|
||||
* @summary Deletes the specified public IP address.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/PublicIpAddressDelete.json
|
||||
*/
|
||||
async function deletePublicIPAddress() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const publicIpAddressName = "test-ip";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.publicIPAddresses.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
publicIpAddressName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deletePublicIPAddress();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified public IP address in a specified resource group.
|
||||
*
|
||||
* @summary Gets the specified public IP address in a specified resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/PublicIpAddressGet.json
|
||||
*/
|
||||
async function getPublicIPAddress() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const publicIpAddressName = "testDNS-ip";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.publicIPAddresses.get(
|
||||
resourceGroupName,
|
||||
publicIpAddressName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getPublicIPAddress();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all the public IP addresses in a subscription.
|
||||
*
|
||||
* @summary Gets all the public IP addresses in a subscription.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/PublicIpAddressListAll.json
|
||||
*/
|
||||
async function listAllPublicIPAddresses() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.publicIPAddresses.listAll()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllPublicIPAddresses();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all public IP addresses in a resource group.
|
||||
*
|
||||
* @summary Gets all public IP addresses in a resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/PublicIpAddressList.json
|
||||
*/
|
||||
async function listResourceGroupPublicIPAddresses() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.publicIPAddresses.list(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listResourceGroupPublicIPAddresses();
|
||||
}
|
||||
|
||||
main().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 {
|
||||
TagsObject,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates public IP address tags.
|
||||
*
|
||||
* @summary Updates public IP address tags.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/PublicIpAddressUpdateTags.json
|
||||
*/
|
||||
async function updatePublicIPAddressTags() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const publicIpAddressName = "test-ip";
|
||||
const parameters: TagsObject = { tags: { tag1: "value1", tag2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.publicIPAddresses.beginUpdateTagsAndWait(
|
||||
resourceGroupName,
|
||||
publicIpAddressName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
updatePublicIPAddressTags();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* 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 {
|
||||
RouteTable,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or updates a route table in a specified resource group.
|
||||
*
|
||||
* @summary Create or updates a route table in a specified resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/RouteTableCreate.json
|
||||
*/
|
||||
async function createRouteTable() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const routeTableName = "testrt";
|
||||
const parameters: RouteTable = { location: "westus" };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.routeTables.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
routeTableName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or updates a route table in a specified resource group.
|
||||
*
|
||||
* @summary Create or updates a route table in a specified resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/RouteTableCreateWithRoute.json
|
||||
*/
|
||||
async function createRouteTableWithRoute() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const routeTableName = "testrt";
|
||||
const parameters: RouteTable = {
|
||||
disableBgpRoutePropagation: true,
|
||||
location: "westus",
|
||||
routes: [
|
||||
{
|
||||
name: "route1",
|
||||
addressPrefix: "10.0.3.0/24",
|
||||
nextHopType: "VirtualNetworkGateway"
|
||||
}
|
||||
]
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.routeTables.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
routeTableName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createRouteTable();
|
||||
createRouteTableWithRoute();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified route table.
|
||||
*
|
||||
* @summary Deletes the specified route table.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/RouteTableDelete.json
|
||||
*/
|
||||
async function deleteRouteTable() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const routeTableName = "testrt";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.routeTables.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
routeTableName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteRouteTable();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified route table.
|
||||
*
|
||||
* @summary Gets the specified route table.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/RouteTableGet.json
|
||||
*/
|
||||
async function getRouteTable() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const routeTableName = "testrt";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.routeTables.get(
|
||||
resourceGroupName,
|
||||
routeTableName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getRouteTable();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all route tables in a subscription.
|
||||
*
|
||||
* @summary Gets all route tables in a subscription.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/RouteTableListAll.json
|
||||
*/
|
||||
async function listAllRouteTables() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.routeTables.listAll()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllRouteTables();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all route tables in a resource group.
|
||||
*
|
||||
* @summary Gets all route tables in a resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/RouteTableList.json
|
||||
*/
|
||||
async function listRouteTablesInResourceGroup() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.routeTables.list(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listRouteTablesInResourceGroup();
|
||||
}
|
||||
|
||||
main().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 {
|
||||
TagsObject,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a route table tags.
|
||||
*
|
||||
* @summary Updates a route table tags.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/RouteTableUpdateTags.json
|
||||
*/
|
||||
async function updateRouteTableTags() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const routeTableName = "testrt";
|
||||
const parameters: TagsObject = { tags: { tag1: "value1", tag2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.routeTables.beginUpdateTagsAndWait(
|
||||
resourceGroupName,
|
||||
routeTableName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
updateRouteTableTags();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* 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 {
|
||||
Route,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a route in the specified route table.
|
||||
*
|
||||
* @summary Creates or updates a route in the specified route table.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/RouteTableRouteCreate.json
|
||||
*/
|
||||
async function createRoute() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const routeTableName = "testrt";
|
||||
const routeName = "route1";
|
||||
const routeParameters: Route = {
|
||||
addressPrefix: "10.0.3.0/24",
|
||||
nextHopType: "VirtualNetworkGateway"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.routes.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
routeTableName,
|
||||
routeName,
|
||||
routeParameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createRoute();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified route from a route table.
|
||||
*
|
||||
* @summary Deletes the specified route from a route table.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/RouteTableRouteDelete.json
|
||||
*/
|
||||
async function deleteRoute() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const routeTableName = "testrt";
|
||||
const routeName = "route1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.routes.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
routeTableName,
|
||||
routeName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteRoute();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified route from a route table.
|
||||
*
|
||||
* @summary Gets the specified route from a route table.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/RouteTableRouteGet.json
|
||||
*/
|
||||
async function getRoute() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const routeTableName = "testrt";
|
||||
const routeName = "route1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.routes.get(
|
||||
resourceGroupName,
|
||||
routeTableName,
|
||||
routeName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getRoute();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all routes in a route table.
|
||||
*
|
||||
* @summary Gets all routes in a route table.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/RouteTableRouteList.json
|
||||
*/
|
||||
async function listRoutes() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const routeTableName = "testrt";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.routes.list(
|
||||
resourceGroupName,
|
||||
routeTableName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listRoutes();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* 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 {
|
||||
SecurityRule,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a security rule in the specified network security group.
|
||||
*
|
||||
* @summary Creates or updates a security rule in the specified network security group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkSecurityGroupRuleCreate.json
|
||||
*/
|
||||
async function createSecurityRule() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkSecurityGroupName = "testnsg";
|
||||
const securityRuleName = "rule1";
|
||||
const securityRuleParameters: SecurityRule = {
|
||||
access: "Deny",
|
||||
destinationAddressPrefix: "11.0.0.0/8",
|
||||
destinationPortRange: "8080",
|
||||
direction: "Outbound",
|
||||
priority: 100,
|
||||
sourceAddressPrefix: "10.0.0.0/8",
|
||||
sourcePortRange: "*",
|
||||
protocol: "*"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.securityRules.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
networkSecurityGroupName,
|
||||
securityRuleName,
|
||||
securityRuleParameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createSecurityRule();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified network security rule.
|
||||
*
|
||||
* @summary Deletes the specified network security rule.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkSecurityGroupRuleDelete.json
|
||||
*/
|
||||
async function deleteNetworkSecurityRuleFromNetworkSecurityGroup() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkSecurityGroupName = "testnsg";
|
||||
const securityRuleName = "rule1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.securityRules.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
networkSecurityGroupName,
|
||||
securityRuleName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteNetworkSecurityRuleFromNetworkSecurityGroup();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the specified network security rule.
|
||||
*
|
||||
* @summary Get the specified network security rule.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkSecurityGroupRuleGet.json
|
||||
*/
|
||||
async function getNetworkSecurityRuleInNetworkSecurityGroup() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkSecurityGroupName = "testnsg";
|
||||
const securityRuleName = "rule1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.securityRules.get(
|
||||
resourceGroupName,
|
||||
networkSecurityGroupName,
|
||||
securityRuleName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getNetworkSecurityRuleInNetworkSecurityGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all security rules in a network security group.
|
||||
*
|
||||
* @summary Gets all security rules in a network security group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/NetworkSecurityGroupRuleList.json
|
||||
*/
|
||||
async function listNetworkSecurityRulesInNetworkSecurityGroup() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const networkSecurityGroupName = "testnsg";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.securityRules.list(
|
||||
resourceGroupName,
|
||||
networkSecurityGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listNetworkSecurityRulesInNetworkSecurityGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* 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 {
|
||||
Subnet,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a subnet in the specified virtual network.
|
||||
*
|
||||
* @summary Creates or updates a subnet in the specified virtual network.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/SubnetCreate.json
|
||||
*/
|
||||
async function createSubnet() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName =
|
||||
process.env["NETWORK_RESOURCE_GROUP"] || "subnet-test";
|
||||
const virtualNetworkName = "vnetname";
|
||||
const subnetName = "subnet1";
|
||||
const subnetParameters: Subnet = { addressPrefix: "10.0.0.0/16" };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.subnets.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkName,
|
||||
subnetName,
|
||||
subnetParameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a subnet in the specified virtual network.
|
||||
*
|
||||
* @summary Creates or updates a subnet in the specified virtual network.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/SubnetCreateWithDelegation.json
|
||||
*/
|
||||
async function createSubnetWithADelegation() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subId";
|
||||
const resourceGroupName =
|
||||
process.env["NETWORK_RESOURCE_GROUP"] || "subnet-test";
|
||||
const virtualNetworkName = "vnetname";
|
||||
const subnetName = "subnet1";
|
||||
const subnetParameters: Subnet = { addressPrefix: "10.0.0.0/16" };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.subnets.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkName,
|
||||
subnetName,
|
||||
subnetParameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a subnet in the specified virtual network.
|
||||
*
|
||||
* @summary Creates or updates a subnet in the specified virtual network.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/SubnetCreateServiceEndpoint.json
|
||||
*/
|
||||
async function createSubnetWithServiceEndpoints() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName =
|
||||
process.env["NETWORK_RESOURCE_GROUP"] || "subnet-test";
|
||||
const virtualNetworkName = "vnetname";
|
||||
const subnetName = "subnet1";
|
||||
const subnetParameters: Subnet = {
|
||||
addressPrefix: "10.0.0.0/16",
|
||||
serviceEndpoints: [{ service: "Microsoft.Storage" }]
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.subnets.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkName,
|
||||
subnetName,
|
||||
subnetParameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createSubnet();
|
||||
createSubnetWithADelegation();
|
||||
createSubnetWithServiceEndpoints();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified subnet.
|
||||
*
|
||||
* @summary Deletes the specified subnet.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/SubnetDelete.json
|
||||
*/
|
||||
async function deleteSubnet() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName =
|
||||
process.env["NETWORK_RESOURCE_GROUP"] || "subnet-test";
|
||||
const virtualNetworkName = "vnetname";
|
||||
const subnetName = "subnet1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.subnets.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkName,
|
||||
subnetName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteSubnet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* 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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified subnet by virtual network and resource group.
|
||||
*
|
||||
* @summary Gets the specified subnet by virtual network and resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/SubnetGet.json
|
||||
*/
|
||||
async function getSubnet() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName =
|
||||
process.env["NETWORK_RESOURCE_GROUP"] || "subnet-test";
|
||||
const virtualNetworkName = "vnetname";
|
||||
const subnetName = "subnet1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.subnets.get(
|
||||
resourceGroupName,
|
||||
virtualNetworkName,
|
||||
subnetName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified subnet by virtual network and resource group.
|
||||
*
|
||||
* @summary Gets the specified subnet by virtual network and resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/SubnetGetWithDelegation.json
|
||||
*/
|
||||
async function getSubnetWithADelegation() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subId";
|
||||
const resourceGroupName =
|
||||
process.env["NETWORK_RESOURCE_GROUP"] || "subnet-test";
|
||||
const virtualNetworkName = "vnetname";
|
||||
const subnetName = "subnet1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.subnets.get(
|
||||
resourceGroupName,
|
||||
virtualNetworkName,
|
||||
subnetName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getSubnet();
|
||||
getSubnetWithADelegation();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* 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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all subnets in a virtual network.
|
||||
*
|
||||
* @summary Gets all subnets in a virtual network.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/SubnetList.json
|
||||
*/
|
||||
async function listSubnets() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName =
|
||||
process.env["NETWORK_RESOURCE_GROUP"] || "subnet-test";
|
||||
const virtualNetworkName = "vnetname";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.subnets.list(
|
||||
resourceGroupName,
|
||||
virtualNetworkName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listSubnets();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
* 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 {
|
||||
VirtualNetworkGatewayConnection,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a virtual network gateway connection in the specified resource group.
|
||||
*
|
||||
* @summary Creates or updates a virtual network gateway connection in the specified resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayConnectionCreate.json
|
||||
*/
|
||||
async function createVirtualNetworkGatewayConnectionS2S() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayConnectionName = "connS2S";
|
||||
const parameters: VirtualNetworkGatewayConnection = {
|
||||
connectionProtocol: "IKEv2",
|
||||
connectionType: "IPsec",
|
||||
enableBgp: false,
|
||||
ipsecPolicies: [],
|
||||
localNetworkGateway2: {
|
||||
etag: 'W/"00000000-0000-0000-0000-000000000000"',
|
||||
gatewayIpAddress: "x.x.x.x",
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw",
|
||||
localNetworkAddressSpace: { addressPrefixes: ["10.1.0.0/16"] },
|
||||
location: "centralus",
|
||||
resourceGuid: "00000000-0000-0000-0000-000000000000",
|
||||
tags: {}
|
||||
},
|
||||
location: "centralus",
|
||||
routingWeight: 0,
|
||||
sharedKey: "Abc123",
|
||||
usePolicyBasedTrafficSelectors: false,
|
||||
virtualNetworkGateway1: {
|
||||
active: false,
|
||||
bgpSettings: {
|
||||
asn: 65514,
|
||||
bgpPeeringAddress: "10.0.1.30",
|
||||
peerWeight: 0
|
||||
},
|
||||
enableBgp: false,
|
||||
etag: 'W/"00000000-0000-0000-0000-000000000000"',
|
||||
gatewayType: "Vpn",
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw",
|
||||
ipConfigurations: [
|
||||
{
|
||||
name: "gwipconfig1",
|
||||
etag: 'W/"00000000-0000-0000-0000-000000000000"',
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1",
|
||||
privateIPAllocationMethod: "Dynamic",
|
||||
publicIPAddress: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"
|
||||
},
|
||||
subnet: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"
|
||||
}
|
||||
}
|
||||
],
|
||||
location: "centralus",
|
||||
resourceGuid: "00000000-0000-0000-0000-000000000000",
|
||||
sku: { name: "VpnGw1", capacity: 2, tier: "VpnGw1" },
|
||||
tags: {},
|
||||
vpnType: "RouteBased"
|
||||
}
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGatewayConnections.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayConnectionName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
createVirtualNetworkGatewayConnectionS2S();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified virtual network Gateway connection.
|
||||
*
|
||||
* @summary Deletes the specified virtual network Gateway connection.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayConnectionDelete.json
|
||||
*/
|
||||
async function deleteVirtualNetworkGatewayConnection() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayConnectionName = "conn1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGatewayConnections.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayConnectionName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteVirtualNetworkGatewayConnection();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified virtual network gateway connection by resource group.
|
||||
*
|
||||
* @summary Gets the specified virtual network gateway connection by resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayConnectionGet.json
|
||||
*/
|
||||
async function getVirtualNetworkGatewayConnection() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayConnectionName = "connS2S";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGatewayConnections.get(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayConnectionName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getVirtualNetworkGatewayConnection();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider.
|
||||
*
|
||||
* @summary The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayConnectionGetSharedKey.json
|
||||
*/
|
||||
async function getVirtualNetworkGatewayConnectionSharedKey() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayConnectionName = "connS2S";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGatewayConnections.getSharedKey(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayConnectionName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getVirtualNetworkGatewayConnectionSharedKey();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created.
|
||||
*
|
||||
* @summary The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayConnectionsList.json
|
||||
*/
|
||||
async function listVirtualNetworkGatewayConnectionsinResourceGroup() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.virtualNetworkGatewayConnections.list(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listVirtualNetworkGatewayConnectionsinResourceGroup();
|
||||
}
|
||||
|
||||
main().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 {
|
||||
ConnectionResetSharedKey,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
|
||||
*
|
||||
* @summary The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayConnectionResetSharedKey.json
|
||||
*/
|
||||
async function resetVirtualNetworkGatewayConnectionSharedKey() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayConnectionName = "conn1";
|
||||
const parameters: ConnectionResetSharedKey = { keyLength: 128 };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGatewayConnections.beginResetSharedKeyAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayConnectionName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
resetVirtualNetworkGatewayConnectionSharedKey();
|
||||
}
|
||||
|
||||
main().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 {
|
||||
ConnectionSharedKey,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
|
||||
*
|
||||
* @summary The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayConnectionSetSharedKey.json
|
||||
*/
|
||||
async function setVirtualNetworkGatewayConnectionSharedKey() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayConnectionName = "connS2S";
|
||||
const parameters: ConnectionSharedKey = { value: "AzureAbc123" };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGatewayConnections.beginSetSharedKeyAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayConnectionName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
setVirtualNetworkGatewayConnectionSharedKey();
|
||||
}
|
||||
|
||||
main().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 {
|
||||
TagsObject,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a virtual network gateway connection tags.
|
||||
*
|
||||
* @summary Updates a virtual network gateway connection tags.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayConnectionUpdateTags.json
|
||||
*/
|
||||
async function updateVirtualNetworkGatewayConnectionTags() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayConnectionName = "test";
|
||||
const parameters: TagsObject = { tags: { tag1: "value1", tag2: "value2" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGatewayConnections.beginUpdateTagsAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayConnectionName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
updateVirtualNetworkGatewayConnectionTags();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* 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 {
|
||||
VirtualNetworkGateway,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a virtual network gateway in the specified resource group.
|
||||
*
|
||||
* @summary Creates or updates a virtual network gateway in the specified resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayUpdate.json
|
||||
*/
|
||||
async function updateVirtualNetworkGateway() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayName = "vpngw";
|
||||
const parameters: VirtualNetworkGateway = {
|
||||
active: false,
|
||||
bgpSettings: { asn: 65515, bgpPeeringAddress: "10.0.1.30", peerWeight: 0 },
|
||||
enableBgp: false,
|
||||
gatewayType: "Vpn",
|
||||
ipConfigurations: [
|
||||
{
|
||||
name: "gwipconfig1",
|
||||
privateIPAllocationMethod: "Dynamic",
|
||||
publicIPAddress: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"
|
||||
},
|
||||
subnet: {
|
||||
id:
|
||||
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"
|
||||
}
|
||||
}
|
||||
],
|
||||
location: "centralus",
|
||||
sku: { name: "VpnGw1", tier: "VpnGw1" },
|
||||
vpnType: "RouteBased"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGateways.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
updateVirtualNetworkGateway();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the specified virtual network gateway.
|
||||
*
|
||||
* @summary Deletes the specified virtual network gateway.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayDelete.json
|
||||
*/
|
||||
async function deleteVirtualNetworkGateway() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayName = "vpngw";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGateways.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteVirtualNetworkGateway();
|
||||
}
|
||||
|
||||
main().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 {
|
||||
VpnClientParameters,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication.
|
||||
*
|
||||
* @summary Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayGenerateVpnProfile.json
|
||||
*/
|
||||
async function generateVirtualNetworkGatewayVpnProfile() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayName = "vpngw";
|
||||
const parameters: VpnClientParameters = {};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGateways.beginGenerateVpnProfileAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
generateVirtualNetworkGatewayVpnProfile();
|
||||
}
|
||||
|
||||
main().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 {
|
||||
VpnClientParameters,
|
||||
NetworkManagementClient
|
||||
} from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Generates VPN client package for P2S client of the virtual network gateway in the specified resource group.
|
||||
*
|
||||
* @summary Generates VPN client package for P2S client of the virtual network gateway in the specified resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayGenerateVpnClientPackage.json
|
||||
*/
|
||||
async function generateVpnClientPackage() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayName = "vpngw";
|
||||
const parameters: VpnClientParameters = {};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGateways.beginGeneratevpnclientpackageAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
generateVpnClientPackage();
|
||||
}
|
||||
|
||||
main().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 { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.
|
||||
*
|
||||
* @summary This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayGetAdvertisedRoutes.json
|
||||
*/
|
||||
async function getVirtualNetworkGatewayAdvertisedRoutes() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayName = "vpngw";
|
||||
const peer = "test";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGateways.beginGetAdvertisedRoutesAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayName,
|
||||
peer
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getVirtualNetworkGatewayAdvertisedRoutes();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to The GetBgpPeerStatus operation retrieves the status of all BGP peers.
|
||||
*
|
||||
* @summary The GetBgpPeerStatus operation retrieves the status of all BGP peers.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayGetBGPPeerStatus.json
|
||||
*/
|
||||
async function getVirtualNetworkGatewayBgpPeerStatus() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayName = "vpngw";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGateways.beginGetBgpPeerStatusAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getVirtualNetworkGatewayBgpPeerStatus();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers.
|
||||
*
|
||||
* @summary This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayLearnedRoutes.json
|
||||
*/
|
||||
async function getVirtualNetworkGatewayLearnedRoutes() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayName = "vpngw";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGateways.beginGetLearnedRoutesAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getVirtualNetworkGatewayLearnedRoutes();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the specified virtual network gateway by resource group.
|
||||
*
|
||||
* @summary Gets the specified virtual network gateway by resource group.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayGet.json
|
||||
*/
|
||||
async function getVirtualNetworkGateway() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayName = "vpngw";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGateways.get(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getVirtualNetworkGateway();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.
|
||||
*
|
||||
* @summary Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayGetVpnProfilePackageUrl.json
|
||||
*/
|
||||
async function getVirtualNetworkGatewayVpnProfilePackageUrl() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayName = "vpngw";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGateways.beginGetVpnProfilePackageUrlAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getVirtualNetworkGatewayVpnProfilePackageUrl();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.
|
||||
*
|
||||
* @summary The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewayGetVpnClientIpsecParameters.json
|
||||
*/
|
||||
async function getVirtualNetworkGatewayVpnClientIpsecParameters() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
|
||||
const virtualNetworkGatewayName = "vpngw";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const result = await client.virtualNetworkGateways.beginGetVpnclientIpsecParametersAndWait(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getVirtualNetworkGatewayVpnClientIpsecParameters();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { NetworkManagementClient } from "@azure/arm-network-profile-2020-09-01-hybrid";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets all the connections in a virtual network gateway.
|
||||
*
|
||||
* @summary Gets all the connections in a virtual network gateway.
|
||||
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/examples/VirtualNetworkGatewaysListConnections.json
|
||||
*/
|
||||
async function virtualNetworkGatewaysListConnections() {
|
||||
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
|
||||
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
|
||||
const virtualNetworkGatewayName = "test-vpn-gateway-1";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NetworkManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.virtualNetworkGateways.listConnections(
|
||||
resourceGroupName,
|
||||
virtualNetworkGatewayName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
virtualNetworkGatewaysListConnections();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче