From 48b90344c9846174bb9fdcb084b84f5ed17145ae Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Thu, 3 Nov 2022 13:42:07 +0800 Subject: [PATCH 1/5] resources regenerate --- sdk/resources/arm-resources/CHANGELOG.md | 20 +- sdk/resources/arm-resources/_meta.json | 10 +- sdk/resources/arm-resources/package.json | 22 +- .../recording_resourcegroups_create_test.json | 52 ++ .../recording_resourcegroups_delete_test.json | 488 ++++++++++++++++++ .../recording_resourcegroups_get_test.json | 47 ++ .../recording_resourcegroups_list_test.json | 262 ++++++++++ .../recording_resourcegroups_update_test.json | 55 ++ .../recording_tagsoperations_create_test.json | 45 ++ .../recording_tagsoperations_delete_test.json | 381 ++++++++++++++ .../recording_tagsoperations_get_test.json | 46 ++ .../recording_tagsoperations_list_test.json | 353 +++++++++++++ .../recording_tagsoperations_update_test.json | 55 ++ .../arm-resources/review/arm-resources.api.md | 43 +- ...mentsWhatIfAtManagementGroupScopeSample.ts | 6 +- ...loymentsWhatIfAtSubscriptionScopeSample.ts | 6 +- .../deploymentsWhatIfAtTenantScopeSample.ts | 6 +- .../samples-dev/deploymentsWhatIfSample.ts | 6 +- .../samples/v5/javascript/README.md | 88 ---- .../deploymentsCalculateTemplateHashSample.js | 43 -- ...ateOrUpdateAtManagementGroupScopeSample.js | 42 -- .../deploymentsCreateOrUpdateAtScopeSample.js | 43 -- ...CreateOrUpdateAtSubscriptionScopeSample.js | 42 -- ...ymentsCreateOrUpdateAtTenantScopeSample.js | 41 -- .../deploymentsCreateOrUpdateSample.js | 139 ----- ...mentsWhatIfAtManagementGroupScopeSample.js | 38 -- ...loymentsWhatIfAtSubscriptionScopeSample.js | 36 -- .../deploymentsWhatIfAtTenantScopeSample.js | 36 -- .../v5/javascript/deploymentsWhatIfSample.js | 37 -- .../samples/v5/javascript/package.json | 32 -- .../providerResourceTypesListSample.js | 29 -- .../providersGetAtTenantScopeSample.js | 31 -- .../v5/javascript/providersGetSample.js | 29 -- .../v5/javascript/providersListSample.js | 31 -- .../providersProviderPermissionsSample.js | 29 -- .../resourceGroupsCreateOrUpdateSample.js | 30 -- .../javascript/resourceGroupsDeleteSample.js | 51 -- .../resourceGroupsExportTemplateSample.js | 62 --- .../samples/v5/javascript/sample.env | 4 - .../tagsCreateOrUpdateAtScopeSample.js | 53 -- .../v5/javascript/tagsGetAtScopeSample.js | 47 -- .../samples/v5/typescript/README.md | 101 ---- .../samples/v5/typescript/package.json | 41 -- .../samples/v5/typescript/sample.env | 4 - .../deploymentsCalculateTemplateHashSample.ts | 43 -- ...ateOrUpdateAtManagementGroupScopeSample.ts | 45 -- .../deploymentsCreateOrUpdateAtScopeSample.ts | 44 -- ...CreateOrUpdateAtSubscriptionScopeSample.ts | 45 -- ...ymentsCreateOrUpdateAtTenantScopeSample.ts | 44 -- .../src/deploymentsCreateOrUpdateSample.ts | 148 ------ ...mentsWhatIfAtManagementGroupScopeSample.ts | 41 -- ...loymentsWhatIfAtSubscriptionScopeSample.ts | 39 -- .../deploymentsWhatIfAtTenantScopeSample.ts | 39 -- .../typescript/src/deploymentsWhatIfSample.ts | 40 -- .../src/providerResourceTypesListSample.ts | 31 -- .../src/providersGetAtTenantScopeSample.ts | 37 -- .../v5/typescript/src/providersGetSample.ts | 29 -- .../v5/typescript/src/providersListSample.ts | 31 -- .../src/providersProviderPermissionsSample.ts | 31 -- .../src/resourceGroupsCreateOrUpdateSample.ts | 33 -- .../src/resourceGroupsDeleteSample.ts | 62 --- .../src/resourceGroupsExportTemplateSample.ts | 65 --- .../src/tagsCreateOrUpdateAtScopeSample.ts | 59 --- .../v5/typescript/src/tagsGetAtScopeSample.ts | 47 -- .../samples/v5/typescript/tsconfig.json | 17 - sdk/resources/arm-resources/src/index.ts | 1 + .../arm-resources/src/models/index.ts | 36 +- .../src/operations/deploymentOperations.ts | 170 ++++-- .../src/operations/deployments.ts | 151 ++++-- .../src/operations/operations.ts | 29 +- .../arm-resources/src/operations/providers.ts | 64 ++- .../src/operations/resourceGroups.ts | 31 +- .../arm-resources/src/operations/resources.ts | 67 ++- .../src/operations/tagsOperations.ts | 31 +- .../src/operationsInterfaces/providers.ts | 5 +- .../src/operationsInterfaces/resources.ts | 4 +- .../arm-resources/src/pagingHelper.ts | 39 ++ .../src/resourceManagementClient.ts | 73 ++- .../arm-resources/test/resources_examples.ts | 151 +++--- 79 files changed, 2442 insertions(+), 2442 deletions(-) create mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.json create mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.json create mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.json create mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.json create mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.json create mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.json create mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.json create mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.json create mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.json create mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.json delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/README.md delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/package.json delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/sample.env delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/README.md delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/package.json delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/sample.env delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json create mode 100644 sdk/resources/arm-resources/src/pagingHelper.ts diff --git a/sdk/resources/arm-resources/CHANGELOG.md b/sdk/resources/arm-resources/CHANGELOG.md index 431701ce333e..9cde036f78b1 100644 --- a/sdk/resources/arm-resources/CHANGELOG.md +++ b/sdk/resources/arm-resources/CHANGELOG.md @@ -1,15 +1,13 @@ # Release History - -## 5.0.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 5.1.0 (2022-11-03) + +**Features** + + - Added Interface DeploymentWhatIfProperties + - Added Interface GenericResource + - Added Interface GenericResourceExpanded + ## 5.0.1 (2022-04-18) **features** diff --git a/sdk/resources/arm-resources/_meta.json b/sdk/resources/arm-resources/_meta.json index c6765ba542bb..d6c5c456e9b3 100644 --- a/sdk/resources/arm-resources/_meta.json +++ b/sdk/resources/arm-resources/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "readme": "specification\\resources\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "8fcc099eeda14f210476c935241d429f46c2d02e", + "readme": "specification/resources/resource-manager/readme.md", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221101.1 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", + "use": "@autorest/typescript@6.0.0-rc.3.20221101.1" } \ No newline at end of file diff --git a/sdk/resources/arm-resources/package.json b/sdk/resources/arm-resources/package.json index 5317ee42fafd..658a6ef2e0b5 100644 --- a/sdk/resources/arm-resources/package.json +++ b/sdk/resources/arm-resources/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ResourceManagementClient.", - "version": "5.0.2", + "version": "5.1.0", "engines": { "node": ">=14.0.0" }, @@ -11,7 +11,7 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.5.0", + "@azure/core-client": "^1.6.1", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -36,13 +36,18 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.2.0", + "typescript": "~4.6.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.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/resources/arm-resources", "repository": { @@ -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": { @@ -115,4 +119,4 @@ "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview" } -} +} \ No newline at end of file diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.json new file mode 100644 index 000000000000..38e9b8e02a72 --- /dev/null +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.json @@ -0,0 +1,52 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups/myjstest1?api-version=2021-04-01", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "46", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "0c95efd2-79df-40f6-b2db-a0b6b1267965" + }, + "RequestBody": { + "location": "eastus", + "tags": { + "tag1": "value1" + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "225", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Nov 2022 05:32:08 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "d90467cf-f567-41d2-9882-3aac68be9b69", + "x-ms-ratelimit-remaining-subscription-writes": "1199", + "x-ms-request-id": "d90467cf-f567-41d2-9882-3aac68be9b69", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053208Z:d90467cf-f567-41d2-9882-3aac68be9b69" + }, + "ResponseBody": { + "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1", + "name": "myjstest1", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": { + "tag1": "value1" + }, + "properties": { + "provisioningState": "Succeeded" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.json new file mode 100644 index 000000000000..c9e5d3f16897 --- /dev/null +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.json @@ -0,0 +1,488 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups/myjstest1?api-version=2021-04-01", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "e405bfc6-ddc0-413a-aa47-ce3999b7e98d" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Thu, 03 Nov 2022 05:32:25 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "Pragma": "no-cache", + "Retry-After": "15", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "9853708d-10f3-4f2c-8132-96af997de7d2", + "x-ms-ratelimit-remaining-subscription-deletes": "14998", + "x-ms-request-id": "9853708d-10f3-4f2c-8132-96af997de7d2", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053225Z:9853708d-10f3-4f2c-8132-96af997de7d2" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "56fa54a7-9ba9-457b-9e17-b8d373524bdb" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Thu, 03 Nov 2022 05:32:25 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "Pragma": "no-cache", + "Retry-After": "15", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "ecaf441b-9b23-4d02-9e99-337932e44db8", + "x-ms-ratelimit-remaining-subscription-reads": "11994", + "x-ms-request-id": "ecaf441b-9b23-4d02-9e99-337932e44db8", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053226Z:ecaf441b-9b23-4d02-9e99-337932e44db8" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "a61a5ea8-a441-4dac-b703-7bbf8d7e214f" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Thu, 03 Nov 2022 05:32:26 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "Pragma": "no-cache", + "Retry-After": "15", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "e462b778-6256-42a8-8323-c741a8c6b07d", + "x-ms-ratelimit-remaining-subscription-reads": "11993", + "x-ms-request-id": "e462b778-6256-42a8-8323-c741a8c6b07d", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053226Z:e462b778-6256-42a8-8323-c741a8c6b07d" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "30fdd0da-feed-4ab4-9587-e5e26f480e07" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Thu, 03 Nov 2022 05:32:41 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "Pragma": "no-cache", + "Retry-After": "15", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "eb9e08a6-6389-49e9-b8cb-76389da8b875", + "x-ms-ratelimit-remaining-subscription-reads": "11992", + "x-ms-request-id": "eb9e08a6-6389-49e9-b8cb-76389da8b875", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053242Z:eb9e08a6-6389-49e9-b8cb-76389da8b875" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "80fd8b37-8dc0-45b3-86dd-7db6aecc7e65" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Thu, 03 Nov 2022 05:32:57 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "Pragma": "no-cache", + "Retry-After": "15", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "2cbb1170-b361-4d26-a9ae-83320565ce06", + "x-ms-ratelimit-remaining-subscription-reads": "11991", + "x-ms-request-id": "2cbb1170-b361-4d26-a9ae-83320565ce06", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053257Z:2cbb1170-b361-4d26-a9ae-83320565ce06" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "8ea3041f-b3c2-459c-9420-ab07b5822bdb" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Thu, 03 Nov 2022 05:33:12 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "Pragma": "no-cache", + "Retry-After": "15", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "66da1da9-f280-4737-b47c-e844a25f6bc6", + "x-ms-ratelimit-remaining-subscription-reads": "11990", + "x-ms-request-id": "66da1da9-f280-4737-b47c-e844a25f6bc6", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053313Z:66da1da9-f280-4737-b47c-e844a25f6bc6" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "24247cf6-2246-43e0-82e9-29acace75b2a" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Thu, 03 Nov 2022 05:33:28 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "Pragma": "no-cache", + "Retry-After": "15", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "849e2f1a-7cef-4158-a35e-8599be5cab1c", + "x-ms-ratelimit-remaining-subscription-reads": "11989", + "x-ms-request-id": "849e2f1a-7cef-4158-a35e-8599be5cab1c", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053328Z:849e2f1a-7cef-4158-a35e-8599be5cab1c" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "8bf51ec4-ea37-4cc2-8264-0bd08eb7a956" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Thu, 03 Nov 2022 05:33:43 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "13150911-2c98-4ea8-886d-2a42dfd483d1", + "x-ms-ratelimit-remaining-subscription-reads": "11988", + "x-ms-request-id": "13150911-2c98-4ea8-886d-2a42dfd483d1", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053344Z:13150911-2c98-4ea8-886d-2a42dfd483d1" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "f9b7eb39-06fc-403d-91af-57da659f4694" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Length": "5039", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Nov 2022 05:33:43 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "976303c5-e36b-435b-b077-6faadc0ad1f2", + "x-ms-ratelimit-remaining-subscription-reads": "11987", + "x-ms-request-id": "976303c5-e36b-435b-b077-6faadc0ad1f2", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053344Z:976303c5-e36b-435b-b077-6faadc0ad1f2" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/sdk-net-test-qa2", + "name": "sdk-net-test-qa2", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/DefaultResourceGroup-CCAN", + "name": "DefaultResourceGroup-CCAN", + "type": "Microsoft.Resources/resourceGroups", + "location": "canadacentral", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/DefaultResourceGroup-EUS2", + "name": "DefaultResourceGroup-EUS2", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus2", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/DefaultResourceGroup-CUS", + "name": "DefaultResourceGroup-CUS", + "type": "Microsoft.Resources/resourceGroups", + "location": "centralus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/iyljd2wtoqh43dern43sawzmqxkeari3bcqiadgfste4outj7cdmmslvr4yfw2vmrsqeiogmitj", + "name": "iyljd2wtoqh43dern43sawzmqxkeari3bcqiadgfste4outj7cdmmslvr4yfw2vmrsqeiogmitj", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": { + "DeleteAfter": "2020-08-15T07:02:26.327834" + }, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/AzSecPackAutoConfigRG", + "name": "AzSecPackAutoConfigRG", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/qiaozhatest", + "name": "qiaozhatest", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest", + "name": "myjstest", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": { + "tag1": "value1", + "tag2": "value2" + }, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/anf-secondary-rg", + "name": "anf-secondary-rg", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/chenjieshitest", + "name": "chenjieshitest", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/test-changlong", + "name": "test-changlong", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/czwTest", + "name": "czwTest", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/NetworkWatcherRG", + "name": "NetworkWatcherRG", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/DefaultResourceGroup-EUS", + "name": "DefaultResourceGroup-EUS", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-test", + "name": "go-test", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-128", + "name": "go-sdk-test-128", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/cloud-shell-storage-southeastasia", + "name": "cloud-shell-storage-southeastasia", + "type": "Microsoft.Resources/resourceGroups", + "location": "southeastasia", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/create1250872478", + "name": "create1250872478", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/anf-primary-rg", + "name": "anf-primary-rg", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-597", + "name": "go-sdk-test-597", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-test2", + "name": "go-test2", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/ApiExplorer", + "name": "ApiExplorer", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus2", + "properties": { + "provisioningState": "Succeeded" + } + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.json new file mode 100644 index 000000000000..00129d924b26 --- /dev/null +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.json @@ -0,0 +1,47 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups/myjstest1?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "5b62ac89-a5e9-42ef-8db9-f36cf822d43b" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Length": "225", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Nov 2022 05:32:08 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "24a69f0b-d907-4b0c-9fb2-b497debb297f", + "x-ms-ratelimit-remaining-subscription-reads": "11999", + "x-ms-request-id": "24a69f0b-d907-4b0c-9fb2-b497debb297f", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053209Z:24a69f0b-d907-4b0c-9fb2-b497debb297f" + }, + "ResponseBody": { + "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1", + "name": "myjstest1", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": { + "tag1": "value1" + }, + "properties": { + "provisioningState": "Succeeded" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.json new file mode 100644 index 000000000000..f72fc676e148 --- /dev/null +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.json @@ -0,0 +1,262 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "ee123806-d63c-451b-9a70-8f12e78d1833" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Length": "5265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Nov 2022 05:32:09 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "fe2fb4a9-1643-47d8-b2ed-f130ad6cec95", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "fe2fb4a9-1643-47d8-b2ed-f130ad6cec95", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053209Z:fe2fb4a9-1643-47d8-b2ed-f130ad6cec95" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/sdk-net-test-qa2", + "name": "sdk-net-test-qa2", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/DefaultResourceGroup-CCAN", + "name": "DefaultResourceGroup-CCAN", + "type": "Microsoft.Resources/resourceGroups", + "location": "canadacentral", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/DefaultResourceGroup-EUS2", + "name": "DefaultResourceGroup-EUS2", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus2", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/DefaultResourceGroup-CUS", + "name": "DefaultResourceGroup-CUS", + "type": "Microsoft.Resources/resourceGroups", + "location": "centralus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/iyljd2wtoqh43dern43sawzmqxkeari3bcqiadgfste4outj7cdmmslvr4yfw2vmrsqeiogmitj", + "name": "iyljd2wtoqh43dern43sawzmqxkeari3bcqiadgfste4outj7cdmmslvr4yfw2vmrsqeiogmitj", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": { + "DeleteAfter": "2020-08-15T07:02:26.327834" + }, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/AzSecPackAutoConfigRG", + "name": "AzSecPackAutoConfigRG", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/qiaozhatest", + "name": "qiaozhatest", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest", + "name": "myjstest", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": { + "tag1": "value1", + "tag2": "value2" + }, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/anf-secondary-rg", + "name": "anf-secondary-rg", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/chenjieshitest", + "name": "chenjieshitest", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/test-changlong", + "name": "test-changlong", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/czwTest", + "name": "czwTest", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/NetworkWatcherRG", + "name": "NetworkWatcherRG", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/DefaultResourceGroup-EUS", + "name": "DefaultResourceGroup-EUS", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-test", + "name": "go-test", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-128", + "name": "go-sdk-test-128", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1", + "name": "myjstest1", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": { + "tag1": "value1" + }, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/cloud-shell-storage-southeastasia", + "name": "cloud-shell-storage-southeastasia", + "type": "Microsoft.Resources/resourceGroups", + "location": "southeastasia", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/create1250872478", + "name": "create1250872478", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/anf-primary-rg", + "name": "anf-primary-rg", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-597", + "name": "go-sdk-test-597", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-test2", + "name": "go-test2", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/ApiExplorer", + "name": "ApiExplorer", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus2", + "properties": { + "provisioningState": "Succeeded" + } + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.json new file mode 100644 index 000000000000..fee54a36dcf4 --- /dev/null +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.json @@ -0,0 +1,55 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups/myjstest1?api-version=2021-04-01", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "42", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "48b9a9a1-e873-4bd5-8185-d57d22e98c92" + }, + "RequestBody": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Nov 2022 05:32:11 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "3963f24a-dc8e-4804-a340-f4cfb345e160", + "x-ms-ratelimit-remaining-subscription-writes": "1198", + "x-ms-request-id": "3963f24a-dc8e-4804-a340-f4cfb345e160", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053211Z:3963f24a-dc8e-4804-a340-f4cfb345e160" + }, + "ResponseBody": { + "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1", + "name": "myjstest1", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": { + "tag1": "value1", + "tag2": "value2" + }, + "properties": { + "provisioningState": "Succeeded" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.json new file mode 100644 index 000000000000..725f0c746270 --- /dev/null +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.json @@ -0,0 +1,45 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/tagNames/tagyyy?api-version=2021-04-01", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "0", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "9542bc9d-12c0-43e7-ad7c-4064b405798d" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Nov 2022 05:32:13 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "5b03969c-5c8a-4150-ac73-715ae59b84f0", + "x-ms-ratelimit-remaining-subscription-writes": "1197", + "x-ms-request-id": "5b03969c-5c8a-4150-ac73-715ae59b84f0", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053214Z:5b03969c-5c8a-4150-ac73-715ae59b84f0" + }, + "ResponseBody": { + "id": "/subscriptions/azure_subscription_id/tagNames/tagyyy", + "tagName": "tagyyy", + "count": { + "type": "Total", + "value": 0 + }, + "values": [] + } + } + ], + "Variables": {} +} diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.json new file mode 100644 index 000000000000..1b8843544684 --- /dev/null +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.json @@ -0,0 +1,381 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups/myjstest1/providers/Microsoft.Resources/tags/default?api-version=2021-04-01", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "46471654-b239-42e2-b548-1b9148c4c987" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Thu, 03 Nov 2022 05:32:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "8cb2ef67-caff-4840-b4cd-9b4a090c37ef", + "x-ms-ratelimit-remaining-subscription-deletes": "14999", + "x-ms-request-id": "8cb2ef67-caff-4840-b4cd-9b4a090c37ef", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053220Z:8cb2ef67-caff-4840-b4cd-9b4a090c37ef" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/tagNames?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "95095a7f-bc4d-4b4e-b5ea-c71b11f2c2c9" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Length": "5000", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Nov 2022 05:32:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "cb52b61a-d426-4a74-a8d3-0c36b3cf7577", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "cb52b61a-d426-4a74-a8d3-0c36b3cf7577", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053220Z:cb52b61a-d426-4a74-a8d3-0c36b3cf7577" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag1", + "tagName": "tag1", + "count": { + "type": "Total", + "value": 4 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag1/tagValues/value1", + "tagValue": "value1", + "count": { + "type": "Total", + "value": 4 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag2", + "tagName": "tag2", + "count": { + "type": "Total", + "value": 4 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag2/tagValues/value2", + "tagValue": "value2", + "count": { + "type": "Total", + "value": 4 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/Author", + "tagName": "Author", + "count": { + "type": "Total", + "value": 6 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/Author/tagValues/ANF Go CRR SDK Sample", + "tagValue": "ANF Go CRR SDK Sample", + "count": { + "type": "Total", + "value": 6 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/Service", + "tagName": "Service", + "count": { + "type": "Total", + "value": 6 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/Service/tagValues/Azure Netapp Files", + "tagValue": "Azure Netapp Files", + "count": { + "type": "Total", + "value": 6 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/key1", + "tagName": "key1", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/key1/tagValues/value1", + "tagValue": "value1", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/key2", + "tagName": "key2", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/key2/tagValues/value2", + "tagValue": "value2", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/ms-resource-usage", + "tagName": "ms-resource-usage", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/ms-resource-usage/tagValues/azure-cloud-shell", + "tagValue": "azure-cloud-shell", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/Creator", + "tagName": "Creator", + "count": { + "type": "Total", + "value": 18 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/Creator/tagValues/Automatically added by NRMS Azure Policy", + "tagValue": "Automatically added by NRMS Azure Policy", + "count": { + "type": "Total", + "value": 18 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/NRMS-Info", + "tagName": "NRMS-Info", + "count": { + "type": "Total", + "value": 18 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/NRMS-Info/tagValues/http://aka.ms/nrms", + "tagValue": "http://aka.ms/nrms", + "count": { + "type": "Total", + "value": 18 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/NRMS-Version", + "tagName": "NRMS-Version", + "count": { + "type": "Total", + "value": 18 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/NRMS-Version/tagValues/2019-03-20", + "tagValue": "2019-03-20", + "count": { + "type": "Total", + "value": 18 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/displayName", + "tagName": "displayName", + "count": { + "type": "Total", + "value": 2 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/displayName/tagValues/NSG - Subnet", + "tagValue": "NSG - Subnet", + "count": { + "type": "Total", + "value": 1 + } + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/displayName/tagValues/UDR - Subnet", + "tagValue": "UDR - Subnet", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag2597940633", + "tagName": "tag2597940633", + "count": { + "type": "Total", + "value": 0 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag2597940633/tagValues/value2597940633", + "tagValue": "value2597940633", + "count": { + "type": "Total", + "value": 0 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/DeleteAfter", + "tagName": "DeleteAfter", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/DeleteAfter/tagValues/2020-08-15T07:02:26.327834", + "tagValue": "2020-08-15T07:02:26.327834", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tagKey1", + "tagName": "tagKey1", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/tagKey1/tagValues/tag-value-1", + "tagValue": "tag-value-1", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tagKey2", + "tagName": "tagKey2", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/tagKey2/tagValues/tag-value-2", + "tagValue": "tag-value-2", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag3175540232", + "tagName": "tag3175540232", + "count": { + "type": "Total", + "value": 0 + }, + "values": [] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag4234309224", + "tagName": "tag4234309224", + "count": { + "type": "Total", + "value": 0 + }, + "values": [] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag529323608", + "tagName": "tag529323608", + "count": { + "type": "Total", + "value": 0 + }, + "values": [] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tagyyy", + "tagName": "tagyyy", + "count": { + "type": "Total", + "value": 0 + }, + "values": [] + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.json new file mode 100644 index 000000000000..dc155897d791 --- /dev/null +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.json @@ -0,0 +1,46 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups/myjstest1/providers/Microsoft.Resources/tags/default?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "b57de260-360e-4291-8a70-871b2072f38b" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Length": "220", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Nov 2022 05:32:14 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "95b8874e-269e-4c49-b3dd-0cccee1d11a3", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "95b8874e-269e-4c49-b3dd-0cccee1d11a3", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053214Z:95b8874e-269e-4c49-b3dd-0cccee1d11a3" + }, + "ResponseBody": { + "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1/providers/Microsoft.Resources/tags/default", + "name": "default", + "type": "Microsoft.Resources/tags", + "properties": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + } + ], + "Variables": {} +} diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.json new file mode 100644 index 000000000000..19308866824a --- /dev/null +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.json @@ -0,0 +1,353 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/tagNames?api-version=2021-04-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "e9628920-20aa-450a-a06c-9ac1e190558c" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Length": "5000", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Nov 2022 05:32:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "a944ef05-6d17-412a-b5bb-d792a5d9add8", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "a944ef05-6d17-412a-b5bb-d792a5d9add8", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053215Z:a944ef05-6d17-412a-b5bb-d792a5d9add8" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag1", + "tagName": "tag1", + "count": { + "type": "Total", + "value": 5 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag1/tagValues/value1", + "tagValue": "value1", + "count": { + "type": "Total", + "value": 5 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag2", + "tagName": "tag2", + "count": { + "type": "Total", + "value": 5 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag2/tagValues/value2", + "tagValue": "value2", + "count": { + "type": "Total", + "value": 5 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/Author", + "tagName": "Author", + "count": { + "type": "Total", + "value": 6 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/Author/tagValues/ANF Go CRR SDK Sample", + "tagValue": "ANF Go CRR SDK Sample", + "count": { + "type": "Total", + "value": 6 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/Service", + "tagName": "Service", + "count": { + "type": "Total", + "value": 6 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/Service/tagValues/Azure Netapp Files", + "tagValue": "Azure Netapp Files", + "count": { + "type": "Total", + "value": 6 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/key1", + "tagName": "key1", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/key1/tagValues/value1", + "tagValue": "value1", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/key2", + "tagName": "key2", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/key2/tagValues/value2", + "tagValue": "value2", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/ms-resource-usage", + "tagName": "ms-resource-usage", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/ms-resource-usage/tagValues/azure-cloud-shell", + "tagValue": "azure-cloud-shell", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/Creator", + "tagName": "Creator", + "count": { + "type": "Total", + "value": 18 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/Creator/tagValues/Automatically added by NRMS Azure Policy", + "tagValue": "Automatically added by NRMS Azure Policy", + "count": { + "type": "Total", + "value": 18 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/NRMS-Info", + "tagName": "NRMS-Info", + "count": { + "type": "Total", + "value": 18 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/NRMS-Info/tagValues/http://aka.ms/nrms", + "tagValue": "http://aka.ms/nrms", + "count": { + "type": "Total", + "value": 18 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/NRMS-Version", + "tagName": "NRMS-Version", + "count": { + "type": "Total", + "value": 18 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/NRMS-Version/tagValues/2019-03-20", + "tagValue": "2019-03-20", + "count": { + "type": "Total", + "value": 18 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/displayName", + "tagName": "displayName", + "count": { + "type": "Total", + "value": 2 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/displayName/tagValues/NSG - Subnet", + "tagValue": "NSG - Subnet", + "count": { + "type": "Total", + "value": 1 + } + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/displayName/tagValues/UDR - Subnet", + "tagValue": "UDR - Subnet", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag2597940633", + "tagName": "tag2597940633", + "count": { + "type": "Total", + "value": 0 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag2597940633/tagValues/value2597940633", + "tagValue": "value2597940633", + "count": { + "type": "Total", + "value": 0 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/DeleteAfter", + "tagName": "DeleteAfter", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/DeleteAfter/tagValues/2020-08-15T07:02:26.327834", + "tagValue": "2020-08-15T07:02:26.327834", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tagKey1", + "tagName": "tagKey1", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/tagKey1/tagValues/tag-value-1", + "tagValue": "tag-value-1", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tagKey2", + "tagName": "tagKey2", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/tagKey2/tagValues/tag-value-2", + "tagValue": "tag-value-2", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag3175540232", + "tagName": "tag3175540232", + "count": { + "type": "Total", + "value": 0 + }, + "values": [] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag4234309224", + "tagName": "tag4234309224", + "count": { + "type": "Total", + "value": 0 + }, + "values": [] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tag529323608", + "tagName": "tag529323608", + "count": { + "type": "Total", + "value": 0 + }, + "values": [] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/tagyyy", + "tagName": "tagyyy", + "count": { + "type": "Total", + "value": 0 + }, + "values": [] + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.json new file mode 100644 index 000000000000..47b4c5f80cee --- /dev/null +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.json @@ -0,0 +1,55 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups/myjstest1/providers/Microsoft.Resources/tags/default?api-version=2021-04-01", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "68", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "95db16c2-d91a-43aa-aad3-f96e09de8b22" + }, + "RequestBody": { + "operation": "Delete", + "properties": { + "tags": { + "tagkey1": "tagvalue1" + } + } + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Nov 2022 05:32:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "fd30a572-7144-48fe-8462-a9529b8d74d0", + "x-ms-ratelimit-remaining-subscription-writes": "1196", + "x-ms-request-id": "fd30a572-7144-48fe-8462-a9529b8d74d0", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053218Z:fd30a572-7144-48fe-8462-a9529b8d74d0" + }, + "ResponseBody": { + "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1/providers/Microsoft.Resources/tags/default", + "name": "default", + "type": "Microsoft.Resources/tags", + "properties": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + } + ], + "Variables": {} +} diff --git a/sdk/resources/arm-resources/review/arm-resources.api.md b/sdk/resources/arm-resources/review/arm-resources.api.md index 5b731840a4af..20b5d6b5e66e 100644 --- a/sdk/resources/arm-resources/review/arm-resources.api.md +++ b/sdk/resources/arm-resources/review/arm-resources.api.md @@ -809,9 +809,9 @@ export interface DeploymentWhatIf { } // @public -export type DeploymentWhatIfProperties = DeploymentProperties & { +export interface DeploymentWhatIfProperties extends DeploymentProperties { whatIfSettings?: DeploymentWhatIfSettings; -}; +} // @public export interface DeploymentWhatIfSettings { @@ -857,21 +857,21 @@ export interface ExtendedLocation { export type ExtendedLocationType = string; // @public -export type GenericResource = Resource & { - plan?: Plan; - properties?: Record; +export interface GenericResource extends Resource { + identity?: Identity; kind?: string; managedBy?: string; + plan?: Plan; + properties?: Record; sku?: Sku; - identity?: Identity; -}; +} // @public -export type GenericResourceExpanded = GenericResource & { - readonly createdTime?: Date; +export interface GenericResourceExpanded extends GenericResource { readonly changedTime?: Date; + readonly createdTime?: Date; readonly provisioningState?: string; -}; +} // @public export interface GenericResourceFilter { @@ -880,6 +880,9 @@ export interface GenericResourceFilter { tagvalue?: string; } +// @public +export function getContinuationToken(page: unknown): string | undefined; + // @public export interface HttpMessage { content?: Record; @@ -921,57 +924,37 @@ export enum KnownAliasPathTokenType { // @public export enum KnownExpressionEvaluationOptionsScopeType { - // (undocumented) Inner = "Inner", - // (undocumented) NotSpecified = "NotSpecified", - // (undocumented) Outer = "Outer" } // @public export enum KnownExtendedLocationType { - // (undocumented) EdgeZone = "EdgeZone" } // @public export enum KnownProviderAuthorizationConsentState { - // (undocumented) Consented = "Consented", - // (undocumented) NotRequired = "NotRequired", - // (undocumented) NotSpecified = "NotSpecified", - // (undocumented) Required = "Required" } // @public export enum KnownProvisioningState { - // (undocumented) Accepted = "Accepted", - // (undocumented) Canceled = "Canceled", - // (undocumented) Created = "Created", - // (undocumented) Creating = "Creating", - // (undocumented) Deleted = "Deleted", - // (undocumented) Deleting = "Deleting", - // (undocumented) Failed = "Failed", - // (undocumented) NotSpecified = "NotSpecified", - // (undocumented) Ready = "Ready", - // (undocumented) Running = "Running", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Updating = "Updating" } diff --git a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtManagementGroupScopeSample.ts b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtManagementGroupScopeSample.ts index 11ae8b873957..4f37f74a4337 100644 --- a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtManagementGroupScopeSample.ts +++ b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtManagementGroupScopeSample.ts @@ -26,7 +26,11 @@ async function predictTemplateChangesAtManagementGroupScope() { const deploymentName = "exampleDeploymentName"; const parameters: ScopedDeploymentWhatIf = { location: "eastus", - properties: { mode: "Incremental", parameters: {}, templateLink: {} } + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } }; const credential = new DefaultAzureCredential(); const client = new ResourceManagementClient(credential, subscriptionId); diff --git a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtSubscriptionScopeSample.ts b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtSubscriptionScopeSample.ts index 7b4e19af94a4..22d6e8d2f3cc 100644 --- a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtSubscriptionScopeSample.ts +++ b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtSubscriptionScopeSample.ts @@ -25,7 +25,11 @@ async function predictTemplateChangesAtSubscriptionScope() { const deploymentName = "my-deployment"; const parameters: DeploymentWhatIf = { location: "westus", - properties: { mode: "Incremental", parameters: {}, templateLink: {} } + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } }; const credential = new DefaultAzureCredential(); const client = new ResourceManagementClient(credential, subscriptionId); diff --git a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtTenantScopeSample.ts index e6dfcf7c6aab..5bb4d672f84c 100644 --- a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtTenantScopeSample.ts +++ b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtTenantScopeSample.ts @@ -25,7 +25,11 @@ async function predictTemplateChangesAtManagementGroupScope() { const deploymentName = "exampleDeploymentName"; const parameters: ScopedDeploymentWhatIf = { location: "eastus", - properties: { mode: "Incremental", parameters: {}, templateLink: {} } + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } }; const credential = new DefaultAzureCredential(); const client = new ResourceManagementClient(credential, subscriptionId); diff --git a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfSample.ts b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfSample.ts index 65bfa94d74da..0a5912a0f50a 100644 --- a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfSample.ts +++ b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfSample.ts @@ -25,7 +25,11 @@ async function predictTemplateChangesAtResourceGroupScope() { const resourceGroupName = "my-resource-group"; const deploymentName = "my-deployment"; const parameters: DeploymentWhatIf = { - properties: { mode: "Incremental", parameters: {}, templateLink: {} } + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } }; const credential = new DefaultAzureCredential(); const client = new ResourceManagementClient(credential, subscriptionId); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/README.md b/sdk/resources/arm-resources/samples/v5/javascript/README.md deleted file mode 100644 index ba83e0f22a73..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [deploymentsCalculateTemplateHashSample.js][deploymentscalculatetemplatehashsample] | Calculate the hash of the given template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json | -| [deploymentsCreateOrUpdateAtManagementGroupScopeSample.js][deploymentscreateorupdateatmanagementgroupscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json | -| [deploymentsCreateOrUpdateAtScopeSample.js][deploymentscreateorupdateatscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json | -| [deploymentsCreateOrUpdateAtSubscriptionScopeSample.js][deploymentscreateorupdateatsubscriptionscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json | -| [deploymentsCreateOrUpdateAtTenantScopeSample.js][deploymentscreateorupdateattenantscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json | -| [deploymentsCreateOrUpdateSample.js][deploymentscreateorupdatesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json | -| [deploymentsWhatIfAtManagementGroupScopeSample.js][deploymentswhatifatmanagementgroupscopesample] | Returns changes that will be made by the deployment if executed at the scope of the management group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json | -| [deploymentsWhatIfAtSubscriptionScopeSample.js][deploymentswhatifatsubscriptionscopesample] | Returns changes that will be made by the deployment if executed at the scope of the subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json | -| [deploymentsWhatIfAtTenantScopeSample.js][deploymentswhatifattenantscopesample] | Returns changes that will be made by the deployment if executed at the scope of the tenant group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json | -| [deploymentsWhatIfSample.js][deploymentswhatifsample] | Returns changes that will be made by the deployment if executed at the scope of the resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json | -| [providerResourceTypesListSample.js][providerresourcetypeslistsample] | List the resource types for a specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json | -| [providersGetAtTenantScopeSample.js][providersgetattenantscopesample] | Gets the specified resource provider at the tenant level. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json | -| [providersGetSample.js][providersgetsample] | Gets the specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json | -| [providersListSample.js][providerslistsample] | Gets all resource providers for a subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json | -| [providersProviderPermissionsSample.js][providersproviderpermissionssample] | Get the provider permissions. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json | -| [resourceGroupsCreateOrUpdateSample.js][resourcegroupscreateorupdatesample] | Creates or updates a resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json | -| [resourceGroupsDeleteSample.js][resourcegroupsdeletesample] | When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json | -| [resourceGroupsExportTemplateSample.js][resourcegroupsexporttemplatesample] | Captures the specified resource group as a template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json | -| [tagsCreateOrUpdateAtScopeSample.js][tagscreateorupdateatscopesample] | This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json | -| [tagsGetAtScopeSample.js][tagsgetatscopesample] | Gets the entire set of tags on a resource or subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node deploymentsCalculateTemplateHashSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node deploymentsCalculateTemplateHashSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[deploymentscalculatetemplatehashsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js -[deploymentscreateorupdateatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js -[deploymentscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js -[deploymentscreateorupdateatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js -[deploymentscreateorupdateattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js -[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js -[deploymentswhatifatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js -[deploymentswhatifatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js -[deploymentswhatifattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js -[deploymentswhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js -[providerresourcetypeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js -[providersgetattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js -[providersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js -[providerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js -[providersproviderpermissionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js -[resourcegroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js -[resourcegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js -[resourcegroupsexporttemplatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js -[tagscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js -[tagsgetatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources/README.md diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js deleted file mode 100644 index 85a819234b88..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Calculate the hash of the given template. - * - * @summary Calculate the hash of the given template. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json - */ -async function calculateTemplateHash() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const template = { - $schema: - "http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview", - contentVersion: "1.0.0.0", - outputs: { string: { type: "string", value: "myvalue" } }, - parameters: { string: { type: "string" } }, - resources: [], - variables: { - array: [1, 2, 3, 4], - bool: true, - int: 42, - object: { object: { location: "West US", vmSize: "Large" } }, - string: "string", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.calculateTemplateHash(template); - console.log(result); -} - -calculateTemplateHash().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js deleted file mode 100644 index c20ce8677c71..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json - */ -async function createDeploymentAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const groupId = "my-management-group-id"; - const deploymentName = "my-deployment"; - const parameters = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtManagementGroupScopeAndWait( - groupId, - deploymentName, - parameters - ); - console.log(result); -} - -createDeploymentAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js deleted file mode 100644 index cc4c06703491..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json - */ -async function createDeploymentAtAGivenScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = "providers/Microsoft.Management/managementGroups/my-management-group-id"; - const deploymentName = "my-deployment"; - const parameters = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtScopeAndWait( - scope, - deploymentName, - parameters - ); - console.log(result); -} - -createDeploymentAtAGivenScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js deleted file mode 100644 index e631da187b4c..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json - */ -async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const deploymentName = "my-deployment"; - const parameters = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { - id: "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtSubscriptionScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js deleted file mode 100644 index 379ee8a5553c..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json - */ -async function createDeploymentAtTenantScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const deploymentName = "tenant-dep01"; - const parameters = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtTenantScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -createDeploymentAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js deleted file mode 100644 index d9e19783fefb..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json - */ -async function createADeploymentThatWillDeployATemplateWithAUriAndQueryString() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters = { - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { - queryString: - "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d", - uri: "https://example.com/exampleTemplate.json", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillDeployATemplateWithAUriAndQueryString().catch(console.error); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json - */ -async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters = { - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { - id: "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch(console.error); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json - */ -async function createADeploymentThatWillRedeployAnotherDeploymentOnFailure() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters = { - properties: { - mode: "Complete", - onErrorDeployment: { - type: "SpecificDeployment", - deploymentName: "name-of-deployment-to-use", - }, - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillRedeployAnotherDeploymentOnFailure().catch(console.error); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json - */ -async function createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters = { - properties: { - mode: "Complete", - onErrorDeployment: { type: "LastSuccessful" }, - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js deleted file mode 100644 index 3c34db0d3932..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the management group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json - */ -async function predictTemplateChangesAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const groupId = "myManagementGruop"; - const deploymentName = "exampleDeploymentName"; - const parameters = { - location: "eastus", - properties: { mode: "Incremental", parameters: {}, templateLink: {} }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAtManagementGroupScopeAndWait( - groupId, - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js deleted file mode 100644 index 2359c33b209b..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json - */ -async function predictTemplateChangesAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const deploymentName = "my-deployment"; - const parameters = { - location: "westus", - properties: { mode: "Incremental", parameters: {}, templateLink: {} }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAtSubscriptionScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtSubscriptionScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js deleted file mode 100644 index 11d40683b268..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json - */ -async function predictTemplateChangesAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const deploymentName = "exampleDeploymentName"; - const parameters = { - location: "eastus", - properties: { mode: "Incremental", parameters: {}, templateLink: {} }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAtTenantScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js deleted file mode 100644 index e5f9473f19a3..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the resource group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json - */ -async function predictTemplateChangesAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters = { - properties: { mode: "Incremental", parameters: {}, templateLink: {} }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtResourceGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/package.json b/sdk/resources/arm-resources/samples/v5/javascript/package.json deleted file mode 100644 index 12f9056be514..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-resources-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=14.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/resources/arm-resources" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", - "dependencies": { - "@azure/arm-resources": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js deleted file mode 100644 index fb97a3cdcf2c..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to List the resource types for a specified resource provider. - * - * @summary List the resource types for a specified resource provider. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json - */ -async function getProviderResourceTypes() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceProviderNamespace = "Microsoft.TestRP"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providerResourceTypes.list(resourceProviderNamespace); - console.log(result); -} - -getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js deleted file mode 100644 index 445e2a249eba..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets the specified resource provider at the tenant level. - * - * @summary Gets the specified resource provider at the tenant level. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json - */ -async function getAResourceProviderAtTenantScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const expand = "resourceTypes/aliases"; - const resourceProviderNamespace = "Microsoft.Storage"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providers.getAtTenantScope(resourceProviderNamespace, options); - console.log(result); -} - -getAResourceProviderAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js deleted file mode 100644 index b6fe20b65918..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets the specified resource provider. - * - * @summary Gets the specified resource provider. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json - */ -async function getProvider() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceProviderNamespace = "Microsoft.TestRP1"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providers.get(resourceProviderNamespace); - console.log(result); -} - -getProvider().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js deleted file mode 100644 index ccc70914ee6e..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets all resource providers for a subscription. - * - * @summary Gets all resource providers for a subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json - */ -async function getProviders() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.providers.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getProviders().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js deleted file mode 100644 index 59829087b401..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the provider permissions. - * - * @summary Get the provider permissions. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json - */ -async function getProviderResourceTypes() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceProviderNamespace = "Microsoft.TestRP"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providers.providerPermissions(resourceProviderNamespace); - console.log(result); -} - -getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js deleted file mode 100644 index 92cd414ad069..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Creates or updates a resource group. - * - * @summary Creates or updates a resource group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json - */ -async function createOrUpdateAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const parameters = { location: "eastus" }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.createOrUpdate(resourceGroupName, parameters); - console.log(result); -} - -createOrUpdateAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js deleted file mode 100644 index e9bc48901916..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * - * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json - */ -async function forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const forceDeletionTypes = - "Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets"; - const options = { forceDeletionTypes }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginDeleteAndWait(resourceGroupName, options); - console.log(result); -} - -forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup().catch(console.error); - -/** - * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * - * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsInResourceGroup.json - */ -async function forceDeleteAllTheVirtualMachinesInAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const forceDeletionTypes = "Microsoft.Compute/virtualMachines"; - const options = { forceDeletionTypes }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginDeleteAndWait(resourceGroupName, options); - console.log(result); -} - -forceDeleteAllTheVirtualMachinesInAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js deleted file mode 100644 index 804fc2096199..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Captures the specified resource group as a template. - * - * @summary Captures the specified resource group as a template. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json - */ -async function exportAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const parameters = { - options: "IncludeParameterDefaultValue,IncludeComments", - resources: ["*"], - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginExportTemplateAndWait( - resourceGroupName, - parameters - ); - console.log(result); -} - -exportAResourceGroup().catch(console.error); - -/** - * This sample demonstrates how to Captures the specified resource group as a template. - * - * @summary Captures the specified resource group as a template. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroupWithFiltering.json - */ -async function exportAResourceGroupWithFiltering() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const parameters = { - options: "SkipResourceNameParameterization", - resources: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/My.RP/myResourceType/myFirstResource", - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginExportTemplateAndWait( - resourceGroupName, - parameters - ); - console.log(result); -} - -exportAResourceGroupWithFiltering().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/sample.env b/sdk/resources/arm-resources/samples/v5/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js deleted file mode 100644 index b870cdb54584..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * - * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json - */ -async function updateTagsOnAResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = - "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; - const parameters = { - properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.createOrUpdateAtScope(scope, parameters); - console.log(result); -} - -updateTagsOnAResource().catch(console.error); - -/** - * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * - * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsSubscription.json - */ -async function updateTagsOnASubscription() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; - const parameters = { - properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.createOrUpdateAtScope(scope, parameters); - console.log(result); -} - -updateTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js deleted file mode 100644 index c878c2c92d51..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. - * - * @summary Gets the entire set of tags on a resource or subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json - */ -async function getTagsOnAResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = - "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.getAtScope(scope); - console.log(result); -} - -getTagsOnAResource().catch(console.error); - -/** - * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. - * - * @summary Gets the entire set of tags on a resource or subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsSubscription.json - */ -async function getTagsOnASubscription() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.getAtScope(scope); - console.log(result); -} - -getTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/README.md b/sdk/resources/arm-resources/samples/v5/typescript/README.md deleted file mode 100644 index 9e633d641bf9..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/README.md +++ /dev/null @@ -1,101 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [deploymentsCalculateTemplateHashSample.ts][deploymentscalculatetemplatehashsample] | Calculate the hash of the given template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json | -| [deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts][deploymentscreateorupdateatmanagementgroupscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json | -| [deploymentsCreateOrUpdateAtScopeSample.ts][deploymentscreateorupdateatscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json | -| [deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts][deploymentscreateorupdateatsubscriptionscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json | -| [deploymentsCreateOrUpdateAtTenantScopeSample.ts][deploymentscreateorupdateattenantscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json | -| [deploymentsCreateOrUpdateSample.ts][deploymentscreateorupdatesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json | -| [deploymentsWhatIfAtManagementGroupScopeSample.ts][deploymentswhatifatmanagementgroupscopesample] | Returns changes that will be made by the deployment if executed at the scope of the management group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json | -| [deploymentsWhatIfAtSubscriptionScopeSample.ts][deploymentswhatifatsubscriptionscopesample] | Returns changes that will be made by the deployment if executed at the scope of the subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json | -| [deploymentsWhatIfAtTenantScopeSample.ts][deploymentswhatifattenantscopesample] | Returns changes that will be made by the deployment if executed at the scope of the tenant group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json | -| [deploymentsWhatIfSample.ts][deploymentswhatifsample] | Returns changes that will be made by the deployment if executed at the scope of the resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json | -| [providerResourceTypesListSample.ts][providerresourcetypeslistsample] | List the resource types for a specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json | -| [providersGetAtTenantScopeSample.ts][providersgetattenantscopesample] | Gets the specified resource provider at the tenant level. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json | -| [providersGetSample.ts][providersgetsample] | Gets the specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json | -| [providersListSample.ts][providerslistsample] | Gets all resource providers for a subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json | -| [providersProviderPermissionsSample.ts][providersproviderpermissionssample] | Get the provider permissions. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json | -| [resourceGroupsCreateOrUpdateSample.ts][resourcegroupscreateorupdatesample] | Creates or updates a resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json | -| [resourceGroupsDeleteSample.ts][resourcegroupsdeletesample] | When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json | -| [resourceGroupsExportTemplateSample.ts][resourcegroupsexporttemplatesample] | Captures the specified resource group as a template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json | -| [tagsCreateOrUpdateAtScopeSample.ts][tagscreateorupdateatscopesample] | This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json | -| [tagsGetAtScopeSample.ts][tagsgetatscopesample] | Gets the entire set of tags on a resource or subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/deploymentsCalculateTemplateHashSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node dist/deploymentsCalculateTemplateHashSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[deploymentscalculatetemplatehashsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts -[deploymentscreateorupdateatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts -[deploymentscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts -[deploymentscreateorupdateatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts -[deploymentscreateorupdateattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts -[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts -[deploymentswhatifatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts -[deploymentswhatifatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts -[deploymentswhatifattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts -[deploymentswhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts -[providerresourcetypeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts -[providersgetattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts -[providersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts -[providerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts -[providersproviderpermissionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts -[resourcegroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts -[resourcegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts -[resourcegroupsexporttemplatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts -[tagscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts -[tagsgetatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/resources/arm-resources/samples/v5/typescript/package.json b/sdk/resources/arm-resources/samples/v5/typescript/package.json deleted file mode 100644 index f071736cbcfe..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-resources-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=14.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/resources/arm-resources" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", - "dependencies": { - "@azure/arm-resources": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^14.0.0", - "typescript": "~4.4.0", - "rimraf": "latest" - } -} diff --git a/sdk/resources/arm-resources/samples/v5/typescript/sample.env b/sdk/resources/arm-resources/samples/v5/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts deleted file mode 100644 index ef98d9c46a68..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Calculate the hash of the given template. - * - * @summary Calculate the hash of the given template. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json - */ -async function calculateTemplateHash() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const template: Record = { - $schema: - "http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview", - contentVersion: "1.0.0.0", - outputs: { string: { type: "string", value: "myvalue" } }, - parameters: { string: { type: "string" } }, - resources: [], - variables: { - array: [1, 2, 3, 4], - bool: true, - int: 42, - object: { object: { location: "West US", vmSize: "Large" } }, - string: "string" - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.calculateTemplateHash(template); - console.log(result); -} - -calculateTemplateHash().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts deleted file mode 100644 index 67139e55ae43..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ScopedDeployment, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json - */ -async function createDeploymentAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const groupId = "my-management-group-id"; - const deploymentName = "my-deployment"; - const parameters: ScopedDeployment = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtManagementGroupScopeAndWait( - groupId, - deploymentName, - parameters - ); - console.log(result); -} - -createDeploymentAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts deleted file mode 100644 index b0efcc3ad039..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Deployment, ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json - */ -async function createDeploymentAtAGivenScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = - "providers/Microsoft.Management/managementGroups/my-management-group-id"; - const deploymentName = "my-deployment"; - const parameters: Deployment = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - }, - tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtScopeAndWait( - scope, - deploymentName, - parameters - ); - console.log(result); -} - -createDeploymentAtAGivenScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts deleted file mode 100644 index 2c7ba97b349c..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Deployment, ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json - */ -async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const deploymentName = "my-deployment"; - const parameters: Deployment = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { - id: - "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1" - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtSubscriptionScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch( - console.error -); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts deleted file mode 100644 index 2a7a2b607b1b..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ScopedDeployment, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json - */ -async function createDeploymentAtTenantScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const deploymentName = "tenant-dep01"; - const parameters: ScopedDeployment = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - }, - tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtTenantScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -createDeploymentAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts deleted file mode 100644 index fa6712c0b5cb..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Deployment, ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json - */ -async function createADeploymentThatWillDeployATemplateWithAUriAndQueryString() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters: Deployment = { - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { - queryString: - "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d", - uri: "https://example.com/exampleTemplate.json" - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillDeployATemplateWithAUriAndQueryString().catch( - console.error -); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json - */ -async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters: Deployment = { - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { - id: - "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1" - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch( - console.error -); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json - */ -async function createADeploymentThatWillRedeployAnotherDeploymentOnFailure() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters: Deployment = { - properties: { - mode: "Complete", - onErrorDeployment: { - type: "SpecificDeployment", - deploymentName: "name-of-deployment-to-use" - }, - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillRedeployAnotherDeploymentOnFailure().catch( - console.error -); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json - */ -async function createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters: Deployment = { - properties: { - mode: "Complete", - onErrorDeployment: { type: "LastSuccessful" }, - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure().catch( - console.error -); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts deleted file mode 100644 index 11ae8b873957..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ScopedDeploymentWhatIf, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the management group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json - */ -async function predictTemplateChangesAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const groupId = "myManagementGruop"; - const deploymentName = "exampleDeploymentName"; - const parameters: ScopedDeploymentWhatIf = { - location: "eastus", - properties: { mode: "Incremental", parameters: {}, templateLink: {} } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAtManagementGroupScopeAndWait( - groupId, - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts deleted file mode 100644 index 7b4e19af94a4..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DeploymentWhatIf, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json - */ -async function predictTemplateChangesAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const deploymentName = "my-deployment"; - const parameters: DeploymentWhatIf = { - location: "westus", - properties: { mode: "Incremental", parameters: {}, templateLink: {} } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAtSubscriptionScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtSubscriptionScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts deleted file mode 100644 index e6dfcf7c6aab..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ScopedDeploymentWhatIf, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json - */ -async function predictTemplateChangesAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const deploymentName = "exampleDeploymentName"; - const parameters: ScopedDeploymentWhatIf = { - location: "eastus", - properties: { mode: "Incremental", parameters: {}, templateLink: {} } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAtTenantScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts deleted file mode 100644 index 65bfa94d74da..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DeploymentWhatIf, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the resource group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json - */ -async function predictTemplateChangesAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters: DeploymentWhatIf = { - properties: { mode: "Incremental", parameters: {}, templateLink: {} } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtResourceGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts deleted file mode 100644 index b090f7f94330..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List the resource types for a specified resource provider. - * - * @summary List the resource types for a specified resource provider. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json - */ -async function getProviderResourceTypes() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceProviderNamespace = "Microsoft.TestRP"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providerResourceTypes.list( - resourceProviderNamespace - ); - console.log(result); -} - -getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts deleted file mode 100644 index e15e706b5352..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ProvidersGetAtTenantScopeOptionalParams, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the specified resource provider at the tenant level. - * - * @summary Gets the specified resource provider at the tenant level. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json - */ -async function getAResourceProviderAtTenantScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const expand = "resourceTypes/aliases"; - const resourceProviderNamespace = "Microsoft.Storage"; - const options: ProvidersGetAtTenantScopeOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providers.getAtTenantScope( - resourceProviderNamespace, - options - ); - console.log(result); -} - -getAResourceProviderAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts deleted file mode 100644 index bc749dab5de5..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the specified resource provider. - * - * @summary Gets the specified resource provider. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json - */ -async function getProvider() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceProviderNamespace = "Microsoft.TestRP1"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providers.get(resourceProviderNamespace); - console.log(result); -} - -getProvider().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts deleted file mode 100644 index bcd76e00734a..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets all resource providers for a subscription. - * - * @summary Gets all resource providers for a subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json - */ -async function getProviders() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.providers.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getProviders().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts deleted file mode 100644 index 819377488db7..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the provider permissions. - * - * @summary Get the provider permissions. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json - */ -async function getProviderResourceTypes() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceProviderNamespace = "Microsoft.TestRP"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providers.providerPermissions( - resourceProviderNamespace - ); - console.log(result); -} - -getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts deleted file mode 100644 index 05d744c91c8a..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceGroup, ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates a resource group. - * - * @summary Creates or updates a resource group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json - */ -async function createOrUpdateAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const parameters: ResourceGroup = { location: "eastus" }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.createOrUpdate( - resourceGroupName, - parameters - ); - console.log(result); -} - -createOrUpdateAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts deleted file mode 100644 index b01fb3eebf0c..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ResourceGroupsDeleteOptionalParams, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * - * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json - */ -async function forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const forceDeletionTypes = - "Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets"; - const options: ResourceGroupsDeleteOptionalParams = { forceDeletionTypes }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginDeleteAndWait( - resourceGroupName, - options - ); - console.log(result); -} - -forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup().catch( - console.error -); - -/** - * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * - * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsInResourceGroup.json - */ -async function forceDeleteAllTheVirtualMachinesInAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const forceDeletionTypes = "Microsoft.Compute/virtualMachines"; - const options: ResourceGroupsDeleteOptionalParams = { forceDeletionTypes }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginDeleteAndWait( - resourceGroupName, - options - ); - console.log(result); -} - -forceDeleteAllTheVirtualMachinesInAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts deleted file mode 100644 index 9775c5733f95..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ExportTemplateRequest, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Captures the specified resource group as a template. - * - * @summary Captures the specified resource group as a template. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json - */ -async function exportAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const parameters: ExportTemplateRequest = { - options: "IncludeParameterDefaultValue,IncludeComments", - resources: ["*"] - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginExportTemplateAndWait( - resourceGroupName, - parameters - ); - console.log(result); -} - -exportAResourceGroup().catch(console.error); - -/** - * This sample demonstrates how to Captures the specified resource group as a template. - * - * @summary Captures the specified resource group as a template. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroupWithFiltering.json - */ -async function exportAResourceGroupWithFiltering() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const parameters: ExportTemplateRequest = { - options: "SkipResourceNameParameterization", - resources: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/My.RP/myResourceType/myFirstResource" - ] - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginExportTemplateAndWait( - resourceGroupName, - parameters - ); - console.log(result); -} - -exportAResourceGroupWithFiltering().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts deleted file mode 100644 index ad99eea1a194..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { TagsResource, ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * - * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json - */ -async function updateTagsOnAResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = - "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; - const parameters: TagsResource = { - properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.createOrUpdateAtScope( - scope, - parameters - ); - console.log(result); -} - -updateTagsOnAResource().catch(console.error); - -/** - * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * - * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsSubscription.json - */ -async function updateTagsOnASubscription() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; - const parameters: TagsResource = { - properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.createOrUpdateAtScope( - scope, - parameters - ); - console.log(result); -} - -updateTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts deleted file mode 100644 index d43b397344ee..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. - * - * @summary Gets the entire set of tags on a resource or subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json - */ -async function getTagsOnAResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = - "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.getAtScope(scope); - console.log(result); -} - -getTagsOnAResource().catch(console.error); - -/** - * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. - * - * @summary Gets the entire set of tags on a resource or subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsSubscription.json - */ -async function getTagsOnASubscription() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.getAtScope(scope); - console.log(result); -} - -getTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json b/sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json deleted file mode 100644 index 416c2dd82e00..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2018", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/resources/arm-resources/src/index.ts b/sdk/resources/arm-resources/src/index.ts index 3af4903c75a2..bc3b6b9ec381 100644 --- a/sdk/resources/arm-resources/src/index.ts +++ b/sdk/resources/arm-resources/src/index.ts @@ -7,6 +7,7 @@ */ /// +export { getContinuationToken } from "./pagingHelper"; export * from "./models"; export { ResourceManagementClient } from "./resourceManagementClient"; export * from "./operationsInterfaces"; diff --git a/sdk/resources/arm-resources/src/models/index.ts b/sdk/resources/arm-resources/src/models/index.ts index 44691a0363b9..4a07f4157e22 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -1071,13 +1071,13 @@ export interface SubResource { } /** Deployment What-if properties. */ -export type DeploymentWhatIfProperties = DeploymentProperties & { +export interface DeploymentWhatIfProperties extends DeploymentProperties { /** Optional What-If operation settings. */ whatIfSettings?: DeploymentWhatIfSettings; -}; +} /** Resource information. */ -export type GenericResource = Resource & { +export interface GenericResource extends Resource { /** The plan of the resource. */ plan?: Plan; /** The resource properties. */ @@ -1090,10 +1090,10 @@ export type GenericResource = Resource & { sku?: Sku; /** The identity of the resource. */ identity?: Identity; -}; +} /** Resource information. */ -export type GenericResourceExpanded = GenericResource & { +export interface GenericResourceExpanded extends GenericResource { /** * The created time of the resource. This is only present if requested via the $expand query parameter. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1109,7 +1109,7 @@ export type GenericResourceExpanded = GenericResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; -}; +} /** Defines headers for Deployments_whatIfAtTenantScope operation. */ export interface DeploymentsWhatIfAtTenantScopeHeaders { @@ -1145,8 +1145,11 @@ export interface DeploymentsWhatIfHeaders { /** Known values of {@link ExpressionEvaluationOptionsScopeType} that the service accepts. */ export enum KnownExpressionEvaluationOptionsScopeType { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** Outer */ Outer = "Outer", + /** Inner */ Inner = "Inner" } @@ -1163,17 +1166,29 @@ export type ExpressionEvaluationOptionsScopeType = string; /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** Accepted */ Accepted = "Accepted", + /** Running */ Running = "Running", + /** Ready */ Ready = "Ready", + /** Creating */ Creating = "Creating", + /** Created */ Created = "Created", + /** Deleting */ Deleting = "Deleting", + /** Deleted */ Deleted = "Deleted", + /** Canceled */ Canceled = "Canceled", + /** Failed */ Failed = "Failed", + /** Succeeded */ Succeeded = "Succeeded", + /** Updating */ Updating = "Updating" } @@ -1253,9 +1268,13 @@ export type AliasPathAttributes = string; /** Known values of {@link ProviderAuthorizationConsentState} that the service accepts. */ export enum KnownProviderAuthorizationConsentState { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** Required */ Required = "Required", + /** NotRequired */ NotRequired = "NotRequired", + /** Consented */ Consented = "Consented" } @@ -1273,6 +1292,7 @@ export type ProviderAuthorizationConsentState = string; /** Known values of {@link ExtendedLocationType} that the service accepts. */ export enum KnownExtendedLocationType { + /** EdgeZone */ EdgeZone = "EdgeZone" } @@ -1974,7 +1994,7 @@ export interface ResourcesListOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the operation.

Filter comparison operators include `eq` (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, `plan/version`, and `plan/promotionCode`.

For example, to filter by a resource type, use `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`


`substringof(value, property)` can be used to filter for substrings of the following currently-supported properties: `name` and `resourceGroup`

For example, to get all resources with 'demo' anywhere in the resource name, use `$filter=substringof('demo', name)`

Multiple substring operations can also be combined using `and`/`or` operators.

Note that any truncated number of results queried via `$top` may also not be compatible when using a filter.


Resources can be filtered by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, the original tags for each resource will not be returned in the results. Any list of additional properties queried via `$expand` may also not be compatible when filtering by tag names/values.

For tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, `departureTime`, etc.)


Note that some properties can be combined when filtering resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. */ filter?: string; - /** The number of results to return. If null is passed, returns all resources. */ + /** The number of recommendations per page if a paged version of this API is being used. */ top?: number; /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ expand?: string; @@ -2100,7 +2120,7 @@ export interface ResourcesListNextOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the operation.

Filter comparison operators include `eq` (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, `plan/version`, and `plan/promotionCode`.

For example, to filter by a resource type, use `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`


`substringof(value, property)` can be used to filter for substrings of the following currently-supported properties: `name` and `resourceGroup`

For example, to get all resources with 'demo' anywhere in the resource name, use `$filter=substringof('demo', name)`

Multiple substring operations can also be combined using `and`/`or` operators.

Note that any truncated number of results queried via `$top` may also not be compatible when using a filter.


Resources can be filtered by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, the original tags for each resource will not be returned in the results. Any list of additional properties queried via `$expand` may also not be compatible when filtering by tag names/values.

For tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, `departureTime`, etc.)


Note that some properties can be combined when filtering resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. */ filter?: string; - /** The number of results to return. If null is passed, returns all resources. */ + /** The number of recommendations per page if a paged version of this API is being used. */ top?: number; /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ expand?: string; diff --git a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts index 705dbf7ffd1c..d4ec260b2c0c 100644 --- a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts +++ b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { DeploymentOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,29 +17,29 @@ import { DeploymentOperation, DeploymentOperationsListAtScopeNextOptionalParams, DeploymentOperationsListAtScopeOptionalParams, + DeploymentOperationsListAtScopeResponse, DeploymentOperationsListAtTenantScopeNextOptionalParams, DeploymentOperationsListAtTenantScopeOptionalParams, + DeploymentOperationsListAtTenantScopeResponse, DeploymentOperationsListAtManagementGroupScopeNextOptionalParams, DeploymentOperationsListAtManagementGroupScopeOptionalParams, + DeploymentOperationsListAtManagementGroupScopeResponse, DeploymentOperationsListAtSubscriptionScopeNextOptionalParams, DeploymentOperationsListAtSubscriptionScopeOptionalParams, + DeploymentOperationsListAtSubscriptionScopeResponse, DeploymentOperationsListNextOptionalParams, DeploymentOperationsListOptionalParams, + DeploymentOperationsListResponse, DeploymentOperationsGetAtScopeOptionalParams, DeploymentOperationsGetAtScopeResponse, - DeploymentOperationsListAtScopeResponse, DeploymentOperationsGetAtTenantScopeOptionalParams, DeploymentOperationsGetAtTenantScopeResponse, - DeploymentOperationsListAtTenantScopeResponse, DeploymentOperationsGetAtManagementGroupScopeOptionalParams, DeploymentOperationsGetAtManagementGroupScopeResponse, - DeploymentOperationsListAtManagementGroupScopeResponse, DeploymentOperationsGetAtSubscriptionScopeOptionalParams, DeploymentOperationsGetAtSubscriptionScopeResponse, - DeploymentOperationsListAtSubscriptionScopeResponse, DeploymentOperationsGetOptionalParams, DeploymentOperationsGetResponse, - DeploymentOperationsListResponse, DeploymentOperationsListAtScopeNextResponse, DeploymentOperationsListAtTenantScopeNextResponse, DeploymentOperationsListAtManagementGroupScopeNextResponse, @@ -78,8 +79,16 @@ export class DeploymentOperationsImpl implements DeploymentOperations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listAtScopePagingPage(scope, deploymentName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAtScopePagingPage( + scope, + deploymentName, + options, + settings + ); } }; } @@ -87,11 +96,18 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private async *listAtScopePagingPage( scope: string, deploymentName: string, - options?: DeploymentOperationsListAtScopeOptionalParams + options?: DeploymentOperationsListAtScopeOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAtScope(scope, deploymentName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DeploymentOperationsListAtScopeResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAtScope(scope, deploymentName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAtScopeNext( scope, @@ -100,7 +116,9 @@ export class DeploymentOperationsImpl implements DeploymentOperations { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -135,19 +153,33 @@ export class DeploymentOperationsImpl implements DeploymentOperations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listAtTenantScopePagingPage(deploymentName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAtTenantScopePagingPage( + deploymentName, + options, + settings + ); } }; } private async *listAtTenantScopePagingPage( deploymentName: string, - options?: DeploymentOperationsListAtTenantScopeOptionalParams + options?: DeploymentOperationsListAtTenantScopeOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAtTenantScope(deploymentName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DeploymentOperationsListAtTenantScopeResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAtTenantScope(deploymentName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAtTenantScopeNext( deploymentName, @@ -155,7 +187,9 @@ export class DeploymentOperationsImpl implements DeploymentOperations { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -194,11 +228,15 @@ export class DeploymentOperationsImpl implements DeploymentOperations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listAtManagementGroupScopePagingPage( groupId, deploymentName, - options + options, + settings ); } }; @@ -207,15 +245,22 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private async *listAtManagementGroupScopePagingPage( groupId: string, deploymentName: string, - options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams + options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAtManagementGroupScope( - groupId, - deploymentName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DeploymentOperationsListAtManagementGroupScopeResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAtManagementGroupScope( + groupId, + deploymentName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAtManagementGroupScopeNext( groupId, @@ -224,7 +269,9 @@ export class DeploymentOperationsImpl implements DeploymentOperations { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -259,19 +306,33 @@ export class DeploymentOperationsImpl implements DeploymentOperations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listAtSubscriptionScopePagingPage(deploymentName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAtSubscriptionScopePagingPage( + deploymentName, + options, + settings + ); } }; } private async *listAtSubscriptionScopePagingPage( deploymentName: string, - options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams + options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAtSubscriptionScope(deploymentName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DeploymentOperationsListAtSubscriptionScopeResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAtSubscriptionScope(deploymentName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAtSubscriptionScopeNext( deploymentName, @@ -279,7 +340,9 @@ export class DeploymentOperationsImpl implements DeploymentOperations { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -314,8 +377,16 @@ export class DeploymentOperationsImpl implements DeploymentOperations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, deploymentName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + deploymentName, + options, + settings + ); } }; } @@ -323,11 +394,18 @@ export class DeploymentOperationsImpl implements DeploymentOperations { private async *listPagingPage( resourceGroupName: string, deploymentName: string, - options?: DeploymentOperationsListOptionalParams + options?: DeploymentOperationsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, deploymentName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DeploymentOperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, deploymentName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -336,7 +414,9 @@ export class DeploymentOperationsImpl implements DeploymentOperations { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } diff --git a/sdk/resources/arm-resources/src/operations/deployments.ts b/sdk/resources/arm-resources/src/operations/deployments.ts index 97634950b406..c565dfa88fc5 100644 --- a/sdk/resources/arm-resources/src/operations/deployments.ts +++ b/sdk/resources/arm-resources/src/operations/deployments.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Deployments } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,14 +19,19 @@ import { DeploymentExtended, DeploymentsListAtScopeNextOptionalParams, DeploymentsListAtScopeOptionalParams, + DeploymentsListAtScopeResponse, DeploymentsListAtTenantScopeNextOptionalParams, DeploymentsListAtTenantScopeOptionalParams, + DeploymentsListAtTenantScopeResponse, DeploymentsListAtManagementGroupScopeNextOptionalParams, DeploymentsListAtManagementGroupScopeOptionalParams, + DeploymentsListAtManagementGroupScopeResponse, DeploymentsListAtSubscriptionScopeNextOptionalParams, DeploymentsListAtSubscriptionScopeOptionalParams, + DeploymentsListAtSubscriptionScopeResponse, DeploymentsListByResourceGroupNextOptionalParams, DeploymentsListByResourceGroupOptionalParams, + DeploymentsListByResourceGroupResponse, DeploymentsDeleteAtScopeOptionalParams, DeploymentsCheckExistenceAtScopeOptionalParams, DeploymentsCheckExistenceAtScopeResponse, @@ -39,7 +45,6 @@ import { DeploymentsValidateAtScopeResponse, DeploymentsExportTemplateAtScopeOptionalParams, DeploymentsExportTemplateAtScopeResponse, - DeploymentsListAtScopeResponse, DeploymentsDeleteAtTenantScopeOptionalParams, DeploymentsCheckExistenceAtTenantScopeOptionalParams, DeploymentsCheckExistenceAtTenantScopeResponse, @@ -56,7 +61,6 @@ import { DeploymentsWhatIfAtTenantScopeResponse, DeploymentsExportTemplateAtTenantScopeOptionalParams, DeploymentsExportTemplateAtTenantScopeResponse, - DeploymentsListAtTenantScopeResponse, DeploymentsDeleteAtManagementGroupScopeOptionalParams, DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams, DeploymentsCheckExistenceAtManagementGroupScopeResponse, @@ -71,7 +75,6 @@ import { DeploymentsWhatIfAtManagementGroupScopeResponse, DeploymentsExportTemplateAtManagementGroupScopeOptionalParams, DeploymentsExportTemplateAtManagementGroupScopeResponse, - DeploymentsListAtManagementGroupScopeResponse, DeploymentsDeleteAtSubscriptionScopeOptionalParams, DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams, DeploymentsCheckExistenceAtSubscriptionScopeResponse, @@ -87,7 +90,6 @@ import { DeploymentsWhatIfAtSubscriptionScopeResponse, DeploymentsExportTemplateAtSubscriptionScopeOptionalParams, DeploymentsExportTemplateAtSubscriptionScopeResponse, - DeploymentsListAtSubscriptionScopeResponse, DeploymentsDeleteOptionalParams, DeploymentsCheckExistenceOptionalParams, DeploymentsCheckExistenceResponse, @@ -102,7 +104,6 @@ import { DeploymentsWhatIfResponse, DeploymentsExportTemplateOptionalParams, DeploymentsExportTemplateResponse, - DeploymentsListByResourceGroupResponse, DeploymentsCalculateTemplateHashOptionalParams, DeploymentsCalculateTemplateHashResponse, DeploymentsListAtScopeNextResponse, @@ -142,23 +143,35 @@ export class DeploymentsImpl implements Deployments { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listAtScopePagingPage(scope, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAtScopePagingPage(scope, options, settings); } }; } private async *listAtScopePagingPage( scope: string, - options?: DeploymentsListAtScopeOptionalParams + options?: DeploymentsListAtScopeOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAtScope(scope, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DeploymentsListAtScopeResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAtScope(scope, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAtScopeNext(scope, continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -186,22 +199,34 @@ export class DeploymentsImpl implements Deployments { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listAtTenantScopePagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAtTenantScopePagingPage(options, settings); } }; } private async *listAtTenantScopePagingPage( - options?: DeploymentsListAtTenantScopeOptionalParams + options?: DeploymentsListAtTenantScopeOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAtTenantScope(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DeploymentsListAtTenantScopeResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAtTenantScope(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAtTenantScopeNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -230,19 +255,33 @@ export class DeploymentsImpl implements Deployments { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listAtManagementGroupScopePagingPage(groupId, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAtManagementGroupScopePagingPage( + groupId, + options, + settings + ); } }; } private async *listAtManagementGroupScopePagingPage( groupId: string, - options?: DeploymentsListAtManagementGroupScopeOptionalParams + options?: DeploymentsListAtManagementGroupScopeOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAtManagementGroupScope(groupId, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DeploymentsListAtManagementGroupScopeResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAtManagementGroupScope(groupId, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAtManagementGroupScopeNext( groupId, @@ -250,7 +289,9 @@ export class DeploymentsImpl implements Deployments { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -281,25 +322,37 @@ export class DeploymentsImpl implements Deployments { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listAtSubscriptionScopePagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAtSubscriptionScopePagingPage(options, settings); } }; } private async *listAtSubscriptionScopePagingPage( - options?: DeploymentsListAtSubscriptionScopeOptionalParams + options?: DeploymentsListAtSubscriptionScopeOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAtSubscriptionScope(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DeploymentsListAtSubscriptionScopeResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAtSubscriptionScope(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAtSubscriptionScopeNext( continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -329,19 +382,33 @@ export class DeploymentsImpl implements Deployments { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: DeploymentsListByResourceGroupOptionalParams + options?: DeploymentsListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DeploymentsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -349,7 +416,9 @@ export class DeploymentsImpl implements Deployments { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } diff --git a/sdk/resources/arm-resources/src/operations/operations.ts b/sdk/resources/arm-resources/src/operations/operations.ts index 498f072ab75b..0db1686b12d3 100644 --- a/sdk/resources/arm-resources/src/operations/operations.ts +++ b/sdk/resources/arm-resources/src/operations/operations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -48,22 +49,34 @@ export class OperationsImpl implements Operations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } diff --git a/sdk/resources/arm-resources/src/operations/providers.ts b/sdk/resources/arm-resources/src/operations/providers.ts index 776ffa3404a4..2b2f57d01cb4 100644 --- a/sdk/resources/arm-resources/src/operations/providers.ts +++ b/sdk/resources/arm-resources/src/operations/providers.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Providers } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,8 +17,10 @@ import { Provider, ProvidersListNextOptionalParams, ProvidersListOptionalParams, + ProvidersListResponse, ProvidersListAtTenantScopeNextOptionalParams, ProvidersListAtTenantScopeOptionalParams, + ProvidersListAtTenantScopeResponse, ProvidersUnregisterOptionalParams, ProvidersUnregisterResponse, ProvidersRegisterAtManagementGroupScopeOptionalParams, @@ -25,8 +28,6 @@ import { ProvidersProviderPermissionsResponse, ProvidersRegisterOptionalParams, ProvidersRegisterResponse, - ProvidersListResponse, - ProvidersListAtTenantScopeResponse, ProvidersGetOptionalParams, ProvidersGetResponse, ProvidersGetAtTenantScopeOptionalParams, @@ -63,22 +64,34 @@ export class ProvidersImpl implements Providers { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: ProvidersListOptionalParams + options?: ProvidersListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ProvidersListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -105,22 +118,34 @@ export class ProvidersImpl implements Providers { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listAtTenantScopePagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAtTenantScopePagingPage(options, settings); } }; } private async *listAtTenantScopePagingPage( - options?: ProvidersListAtTenantScopeOptionalParams + options?: ProvidersListAtTenantScopeOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAtTenantScope(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ProvidersListAtTenantScopeResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAtTenantScope(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAtTenantScopeNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -148,7 +173,10 @@ export class ProvidersImpl implements Providers { } /** - * Registers a management group with a resource provider. + * Registers a management group with a resource provider. Use this operation to register a resource + * provider with resource types that can be deployed at the management group scope. It does not + * recursively register subscriptions within the management group. Instead, you must register + * subscriptions individually. * @param resourceProviderNamespace The namespace of the resource provider to register. * @param groupId The management group ID. * @param options The options parameters. diff --git a/sdk/resources/arm-resources/src/operations/resourceGroups.ts b/sdk/resources/arm-resources/src/operations/resourceGroups.ts index 8a07b3adfc70..c03e1d93a4ea 100644 --- a/sdk/resources/arm-resources/src/operations/resourceGroups.ts +++ b/sdk/resources/arm-resources/src/operations/resourceGroups.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ResourceGroups } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { ResourceGroup, ResourceGroupsListNextOptionalParams, ResourceGroupsListOptionalParams, + ResourceGroupsListResponse, ResourceGroupsCheckExistenceOptionalParams, ResourceGroupsCheckExistenceResponse, ResourceGroupsCreateOrUpdateOptionalParams, @@ -31,7 +33,6 @@ import { ExportTemplateRequest, ResourceGroupsExportTemplateOptionalParams, ResourceGroupsExportTemplateResponse, - ResourceGroupsListResponse, ResourceGroupsListNextResponse } from "../models"; @@ -63,22 +64,34 @@ export class ResourceGroupsImpl implements ResourceGroups { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: ResourceGroupsListOptionalParams + options?: ResourceGroupsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ResourceGroupsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } diff --git a/sdk/resources/arm-resources/src/operations/resources.ts b/sdk/resources/arm-resources/src/operations/resources.ts index 780c455e8515..239c148d1fdd 100644 --- a/sdk/resources/arm-resources/src/operations/resources.ts +++ b/sdk/resources/arm-resources/src/operations/resources.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Resources } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,13 +19,13 @@ import { GenericResourceExpanded, ResourcesListByResourceGroupNextOptionalParams, ResourcesListByResourceGroupOptionalParams, + ResourcesListByResourceGroupResponse, ResourcesListNextOptionalParams, ResourcesListOptionalParams, - ResourcesListByResourceGroupResponse, + ResourcesListResponse, ResourcesMoveInfo, ResourcesMoveResourcesOptionalParams, ResourcesValidateMoveResourcesOptionalParams, - ResourcesListResponse, ResourcesCheckExistenceOptionalParams, ResourcesCheckExistenceResponse, ResourcesDeleteOptionalParams, @@ -78,19 +79,33 @@ export class ResourcesImpl implements Resources { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: ResourcesListByResourceGroupOptionalParams + options?: ResourcesListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ResourcesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -98,7 +113,9 @@ export class ResourcesImpl implements Resources { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -129,22 +146,34 @@ export class ResourcesImpl implements Resources { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: ResourcesListOptionalParams + options?: ResourcesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ResourcesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -792,7 +821,9 @@ export class ResourcesImpl implements Resources { } /** - * Checks by ID whether a resource exists. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource + * providers. In the event that a Resource provider does not implement this API, ARM will respond with + * a 405. The alternative then is to use the GET API to check for the existence of the resource. * @param resourceId The fully qualified ID of the resource, including the resource name and resource * type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} diff --git a/sdk/resources/arm-resources/src/operations/tagsOperations.ts b/sdk/resources/arm-resources/src/operations/tagsOperations.ts index c993a0f6df0b..8f29e32e7e37 100644 --- a/sdk/resources/arm-resources/src/operations/tagsOperations.ts +++ b/sdk/resources/arm-resources/src/operations/tagsOperations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { TagsOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,13 +17,13 @@ import { TagDetails, TagsListNextOptionalParams, TagsListOptionalParams, + TagsListResponse, TagsDeleteValueOptionalParams, TagsCreateOrUpdateValueOptionalParams, TagsCreateOrUpdateValueResponse, TagsCreateOrUpdateOptionalParams, TagsCreateOrUpdateResponse, TagsDeleteOptionalParams, - TagsListResponse, TagsResource, TagsCreateOrUpdateAtScopeOptionalParams, TagsCreateOrUpdateAtScopeResponse, @@ -66,22 +67,34 @@ export class TagsOperationsImpl implements TagsOperations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: TagsListOptionalParams + options?: TagsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: TagsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts index ee8f17fce3c8..3b6c01bb2895 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts @@ -51,7 +51,10 @@ export interface Providers { options?: ProvidersUnregisterOptionalParams ): Promise; /** - * Registers a management group with a resource provider. + * Registers a management group with a resource provider. Use this operation to register a resource + * provider with resource types that can be deployed at the management group scope. It does not + * recursively register subscriptions within the management group. Instead, you must register + * subscriptions individually. * @param resourceProviderNamespace The namespace of the resource provider to register. * @param groupId The management group ID. * @param options The options parameters. diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts index 2e38346e4954..e4fba5652205 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts @@ -298,7 +298,9 @@ export interface Resources { options?: ResourcesGetOptionalParams ): Promise; /** - * Checks by ID whether a resource exists. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource + * providers. In the event that a Resource provider does not implement this API, ARM will respond with + * a 405. The alternative then is to use the GET API to check for the existence of the resource. * @param resourceId The fully qualified ID of the resource, including the resource name and resource * type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} diff --git a/sdk/resources/arm-resources/src/pagingHelper.ts b/sdk/resources/arm-resources/src/pagingHelper.ts new file mode 100644 index 000000000000..d85fc13bce1e --- /dev/null +++ b/sdk/resources/arm-resources/src/pagingHelper.ts @@ -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. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given a result page from a pageable operation, returns a + * continuation token that can be used to begin paging from + * that point later. + * @param page A result object from calling .byPage() on a paged operation. + * @returns The continuation token that can be passed into byPage(). + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/resources/arm-resources/src/resourceManagementClient.ts b/sdk/resources/arm-resources/src/resourceManagementClient.ts index b397a2ec8226..51788a0bfc36 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClient.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClient.ts @@ -8,6 +8,11 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, @@ -63,7 +68,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-resources/5.0.2`; + const packageDetails = `azsdk-js-arm-resources/5.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -83,27 +88,34 @@ export class ResourceManagementClient extends coreClient.ServiceClient { }; super(optionsWithDefaults); + let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - if (!bearerTokenAuthenticationPolicyFound) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - scopes: `${optionsWithDefaults.baseUri}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); - } + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: `${optionsWithDefaults.credentialScopes}`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); } // Parameter assignments this.subscriptionId = subscriptionId; @@ -119,6 +131,35 @@ export class ResourceManagementClient extends coreClient.ServiceClient { this.resourceGroups = new ResourceGroupsImpl(this); this.tagsOperations = new TagsOperationsImpl(this); this.deploymentOperations = new DeploymentOperationsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } operations: Operations; diff --git a/sdk/resources/arm-resources/test/resources_examples.ts b/sdk/resources/arm-resources/test/resources_examples.ts index 03cfc71ad656..da6dcef8788c 100644 --- a/sdk/resources/arm-resources/test/resources_examples.ts +++ b/sdk/resources/arm-resources/test/resources_examples.ts @@ -8,31 +8,25 @@ import { env, - record, - RecorderEnvironmentSetup, Recorder, + RecorderStartOptions, delay, - isPlaybackMode + isPlaybackMode, } from "@azure-tools/test-recorder"; -import * as assert from "assert"; -import { ClientSecretCredential } from "@azure/identity"; +import { createTestCredential } from "@azure-tools/test-credential"; +import { assert } from "chai"; +import { Context } from "mocha"; import { ResourceManagementClient } from "../src/resourceManagementClient"; -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ) - ], - queryParametersToSkip: [] +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables }; export const testPollingOptions = { @@ -48,104 +42,101 @@ describe("Resources test", () => { let tagName: string; let scope: string; - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); - subscriptionId = env.SUBSCRIPTION_ID; + beforeEach(async function (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + subscriptionId = env.SUBSCRIPTION_ID || ''; // This is an example of how the environment variables are used - const credential = new ClientSecretCredential( - env.AZURE_TENANT_ID, - env.AZURE_CLIENT_ID, - env.AZURE_CLIENT_SECRET - ); - client = new ResourceManagementClient(credential, subscriptionId); + const credential = createTestCredential(); + client = new ResourceManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); location = "eastus"; - resourceGroup = "myjstest"; + resourceGroup = "myjstest1"; tagName = "tagyyy"; scope = "subscriptions/" + subscriptionId + "/resourcegroups/" + resourceGroup; }); - afterEach(async function() { + afterEach(async function () { await recorder.stop(); }); - it("tagsOperations create test", async function() { - const res = await client.tagsOperations.createOrUpdate(tagName); - assert.equal(res.tagName,tagName); + it("resourceGroups create test", async function () { + const res = await client.resourceGroups.createOrUpdate(resourceGroup, { + location: location, + tags: { + tag1: "value1" + } + }) + assert.equal(res.name, resourceGroup) }); - it("tagsOperations get test", async function() { - const res = await client.tagsOperations.getAtScope(scope); - assert.equal(res.name,"default"); + it("resourceGroups get test", async function () { + const res = await client.resourceGroups.get(resourceGroup); + assert.equal(res.name, resourceGroup); }); - it("tagsOperations list test", async function() { + it("resourceGroups list test", async function () { const resArray = new Array(); - for await (let item of client.tagsOperations.list()){ + for await (let item of client.resourceGroups.list()) { resArray.push(item); } - assert.notEqual(resArray.length,0); + assert.notEqual(resArray.length, 0); }); - it("tagsOperations update test", async function() { - const res = await client.tagsOperations.updateAtScope(scope,{ - operation: "Delete", - properties: { - tags: { - tagkey1: "tagvalue1" - } + it("resourceGroups update test", async function () { + const res = await client.resourceGroups.update(resourceGroup, { + tags: { + tag1: "value1", + tag2: "value2" } }) - assert.equal(res.type,"Microsoft.Resources/tags"); + assert.equal(res.type, "Microsoft.Resources/resourceGroups"); }); - it("tagsOperations delete test", async function() { - const res = await client.tagsOperations.deleteAtScope(scope); + it("tagsOperations create test", async function () { + const res = await client.tagsOperations.createOrUpdate(tagName); + assert.equal(res.tagName, tagName); + }); + + it("tagsOperations get test", async function () { + const res = await client.tagsOperations.getAtScope(scope); + assert.equal(res.name, "default"); + }); + + it("tagsOperations list test", async function () { const resArray = new Array(); - for await (let item of client.tagsOperations.list()){ + for await (let item of client.tagsOperations.list()) { resArray.push(item); } - assert.equal(resArray.length,19); + assert.notEqual(resArray.length, 0); }); - it("resourceGroups create test", async function() { - const res = await client.resourceGroups.createOrUpdate(resourceGroup,{ - location: location, - tags: { - tag1: "value1" + it("tagsOperations update test", async function () { + const res = await client.tagsOperations.updateAtScope(scope, { + operation: "Delete", + properties: { + tags: { + tagkey1: "tagvalue1" + } } }) - assert.equal(res.name,resourceGroup) + assert.equal(res.type, "Microsoft.Resources/tags"); }); - it("resourceGroups get test", async function() { - const res = await client.resourceGroups.get(resourceGroup); - assert.equal(res.name,resourceGroup); - }); - - it("resourceGroups list test", async function() { + it("tagsOperations delete test", async function () { + const res = await client.tagsOperations.deleteAtScope(scope); const resArray = new Array(); - for await (let item of client.resourceGroups.list()){ + for await (let item of client.tagsOperations.list()) { resArray.push(item); } - assert.notEqual(resArray.length,0); - }); - - it("resourceGroups update test", async function() { - const res = await client.resourceGroups.update(resourceGroup,{ - tags: { - tag1: "value1", - tag2: "value2" - } - }) - assert.equal(res.type,"Microsoft.Resources/resourceGroups"); + assert.equal(resArray.length, 19); }); - it("resourceGroups delete test", async function() { - const res = await client.resourceGroups.beginDeleteAndWait(resourceGroup,testPollingOptions); + it("resourceGroups delete test", async function () { + const res = await client.resourceGroups.beginDeleteAndWait(resourceGroup, testPollingOptions); const resArray = new Array(); - for await (let item of client.resourceGroups.list()){ + for await (let item of client.resourceGroups.list()) { resArray.push(item); } - assert.notEqual(resArray.length,0); + assert.notEqual(resArray.length, 0); }); }); From 79626a75ee3e3bb55899dfb40a9b35427c82a2e6 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Thu, 3 Nov 2022 13:46:15 +0800 Subject: [PATCH 2/5] update files --- common/config/rush/pnpm-lock.yaml | 43 +++-- .../samples/v5/javascript/README.md | 88 +++++++++++ .../deploymentsCalculateTemplateHashSample.js | 43 +++++ ...ateOrUpdateAtManagementGroupScopeSample.js | 42 +++++ .../deploymentsCreateOrUpdateAtScopeSample.js | 43 +++++ ...CreateOrUpdateAtSubscriptionScopeSample.js | 42 +++++ ...ymentsCreateOrUpdateAtTenantScopeSample.js | 41 +++++ .../deploymentsCreateOrUpdateSample.js | 139 ++++++++++++++++ ...mentsWhatIfAtManagementGroupScopeSample.js | 42 +++++ ...loymentsWhatIfAtSubscriptionScopeSample.js | 40 +++++ .../deploymentsWhatIfAtTenantScopeSample.js | 40 +++++ .../v5/javascript/deploymentsWhatIfSample.js | 41 +++++ .../samples/v5/javascript/package.json | 32 ++++ .../providerResourceTypesListSample.js | 29 ++++ .../providersGetAtTenantScopeSample.js | 31 ++++ .../v5/javascript/providersGetSample.js | 29 ++++ .../v5/javascript/providersListSample.js | 31 ++++ .../providersProviderPermissionsSample.js | 29 ++++ .../resourceGroupsCreateOrUpdateSample.js | 30 ++++ .../javascript/resourceGroupsDeleteSample.js | 51 ++++++ .../resourceGroupsExportTemplateSample.js | 62 ++++++++ .../samples/v5/javascript/sample.env | 4 + .../tagsCreateOrUpdateAtScopeSample.js | 53 +++++++ .../v5/javascript/tagsGetAtScopeSample.js | 47 ++++++ .../samples/v5/typescript/README.md | 101 ++++++++++++ .../samples/v5/typescript/package.json | 41 +++++ .../samples/v5/typescript/sample.env | 4 + .../deploymentsCalculateTemplateHashSample.ts | 43 +++++ ...ateOrUpdateAtManagementGroupScopeSample.ts | 45 ++++++ .../deploymentsCreateOrUpdateAtScopeSample.ts | 44 ++++++ ...CreateOrUpdateAtSubscriptionScopeSample.ts | 45 ++++++ ...ymentsCreateOrUpdateAtTenantScopeSample.ts | 44 ++++++ .../src/deploymentsCreateOrUpdateSample.ts | 148 ++++++++++++++++++ ...mentsWhatIfAtManagementGroupScopeSample.ts | 45 ++++++ ...loymentsWhatIfAtSubscriptionScopeSample.ts | 43 +++++ .../deploymentsWhatIfAtTenantScopeSample.ts | 43 +++++ .../typescript/src/deploymentsWhatIfSample.ts | 44 ++++++ .../src/providerResourceTypesListSample.ts | 31 ++++ .../src/providersGetAtTenantScopeSample.ts | 37 +++++ .../v5/typescript/src/providersGetSample.ts | 29 ++++ .../v5/typescript/src/providersListSample.ts | 31 ++++ .../src/providersProviderPermissionsSample.ts | 31 ++++ .../src/resourceGroupsCreateOrUpdateSample.ts | 33 ++++ .../src/resourceGroupsDeleteSample.ts | 62 ++++++++ .../src/resourceGroupsExportTemplateSample.ts | 65 ++++++++ .../src/tagsCreateOrUpdateAtScopeSample.ts | 59 +++++++ .../v5/typescript/src/tagsGetAtScopeSample.ts | 47 ++++++ .../samples/v5/typescript/tsconfig.json | 17 ++ 48 files changed, 2191 insertions(+), 13 deletions(-) create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/README.md create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/package.json create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/sample.env create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/README.md create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/package.json create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/sample.env create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 2cd21de7be86..8aedc3431fb9 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -808,6 +808,21 @@ packages: - supports-color dev: false + /@azure/arm-resources/5.0.1: + resolution: {integrity: sha512-JbZtIqfEulsIA0rC3zM7jfF4KkOnye9aKcaO/jJqxJRm/gM6lAjEv7sL4njW8D+35l50P1f+UuH5OqN+UKJqNA==} + engines: {node: '>=12.0.0'} + dependencies: + '@azure/abort-controller': 1.1.0 + '@azure/core-auth': 1.4.0 + '@azure/core-client': 1.6.1 + '@azure/core-lro': 2.4.0 + '@azure/core-paging': 1.3.0 + '@azure/core-rest-pipeline': 1.9.2 + tslib: 2.4.0 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/arm-storage/17.2.1: resolution: {integrity: sha512-J2jmTPv8ZraSHDTz9l2Bx8gNL3ktfDDWo2mxWfzarn64O9Fjhb+l85YWyubGy2xUdeGuZPKzvQLltGv8bSu8eQ==} engines: {node: '>=12.0.0'} @@ -3883,7 +3898,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20221101 + typescript: 5.0.0-dev.20221102 dev: false /downlevel-dts/0.8.0: @@ -8872,8 +8887,8 @@ packages: hasBin: true dev: false - /typescript/5.0.0-dev.20221101: - resolution: {integrity: sha512-toPkTrYmviWyzo9Vj/fEG0iWkVTo6wB5HHaZu8eV070sOA8yON5vKKsROt0AyeveDhSfzPX8MXEc5oiNeDCGeA==} + /typescript/5.0.0-dev.20221102: + resolution: {integrity: sha512-/zsVWPD4QVasQaOQAhaV7TkveFM6Wx4ql9LxnM7NNFb56FpD4tlIjUT/EZLA2tiz472D6zGQf6uuzhjS9mQ4EQ==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -12682,11 +12697,12 @@ packages: dev: false file:projects/arm-links.tgz: - resolution: {integrity: sha512-Vdb/Dd+9IFLd8/yto66fCWhX5yjLE+N/v5pxRCYm6PaaUfLPJLXLxHgnqRlEAl++bMBr5CF0qRZPPBo3X/TNLQ==, tarball: file:projects/arm-links.tgz} + resolution: {integrity: sha512-dA1SMN8GHZj+2vmT2rgeid6pvkP3DUoWQdzbhxPrJ5QgAgjA1dZ4yckeIgZEo8z93ZWD9LP8/QJVWHccEEdwVA==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/arm-resources': 5.0.1 '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.33.5 '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 @@ -14321,7 +14337,7 @@ packages: dev: false file:projects/arm-resources.tgz: - resolution: {integrity: sha512-dCbJQwCvIzZ2VzqzLnHSQDu9a6SGCkhBMzljvRr15+2M+AgkoPFanApID8PgsDHiHmB9zVcams8T90xRPvM94g==, tarball: file:projects/arm-resources.tgz} + resolution: {integrity: sha512-/bqYSaWaEdRslQxOTwX1YyA5RPcx4lnudPwrfuHMh7wXCgUHovGr6ep9Fy6Jl4p//M/VhThT8FYrPhXBYrJd/w==, tarball: file:projects/arm-resources.tgz} name: '@rush-temp/arm-resources' version: 0.0.0 dependencies: @@ -14332,18 +14348,19 @@ 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.3 + '@types/node': 14.18.33 + chai: 4.3.6 cross-env: 7.0.3 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.0 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: - - '@types/node' - - encoding - supports-color dev: false @@ -15551,7 +15568,7 @@ packages: dev: false file:projects/communication-email.tgz: - resolution: {integrity: sha512-RhI+WjqfaBqh0U8veuoa5ZrFNTH/LJzWkOM3Q85xPYbUjbnSRYz4EoAMjHQqVmj9hZvhSbouIUKVsBQ2oQM8jA==, tarball: file:projects/communication-email.tgz} + resolution: {integrity: sha512-JUM2HfVa7yIVOHZ2hdb4QjOe3EA0XgNw+8TTjKDJ4319hEcss0cdw4lSg6kBG/S1EGL+yjS+xY86YWkY68xw+g==, tarball: file:projects/communication-email.tgz} name: '@rush-temp/communication-email' version: 0.0.0 dependencies: @@ -17312,7 +17329,7 @@ packages: dev: false file:projects/keyvault-admin.tgz: - resolution: {integrity: sha512-zt5Iu56m9r0icm/kPw+dSYGCDhXP9YvUODLIlCinUSBZ8/dhcr2ovf57pb/5Ojqjuaxo2Lpj4ON9Q2Moc1pPYw==, tarball: file:projects/keyvault-admin.tgz} + resolution: {integrity: sha512-qegEv0paVx7dHJIGMtm8fTGiVf0AKTLUquBP7seg/SwQ2X1SMJR0O5XOJrIyfX1VBG7L+TSr04adfr/1TIR2YQ==, tarball: file:projects/keyvault-admin.tgz} name: '@rush-temp/keyvault-admin' version: 0.0.0 dependencies: @@ -18129,7 +18146,7 @@ packages: dev: false file:projects/perf-app-configuration.tgz: - resolution: {integrity: sha512-BzR9fvBllxo1pEws5GZiMxuzWLQ7KjDJMfrzlcfwWZIldYlntxGolkUbdVYKsQlxiiq6W+aq/OY8j3AGqI7cwQ==, tarball: file:projects/perf-app-configuration.tgz} + resolution: {integrity: sha512-b33BULpxOX6J9dR9f56lJ7afd7XBXxEQZBtZwG3pq0Slu6LjWh717zNT0t+HV/uNPpDTUySako6JAzVPT5yJWQ==, tarball: file:projects/perf-app-configuration.tgz} name: '@rush-temp/perf-app-configuration' version: 0.0.0 dependencies: @@ -18512,7 +18529,7 @@ packages: dev: false file:projects/perf-template.tgz: - resolution: {integrity: sha512-CR7LZ2mTcTzlarWLzMt5NaXWF8Wqyxkq9XPVS7BXzPMLAUx2sjTkZtDBuNK0UQ+lGJ3uqhpokEQO6A6jw9fwtg==, tarball: file:projects/perf-template.tgz} + resolution: {integrity: sha512-vkGuclIBHH0EYig/IAlJuKXo0FPxnqH3LWulE/Ibe4LUnjHFEv6qTEtps9HpSL/UhkERBiBJo5o7wsNO/ElgwA==, tarball: file:projects/perf-template.tgz} name: '@rush-temp/perf-template' version: 0.0.0 dependencies: diff --git a/sdk/resources/arm-resources/samples/v5/javascript/README.md b/sdk/resources/arm-resources/samples/v5/javascript/README.md new file mode 100644 index 000000000000..ba83e0f22a73 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/README.md @@ -0,0 +1,88 @@ +# client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [deploymentsCalculateTemplateHashSample.js][deploymentscalculatetemplatehashsample] | Calculate the hash of the given template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json | +| [deploymentsCreateOrUpdateAtManagementGroupScopeSample.js][deploymentscreateorupdateatmanagementgroupscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json | +| [deploymentsCreateOrUpdateAtScopeSample.js][deploymentscreateorupdateatscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json | +| [deploymentsCreateOrUpdateAtSubscriptionScopeSample.js][deploymentscreateorupdateatsubscriptionscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json | +| [deploymentsCreateOrUpdateAtTenantScopeSample.js][deploymentscreateorupdateattenantscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json | +| [deploymentsCreateOrUpdateSample.js][deploymentscreateorupdatesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json | +| [deploymentsWhatIfAtManagementGroupScopeSample.js][deploymentswhatifatmanagementgroupscopesample] | Returns changes that will be made by the deployment if executed at the scope of the management group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json | +| [deploymentsWhatIfAtSubscriptionScopeSample.js][deploymentswhatifatsubscriptionscopesample] | Returns changes that will be made by the deployment if executed at the scope of the subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json | +| [deploymentsWhatIfAtTenantScopeSample.js][deploymentswhatifattenantscopesample] | Returns changes that will be made by the deployment if executed at the scope of the tenant group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json | +| [deploymentsWhatIfSample.js][deploymentswhatifsample] | Returns changes that will be made by the deployment if executed at the scope of the resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json | +| [providerResourceTypesListSample.js][providerresourcetypeslistsample] | List the resource types for a specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json | +| [providersGetAtTenantScopeSample.js][providersgetattenantscopesample] | Gets the specified resource provider at the tenant level. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json | +| [providersGetSample.js][providersgetsample] | Gets the specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json | +| [providersListSample.js][providerslistsample] | Gets all resource providers for a subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json | +| [providersProviderPermissionsSample.js][providersproviderpermissionssample] | Get the provider permissions. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json | +| [resourceGroupsCreateOrUpdateSample.js][resourcegroupscreateorupdatesample] | Creates or updates a resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json | +| [resourceGroupsDeleteSample.js][resourcegroupsdeletesample] | When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json | +| [resourceGroupsExportTemplateSample.js][resourcegroupsexporttemplatesample] | Captures the specified resource group as a template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json | +| [tagsCreateOrUpdateAtScopeSample.js][tagscreateorupdateatscopesample] | This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json | +| [tagsGetAtScopeSample.js][tagsgetatscopesample] | Gets the entire set of tags on a resource or subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node deploymentsCalculateTemplateHashSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node deploymentsCalculateTemplateHashSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[deploymentscalculatetemplatehashsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js +[deploymentscreateorupdateatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js +[deploymentscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js +[deploymentscreateorupdateatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js +[deploymentscreateorupdateattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js +[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js +[deploymentswhatifatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js +[deploymentswhatifatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js +[deploymentswhatifattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js +[deploymentswhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js +[providerresourcetypeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js +[providersgetattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js +[providersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js +[providerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js +[providersproviderpermissionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js +[resourcegroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js +[resourcegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js +[resourcegroupsexporttemplatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js +[tagscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js +[tagsgetatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources/README.md diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js new file mode 100644 index 000000000000..85a819234b88 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Calculate the hash of the given template. + * + * @summary Calculate the hash of the given template. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json + */ +async function calculateTemplateHash() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const template = { + $schema: + "http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview", + contentVersion: "1.0.0.0", + outputs: { string: { type: "string", value: "myvalue" } }, + parameters: { string: { type: "string" } }, + resources: [], + variables: { + array: [1, 2, 3, 4], + bool: true, + int: 42, + object: { object: { location: "West US", vmSize: "Large" } }, + string: "string", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.calculateTemplateHash(template); + console.log(result); +} + +calculateTemplateHash().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js new file mode 100644 index 000000000000..c20ce8677c71 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json + */ +async function createDeploymentAtManagementGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const groupId = "my-management-group-id"; + const deploymentName = "my-deployment"; + const parameters = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtManagementGroupScopeAndWait( + groupId, + deploymentName, + parameters + ); + console.log(result); +} + +createDeploymentAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js new file mode 100644 index 000000000000..cc4c06703491 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json + */ +async function createDeploymentAtAGivenScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = "providers/Microsoft.Management/managementGroups/my-management-group-id"; + const deploymentName = "my-deployment"; + const parameters = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtScopeAndWait( + scope, + deploymentName, + parameters + ); + console.log(result); +} + +createDeploymentAtAGivenScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js new file mode 100644 index 000000000000..e631da187b4c --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json + */ +async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const deploymentName = "my-deployment"; + const parameters = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { + id: "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtSubscriptionScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js new file mode 100644 index 000000000000..379ee8a5553c --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json + */ +async function createDeploymentAtTenantScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const deploymentName = "tenant-dep01"; + const parameters = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtTenantScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +createDeploymentAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js new file mode 100644 index 000000000000..d9e19783fefb --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js @@ -0,0 +1,139 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json + */ +async function createADeploymentThatWillDeployATemplateWithAUriAndQueryString() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters = { + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { + queryString: + "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d", + uri: "https://example.com/exampleTemplate.json", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillDeployATemplateWithAUriAndQueryString().catch(console.error); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json + */ +async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters = { + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { + id: "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch(console.error); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json + */ +async function createADeploymentThatWillRedeployAnotherDeploymentOnFailure() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters = { + properties: { + mode: "Complete", + onErrorDeployment: { + type: "SpecificDeployment", + deploymentName: "name-of-deployment-to-use", + }, + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillRedeployAnotherDeploymentOnFailure().catch(console.error); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json + */ +async function createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters = { + properties: { + mode: "Complete", + onErrorDeployment: { type: "LastSuccessful" }, + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js new file mode 100644 index 000000000000..0b7d65e0a602 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the management group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json + */ +async function predictTemplateChangesAtManagementGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const groupId = "myManagementGruop"; + const deploymentName = "exampleDeploymentName"; + const parameters = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAtManagementGroupScopeAndWait( + groupId, + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js new file mode 100644 index 000000000000..6eefe73ba752 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json + */ +async function predictTemplateChangesAtSubscriptionScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const deploymentName = "my-deployment"; + const parameters = { + location: "westus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAtSubscriptionScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtSubscriptionScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js new file mode 100644 index 000000000000..b51fed2146af --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json + */ +async function predictTemplateChangesAtManagementGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const deploymentName = "exampleDeploymentName"; + const parameters = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAtTenantScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js new file mode 100644 index 000000000000..077f044ec3ba --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the resource group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json + */ +async function predictTemplateChangesAtResourceGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters = { + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtResourceGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/package.json b/sdk/resources/arm-resources/samples/v5/javascript/package.json new file mode 100644 index 000000000000..12f9056be514 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "@azure-samples/arm-resources-js", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript", + "engines": { + "node": ">=14.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/resources/arm-resources" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", + "dependencies": { + "@azure/arm-resources": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js new file mode 100644 index 000000000000..fb97a3cdcf2c --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List the resource types for a specified resource provider. + * + * @summary List the resource types for a specified resource provider. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json + */ +async function getProviderResourceTypes() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceProviderNamespace = "Microsoft.TestRP"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providerResourceTypes.list(resourceProviderNamespace); + console.log(result); +} + +getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js new file mode 100644 index 000000000000..445e2a249eba --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the specified resource provider at the tenant level. + * + * @summary Gets the specified resource provider at the tenant level. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json + */ +async function getAResourceProviderAtTenantScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const expand = "resourceTypes/aliases"; + const resourceProviderNamespace = "Microsoft.Storage"; + const options = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providers.getAtTenantScope(resourceProviderNamespace, options); + console.log(result); +} + +getAResourceProviderAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js new file mode 100644 index 000000000000..b6fe20b65918 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the specified resource provider. + * + * @summary Gets the specified resource provider. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json + */ +async function getProvider() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceProviderNamespace = "Microsoft.TestRP1"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providers.get(resourceProviderNamespace); + console.log(result); +} + +getProvider().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js new file mode 100644 index 000000000000..ccc70914ee6e --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets all resource providers for a subscription. + * + * @summary Gets all resource providers for a subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json + */ +async function getProviders() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.providers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getProviders().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js new file mode 100644 index 000000000000..59829087b401 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the provider permissions. + * + * @summary Get the provider permissions. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json + */ +async function getProviderResourceTypes() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceProviderNamespace = "Microsoft.TestRP"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providers.providerPermissions(resourceProviderNamespace); + console.log(result); +} + +getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js new file mode 100644 index 000000000000..92cd414ad069 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates or updates a resource group. + * + * @summary Creates or updates a resource group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json + */ +async function createOrUpdateAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const parameters = { location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.createOrUpdate(resourceGroupName, parameters); + console.log(result); +} + +createOrUpdateAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js new file mode 100644 index 000000000000..e9bc48901916 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * + * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json + */ +async function forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const forceDeletionTypes = + "Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets"; + const options = { forceDeletionTypes }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginDeleteAndWait(resourceGroupName, options); + console.log(result); +} + +forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup().catch(console.error); + +/** + * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * + * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsInResourceGroup.json + */ +async function forceDeleteAllTheVirtualMachinesInAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const forceDeletionTypes = "Microsoft.Compute/virtualMachines"; + const options = { forceDeletionTypes }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginDeleteAndWait(resourceGroupName, options); + console.log(result); +} + +forceDeleteAllTheVirtualMachinesInAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js new file mode 100644 index 000000000000..804fc2096199 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Captures the specified resource group as a template. + * + * @summary Captures the specified resource group as a template. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json + */ +async function exportAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const parameters = { + options: "IncludeParameterDefaultValue,IncludeComments", + resources: ["*"], + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginExportTemplateAndWait( + resourceGroupName, + parameters + ); + console.log(result); +} + +exportAResourceGroup().catch(console.error); + +/** + * This sample demonstrates how to Captures the specified resource group as a template. + * + * @summary Captures the specified resource group as a template. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroupWithFiltering.json + */ +async function exportAResourceGroupWithFiltering() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const parameters = { + options: "SkipResourceNameParameterization", + resources: [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/My.RP/myResourceType/myFirstResource", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginExportTemplateAndWait( + resourceGroupName, + parameters + ); + console.log(result); +} + +exportAResourceGroupWithFiltering().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/sample.env b/sdk/resources/arm-resources/samples/v5/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js new file mode 100644 index 000000000000..b870cdb54584 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * + * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json + */ +async function updateTagsOnAResource() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; + const parameters = { + properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.createOrUpdateAtScope(scope, parameters); + console.log(result); +} + +updateTagsOnAResource().catch(console.error); + +/** + * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * + * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsSubscription.json + */ +async function updateTagsOnASubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; + const parameters = { + properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.createOrUpdateAtScope(scope, parameters); + console.log(result); +} + +updateTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js new file mode 100644 index 000000000000..c878c2c92d51 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. + * + * @summary Gets the entire set of tags on a resource or subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json + */ +async function getTagsOnAResource() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.getAtScope(scope); + console.log(result); +} + +getTagsOnAResource().catch(console.error); + +/** + * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. + * + * @summary Gets the entire set of tags on a resource or subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsSubscription.json + */ +async function getTagsOnASubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.getAtScope(scope); + console.log(result); +} + +getTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/README.md b/sdk/resources/arm-resources/samples/v5/typescript/README.md new file mode 100644 index 000000000000..9e633d641bf9 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/README.md @@ -0,0 +1,101 @@ +# client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [deploymentsCalculateTemplateHashSample.ts][deploymentscalculatetemplatehashsample] | Calculate the hash of the given template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json | +| [deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts][deploymentscreateorupdateatmanagementgroupscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json | +| [deploymentsCreateOrUpdateAtScopeSample.ts][deploymentscreateorupdateatscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json | +| [deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts][deploymentscreateorupdateatsubscriptionscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json | +| [deploymentsCreateOrUpdateAtTenantScopeSample.ts][deploymentscreateorupdateattenantscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json | +| [deploymentsCreateOrUpdateSample.ts][deploymentscreateorupdatesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json | +| [deploymentsWhatIfAtManagementGroupScopeSample.ts][deploymentswhatifatmanagementgroupscopesample] | Returns changes that will be made by the deployment if executed at the scope of the management group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json | +| [deploymentsWhatIfAtSubscriptionScopeSample.ts][deploymentswhatifatsubscriptionscopesample] | Returns changes that will be made by the deployment if executed at the scope of the subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json | +| [deploymentsWhatIfAtTenantScopeSample.ts][deploymentswhatifattenantscopesample] | Returns changes that will be made by the deployment if executed at the scope of the tenant group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json | +| [deploymentsWhatIfSample.ts][deploymentswhatifsample] | Returns changes that will be made by the deployment if executed at the scope of the resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json | +| [providerResourceTypesListSample.ts][providerresourcetypeslistsample] | List the resource types for a specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json | +| [providersGetAtTenantScopeSample.ts][providersgetattenantscopesample] | Gets the specified resource provider at the tenant level. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json | +| [providersGetSample.ts][providersgetsample] | Gets the specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json | +| [providersListSample.ts][providerslistsample] | Gets all resource providers for a subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json | +| [providersProviderPermissionsSample.ts][providersproviderpermissionssample] | Get the provider permissions. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json | +| [resourceGroupsCreateOrUpdateSample.ts][resourcegroupscreateorupdatesample] | Creates or updates a resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json | +| [resourceGroupsDeleteSample.ts][resourcegroupsdeletesample] | When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json | +| [resourceGroupsExportTemplateSample.ts][resourcegroupsexporttemplatesample] | Captures the specified resource group as a template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json | +| [tagsCreateOrUpdateAtScopeSample.ts][tagscreateorupdateatscopesample] | This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json | +| [tagsGetAtScopeSample.ts][tagsgetatscopesample] | Gets the entire set of tags on a resource or subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/deploymentsCalculateTemplateHashSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/deploymentsCalculateTemplateHashSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[deploymentscalculatetemplatehashsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts +[deploymentscreateorupdateatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts +[deploymentscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts +[deploymentscreateorupdateatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts +[deploymentscreateorupdateattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts +[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts +[deploymentswhatifatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts +[deploymentswhatifatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts +[deploymentswhatifattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts +[deploymentswhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts +[providerresourcetypeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts +[providersgetattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts +[providersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts +[providerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts +[providersproviderpermissionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts +[resourcegroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts +[resourcegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts +[resourcegroupsexporttemplatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts +[tagscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts +[tagsgetatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/resources/arm-resources/samples/v5/typescript/package.json b/sdk/resources/arm-resources/samples/v5/typescript/package.json new file mode 100644 index 000000000000..051881c97e87 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure-samples/arm-resources-ts", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript", + "engines": { + "node": ">=14.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/resources/arm-resources" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", + "dependencies": { + "@azure/arm-resources": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^14.0.0", + "typescript": "~4.8.0", + "rimraf": "latest" + } +} diff --git a/sdk/resources/arm-resources/samples/v5/typescript/sample.env b/sdk/resources/arm-resources/samples/v5/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts new file mode 100644 index 000000000000..ef98d9c46a68 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts @@ -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 { ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Calculate the hash of the given template. + * + * @summary Calculate the hash of the given template. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json + */ +async function calculateTemplateHash() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const template: Record = { + $schema: + "http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview", + contentVersion: "1.0.0.0", + outputs: { string: { type: "string", value: "myvalue" } }, + parameters: { string: { type: "string" } }, + resources: [], + variables: { + array: [1, 2, 3, 4], + bool: true, + int: 42, + object: { object: { location: "West US", vmSize: "Large" } }, + string: "string" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.calculateTemplateHash(template); + console.log(result); +} + +calculateTemplateHash().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts new file mode 100644 index 000000000000..67139e55ae43 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts @@ -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 { + ScopedDeployment, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json + */ +async function createDeploymentAtManagementGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const groupId = "my-management-group-id"; + const deploymentName = "my-deployment"; + const parameters: ScopedDeployment = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtManagementGroupScopeAndWait( + groupId, + deploymentName, + parameters + ); + console.log(result); +} + +createDeploymentAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts new file mode 100644 index 000000000000..b0efcc3ad039 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts @@ -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 { Deployment, ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json + */ +async function createDeploymentAtAGivenScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = + "providers/Microsoft.Management/managementGroups/my-management-group-id"; + const deploymentName = "my-deployment"; + const parameters: Deployment = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + }, + tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtScopeAndWait( + scope, + deploymentName, + parameters + ); + console.log(result); +} + +createDeploymentAtAGivenScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts new file mode 100644 index 000000000000..2c7ba97b349c --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts @@ -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 { Deployment, ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json + */ +async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const deploymentName = "my-deployment"; + const parameters: Deployment = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { + id: + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtSubscriptionScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch( + console.error +); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts new file mode 100644 index 000000000000..2a7a2b607b1b --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts @@ -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 { + ScopedDeployment, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json + */ +async function createDeploymentAtTenantScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const deploymentName = "tenant-dep01"; + const parameters: ScopedDeployment = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + }, + tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtTenantScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +createDeploymentAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..fa6712c0b5cb --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts @@ -0,0 +1,148 @@ +/* + * 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 { Deployment, ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json + */ +async function createADeploymentThatWillDeployATemplateWithAUriAndQueryString() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters: Deployment = { + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { + queryString: + "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d", + uri: "https://example.com/exampleTemplate.json" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillDeployATemplateWithAUriAndQueryString().catch( + console.error +); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json + */ +async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters: Deployment = { + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { + id: + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch( + console.error +); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json + */ +async function createADeploymentThatWillRedeployAnotherDeploymentOnFailure() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters: Deployment = { + properties: { + mode: "Complete", + onErrorDeployment: { + type: "SpecificDeployment", + deploymentName: "name-of-deployment-to-use" + }, + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillRedeployAnotherDeploymentOnFailure().catch( + console.error +); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json + */ +async function createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters: Deployment = { + properties: { + mode: "Complete", + onErrorDeployment: { type: "LastSuccessful" }, + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure().catch( + console.error +); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts new file mode 100644 index 000000000000..4f37f74a4337 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts @@ -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 { + ScopedDeploymentWhatIf, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the management group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json + */ +async function predictTemplateChangesAtManagementGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const groupId = "myManagementGruop"; + const deploymentName = "exampleDeploymentName"; + const parameters: ScopedDeploymentWhatIf = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAtManagementGroupScopeAndWait( + groupId, + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts new file mode 100644 index 000000000000..22d6e8d2f3cc --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts @@ -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 { + DeploymentWhatIf, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json + */ +async function predictTemplateChangesAtSubscriptionScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const deploymentName = "my-deployment"; + const parameters: DeploymentWhatIf = { + location: "westus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAtSubscriptionScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtSubscriptionScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts new file mode 100644 index 000000000000..5bb4d672f84c --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts @@ -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 { + ScopedDeploymentWhatIf, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json + */ +async function predictTemplateChangesAtManagementGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const deploymentName = "exampleDeploymentName"; + const parameters: ScopedDeploymentWhatIf = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAtTenantScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts new file mode 100644 index 000000000000..0a5912a0f50a --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts @@ -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 { + DeploymentWhatIf, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the resource group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json + */ +async function predictTemplateChangesAtResourceGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters: DeploymentWhatIf = { + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtResourceGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts new file mode 100644 index 000000000000..b090f7f94330 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List the resource types for a specified resource provider. + * + * @summary List the resource types for a specified resource provider. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json + */ +async function getProviderResourceTypes() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceProviderNamespace = "Microsoft.TestRP"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providerResourceTypes.list( + resourceProviderNamespace + ); + console.log(result); +} + +getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts new file mode 100644 index 000000000000..e15e706b5352 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ProvidersGetAtTenantScopeOptionalParams, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified resource provider at the tenant level. + * + * @summary Gets the specified resource provider at the tenant level. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json + */ +async function getAResourceProviderAtTenantScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const expand = "resourceTypes/aliases"; + const resourceProviderNamespace = "Microsoft.Storage"; + const options: ProvidersGetAtTenantScopeOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providers.getAtTenantScope( + resourceProviderNamespace, + options + ); + console.log(result); +} + +getAResourceProviderAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts new file mode 100644 index 000000000000..bc749dab5de5 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts @@ -0,0 +1,29 @@ +/* + * 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 { ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified resource provider. + * + * @summary Gets the specified resource provider. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json + */ +async function getProvider() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceProviderNamespace = "Microsoft.TestRP1"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providers.get(resourceProviderNamespace); + console.log(result); +} + +getProvider().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts new file mode 100644 index 000000000000..bcd76e00734a --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets all resource providers for a subscription. + * + * @summary Gets all resource providers for a subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json + */ +async function getProviders() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.providers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getProviders().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts new file mode 100644 index 000000000000..819377488db7 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the provider permissions. + * + * @summary Get the provider permissions. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json + */ +async function getProviderResourceTypes() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceProviderNamespace = "Microsoft.TestRP"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providers.providerPermissions( + resourceProviderNamespace + ); + console.log(result); +} + +getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..05d744c91c8a --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ResourceGroup, ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a resource group. + * + * @summary Creates or updates a resource group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json + */ +async function createOrUpdateAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const parameters: ResourceGroup = { location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.createOrUpdate( + resourceGroupName, + parameters + ); + console.log(result); +} + +createOrUpdateAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts new file mode 100644 index 000000000000..b01fb3eebf0c --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts @@ -0,0 +1,62 @@ +/* + * 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 { + ResourceGroupsDeleteOptionalParams, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * + * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json + */ +async function forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const forceDeletionTypes = + "Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets"; + const options: ResourceGroupsDeleteOptionalParams = { forceDeletionTypes }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginDeleteAndWait( + resourceGroupName, + options + ); + console.log(result); +} + +forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup().catch( + console.error +); + +/** + * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * + * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsInResourceGroup.json + */ +async function forceDeleteAllTheVirtualMachinesInAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const forceDeletionTypes = "Microsoft.Compute/virtualMachines"; + const options: ResourceGroupsDeleteOptionalParams = { forceDeletionTypes }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginDeleteAndWait( + resourceGroupName, + options + ); + console.log(result); +} + +forceDeleteAllTheVirtualMachinesInAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts new file mode 100644 index 000000000000..9775c5733f95 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts @@ -0,0 +1,65 @@ +/* + * 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 { + ExportTemplateRequest, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Captures the specified resource group as a template. + * + * @summary Captures the specified resource group as a template. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json + */ +async function exportAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const parameters: ExportTemplateRequest = { + options: "IncludeParameterDefaultValue,IncludeComments", + resources: ["*"] + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginExportTemplateAndWait( + resourceGroupName, + parameters + ); + console.log(result); +} + +exportAResourceGroup().catch(console.error); + +/** + * This sample demonstrates how to Captures the specified resource group as a template. + * + * @summary Captures the specified resource group as a template. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroupWithFiltering.json + */ +async function exportAResourceGroupWithFiltering() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const parameters: ExportTemplateRequest = { + options: "SkipResourceNameParameterization", + resources: [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/My.RP/myResourceType/myFirstResource" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginExportTemplateAndWait( + resourceGroupName, + parameters + ); + console.log(result); +} + +exportAResourceGroupWithFiltering().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts new file mode 100644 index 000000000000..ad99eea1a194 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts @@ -0,0 +1,59 @@ +/* + * 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 { TagsResource, ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * + * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json + */ +async function updateTagsOnAResource() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; + const parameters: TagsResource = { + properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.createOrUpdateAtScope( + scope, + parameters + ); + console.log(result); +} + +updateTagsOnAResource().catch(console.error); + +/** + * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * + * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsSubscription.json + */ +async function updateTagsOnASubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; + const parameters: TagsResource = { + properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.createOrUpdateAtScope( + scope, + parameters + ); + console.log(result); +} + +updateTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts new file mode 100644 index 000000000000..d43b397344ee --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. + * + * @summary Gets the entire set of tags on a resource or subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json + */ +async function getTagsOnAResource() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.getAtScope(scope); + console.log(result); +} + +getTagsOnAResource().catch(console.error); + +/** + * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. + * + * @summary Gets the entire set of tags on a resource or subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsSubscription.json + */ +async function getTagsOnASubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.getAtScope(scope); + console.log(result); +} + +getTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json b/sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} From 6d396a02f1ed279c1fffcb70a82e9ed797ad5b72 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Wed, 9 Nov 2022 15:42:15 +0800 Subject: [PATCH 3/5] update files --- common/config/rush/pnpm-lock.yaml | 24 +- sdk/resources/arm-resources/CHANGELOG.md | 2 +- sdk/resources/arm-resources/_meta.json | 6 +- .../recording_resourcegroups_create_test.json | 12 +- .../recording_resourcegroups_delete_test.json | 249 ++++++++++++++---- .../recording_resourcegroups_get_test.json | 12 +- .../recording_resourcegroups_list_test.json | 153 ++++++++++- .../recording_resourcegroups_update_test.json | 12 +- .../recording_tagsoperations_create_test.json | 12 +- .../recording_tagsoperations_delete_test.json | 66 +++-- .../recording_tagsoperations_get_test.json | 12 +- .../recording_tagsoperations_list_test.json | 54 +++- .../recording_tagsoperations_update_test.json | 12 +- .../src/resourceManagementClient.ts | 9 +- .../arm-resources/test/resources_examples.ts | 2 +- 15 files changed, 501 insertions(+), 136 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3e8376e2037e..1af569373fe3 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -810,6 +810,21 @@ packages: - supports-color dev: false + /@azure/arm-resources/5.0.1: + resolution: {integrity: sha512-JbZtIqfEulsIA0rC3zM7jfF4KkOnye9aKcaO/jJqxJRm/gM6lAjEv7sL4njW8D+35l50P1f+UuH5OqN+UKJqNA==} + engines: {node: '>=12.0.0'} + dependencies: + '@azure/abort-controller': 1.1.0 + '@azure/core-auth': 1.4.0 + '@azure/core-client': 1.6.1 + '@azure/core-lro': 2.4.0 + '@azure/core-paging': 1.4.0 + '@azure/core-rest-pipeline': 1.10.0 + tslib: 2.4.1 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/arm-storage/17.2.1: resolution: {integrity: sha512-J2jmTPv8ZraSHDTz9l2Bx8gNL3ktfDDWo2mxWfzarn64O9Fjhb+l85YWyubGy2xUdeGuZPKzvQLltGv8bSu8eQ==} engines: {node: '>=12.0.0'} @@ -3831,7 +3846,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20221103 + typescript: 5.0.0-dev.20221108 dev: false /downlevel-dts/0.8.0: @@ -8779,8 +8794,8 @@ packages: hasBin: true dev: false - /typescript/5.0.0-dev.20221103: - resolution: {integrity: sha512-hfqcsmiJ+5ktli1OAkwu4PyDDJ3kWW3tiUofd2t1uxwmni3ZT3Mrv1m2dZFg9VNDKqHrkt49izB3tAtD2bsyGw==} + /typescript/5.0.0-dev.20221108: + resolution: {integrity: sha512-np7hLTLHztenzHetS6xnYYo/P+VcjgUYWkblyl8jCeKgrC7fHJt1QlcjL83uC7YQiHLz5o9zgMZKtZbQBHPzkg==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -12616,11 +12631,12 @@ packages: dev: false file:projects/arm-links.tgz: - resolution: {integrity: sha512-Vdb/Dd+9IFLd8/yto66fCWhX5yjLE+N/v5pxRCYm6PaaUfLPJLXLxHgnqRlEAl++bMBr5CF0qRZPPBo3X/TNLQ==, tarball: file:projects/arm-links.tgz} + resolution: {integrity: sha512-dA1SMN8GHZj+2vmT2rgeid6pvkP3DUoWQdzbhxPrJ5QgAgjA1dZ4yckeIgZEo8z93ZWD9LP8/QJVWHccEEdwVA==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/arm-resources': 5.0.1 '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.33.5 '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 diff --git a/sdk/resources/arm-resources/CHANGELOG.md b/sdk/resources/arm-resources/CHANGELOG.md index 9cde036f78b1..a47456ced952 100644 --- a/sdk/resources/arm-resources/CHANGELOG.md +++ b/sdk/resources/arm-resources/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 5.1.0 (2022-11-03) +## 5.1.0 (2022-11-09) **Features** diff --git a/sdk/resources/arm-resources/_meta.json b/sdk/resources/arm-resources/_meta.json index d6c5c456e9b3..feb32f3aaaf1 100644 --- a/sdk/resources/arm-resources/_meta.json +++ b/sdk/resources/arm-resources/_meta.json @@ -1,8 +1,8 @@ { - "commit": "8fcc099eeda14f210476c935241d429f46c2d02e", + "commit": "ae9cb5a65ff4dba1d626ed0a1bb4e94dd17583e8", "readme": "specification/resources/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221101.1 --generate-sample=true", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221103.1 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221101.1" + "use": "@autorest/typescript@6.0.0-rc.3.20221103.1" } \ No newline at end of file diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.json index 38e9b8e02a72..d9ddda636e27 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.json @@ -10,8 +10,8 @@ "Connection": "keep-alive", "Content-Length": "46", "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "0c95efd2-79df-40f6-b2db-a0b6b1267965" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "b4397320-c321-4416-85c6-a69a60795490" }, "RequestBody": { "location": "eastus", @@ -24,15 +24,15 @@ "Cache-Control": "no-cache", "Content-Length": "225", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 03 Nov 2022 05:32:08 GMT", + "Date": "Wed, 09 Nov 2022 07:39:50 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "d90467cf-f567-41d2-9882-3aac68be9b69", + "x-ms-correlation-request-id": "6d33b9d8-daac-459c-8fcd-edbf549bd4ec", "x-ms-ratelimit-remaining-subscription-writes": "1199", - "x-ms-request-id": "d90467cf-f567-41d2-9882-3aac68be9b69", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053208Z:d90467cf-f567-41d2-9882-3aac68be9b69" + "x-ms-request-id": "6d33b9d8-daac-459c-8fcd-edbf549bd4ec", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073950Z:6d33b9d8-daac-459c-8fcd-edbf549bd4ec" }, "ResponseBody": { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.json index c9e5d3f16897..a3140a35890b 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.json @@ -8,25 +8,25 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "e405bfc6-ddc0-413a-aa47-ce3999b7e98d" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "91ccd3ef-d8a1-49fc-bddf-a13b005bea2d" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Thu, 03 Nov 2022 05:32:25 GMT", + "Date": "Wed, 09 Nov 2022 07:40:05 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "9853708d-10f3-4f2c-8132-96af997de7d2", + "x-ms-correlation-request-id": "f3b7cf10-dc94-43b1-b996-c764bde30180", "x-ms-ratelimit-remaining-subscription-deletes": "14998", - "x-ms-request-id": "9853708d-10f3-4f2c-8132-96af997de7d2", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053225Z:9853708d-10f3-4f2c-8132-96af997de7d2" + "x-ms-request-id": "f3b7cf10-dc94-43b1-b996-c764bde30180", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074005Z:f3b7cf10-dc94-43b1-b996-c764bde30180" }, "ResponseBody": null }, @@ -38,25 +38,25 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "56fa54a7-9ba9-457b-9e17-b8d373524bdb" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "f209489a-f9ab-49ad-9d07-67b16114c2cf" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Thu, 03 Nov 2022 05:32:25 GMT", + "Date": "Wed, 09 Nov 2022 07:40:06 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "ecaf441b-9b23-4d02-9e99-337932e44db8", + "x-ms-correlation-request-id": "270a6209-2c96-489a-a625-8977e10fc6c5", "x-ms-ratelimit-remaining-subscription-reads": "11994", - "x-ms-request-id": "ecaf441b-9b23-4d02-9e99-337932e44db8", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053226Z:ecaf441b-9b23-4d02-9e99-337932e44db8" + "x-ms-request-id": "270a6209-2c96-489a-a625-8977e10fc6c5", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074006Z:270a6209-2c96-489a-a625-8977e10fc6c5" }, "ResponseBody": null }, @@ -68,25 +68,25 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "a61a5ea8-a441-4dac-b703-7bbf8d7e214f" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "9eb92b30-1063-40d5-8028-9dd9f9a05806" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Thu, 03 Nov 2022 05:32:26 GMT", + "Date": "Wed, 09 Nov 2022 07:40:06 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "e462b778-6256-42a8-8323-c741a8c6b07d", + "x-ms-correlation-request-id": "42b3b574-8bf1-4b87-b1bc-6af9a7cfbd3c", "x-ms-ratelimit-remaining-subscription-reads": "11993", - "x-ms-request-id": "e462b778-6256-42a8-8323-c741a8c6b07d", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053226Z:e462b778-6256-42a8-8323-c741a8c6b07d" + "x-ms-request-id": "42b3b574-8bf1-4b87-b1bc-6af9a7cfbd3c", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074006Z:42b3b574-8bf1-4b87-b1bc-6af9a7cfbd3c" }, "ResponseBody": null }, @@ -98,25 +98,25 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "30fdd0da-feed-4ab4-9587-e5e26f480e07" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "ebe25d1b-90a5-4229-ae96-1eb469d550b2" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Thu, 03 Nov 2022 05:32:41 GMT", + "Date": "Wed, 09 Nov 2022 07:40:22 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "eb9e08a6-6389-49e9-b8cb-76389da8b875", + "x-ms-correlation-request-id": "bb10ce94-ef09-4a7a-9418-6aec18945336", "x-ms-ratelimit-remaining-subscription-reads": "11992", - "x-ms-request-id": "eb9e08a6-6389-49e9-b8cb-76389da8b875", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053242Z:eb9e08a6-6389-49e9-b8cb-76389da8b875" + "x-ms-request-id": "bb10ce94-ef09-4a7a-9418-6aec18945336", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074022Z:bb10ce94-ef09-4a7a-9418-6aec18945336" }, "ResponseBody": null }, @@ -128,25 +128,25 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "80fd8b37-8dc0-45b3-86dd-7db6aecc7e65" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "77087689-c60c-4096-b5d9-9839ea8f838a" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Thu, 03 Nov 2022 05:32:57 GMT", + "Date": "Wed, 09 Nov 2022 07:40:37 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "2cbb1170-b361-4d26-a9ae-83320565ce06", + "x-ms-correlation-request-id": "0528f871-3920-42c6-abac-87b97432c920", "x-ms-ratelimit-remaining-subscription-reads": "11991", - "x-ms-request-id": "2cbb1170-b361-4d26-a9ae-83320565ce06", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053257Z:2cbb1170-b361-4d26-a9ae-83320565ce06" + "x-ms-request-id": "0528f871-3920-42c6-abac-87b97432c920", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074038Z:0528f871-3920-42c6-abac-87b97432c920" }, "ResponseBody": null }, @@ -158,25 +158,25 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "8ea3041f-b3c2-459c-9420-ab07b5822bdb" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "35ff4ecb-af16-45ff-b396-b131523611ae" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Thu, 03 Nov 2022 05:33:12 GMT", + "Date": "Wed, 09 Nov 2022 07:40:52 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "66da1da9-f280-4737-b47c-e844a25f6bc6", + "x-ms-correlation-request-id": "3816b811-9780-4d61-8ed3-b5a59efe1eb7", "x-ms-ratelimit-remaining-subscription-reads": "11990", - "x-ms-request-id": "66da1da9-f280-4737-b47c-e844a25f6bc6", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053313Z:66da1da9-f280-4737-b47c-e844a25f6bc6" + "x-ms-request-id": "3816b811-9780-4d61-8ed3-b5a59efe1eb7", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074053Z:3816b811-9780-4d61-8ed3-b5a59efe1eb7" }, "ResponseBody": null }, @@ -188,25 +188,25 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "24247cf6-2246-43e0-82e9-29acace75b2a" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "81a0d698-a85e-4858-8894-1cd0669c9525" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Thu, 03 Nov 2022 05:33:28 GMT", + "Date": "Wed, 09 Nov 2022 07:41:09 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "849e2f1a-7cef-4158-a35e-8599be5cab1c", + "x-ms-correlation-request-id": "950f92f3-9c12-4c1b-a539-c8180cacf612", "x-ms-ratelimit-remaining-subscription-reads": "11989", - "x-ms-request-id": "849e2f1a-7cef-4158-a35e-8599be5cab1c", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053328Z:849e2f1a-7cef-4158-a35e-8599be5cab1c" + "x-ms-request-id": "950f92f3-9c12-4c1b-a539-c8180cacf612", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074109Z:950f92f3-9c12-4c1b-a539-c8180cacf612" }, "ResponseBody": null }, @@ -218,23 +218,23 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "8bf51ec4-ea37-4cc2-8264-0bd08eb7a956" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "40981c14-5650-454d-b55a-b50adf84c30d" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Thu, 03 Nov 2022 05:33:43 GMT", + "Date": "Wed, 09 Nov 2022 07:41:24 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "13150911-2c98-4ea8-886d-2a42dfd483d1", + "x-ms-correlation-request-id": "907c044e-75f7-47cb-9132-1485e203170b", "x-ms-ratelimit-remaining-subscription-reads": "11988", - "x-ms-request-id": "13150911-2c98-4ea8-886d-2a42dfd483d1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053344Z:13150911-2c98-4ea8-886d-2a42dfd483d1" + "x-ms-request-id": "907c044e-75f7-47cb-9132-1485e203170b", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074125Z:907c044e-75f7-47cb-9132-1485e203170b" }, "ResponseBody": null }, @@ -246,26 +246,26 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "f9b7eb39-06fc-403d-91af-57da659f4694" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "fef661ff-4c99-4314-aacd-6efcfdddd06d" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Encoding": "gzip", - "Content-Length": "5039", + "Content-Length": "8402", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 03 Nov 2022 05:33:43 GMT", + "Date": "Wed, 09 Nov 2022 07:41:24 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "976303c5-e36b-435b-b077-6faadc0ad1f2", + "x-ms-correlation-request-id": "5845e992-b730-4c36-be79-5e6b4aca9519", "x-ms-ratelimit-remaining-subscription-reads": "11987", - "x-ms-request-id": "976303c5-e36b-435b-b077-6faadc0ad1f2", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053344Z:976303c5-e36b-435b-b077-6faadc0ad1f2" + "x-ms-request-id": "5845e992-b730-4c36-be79-5e6b4aca9519", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074125Z:5845e992-b730-4c36-be79-5e6b4aca9519" }, "ResponseBody": { "value": [ @@ -471,6 +471,145 @@ "provisioningState": "Succeeded" } }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-257", + "name": "go-sdk-test-257", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-805", + "name": "go-sdk-test-805", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-951", + "name": "go-sdk-test-951", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-676", + "name": "go-sdk-test-676", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-694", + "name": "go-sdk-test-694", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-728", + "name": "go-sdk-test-728", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-78", + "name": "go-sdk-test-78", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-836", + "name": "go-sdk-test-836", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-160", + "name": "go-sdk-test-160", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-721", + "name": "go-sdk-test-721", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-298", + "name": "go-sdk-test-298", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-385", + "name": "go-sdk-test-385", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-959", + "name": "go-sdk-test-959", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/managed-rg-qiaozhamatest", + "name": "managed-rg-qiaozhamatest", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "managedBy": "/subscriptions/azure_subscription_id/resourceGroups/qiaozhatest/providers/Microsoft.Purview/accounts/qiaozhamatest", + "tags": { + "test": "test" + }, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-647", + "name": "go-sdk-test-647", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, { "id": "/subscriptions/azure_subscription_id/resourceGroups/ApiExplorer", "name": "ApiExplorer", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.json index 00129d924b26..9a6286db19e7 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.json @@ -8,8 +8,8 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "5b62ac89-a5e9-42ef-8db9-f36cf822d43b" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "bf29306c-07fd-47eb-ab1c-749cdc10fcb7" }, "RequestBody": null, "StatusCode": 200, @@ -18,16 +18,16 @@ "Content-Encoding": "gzip", "Content-Length": "225", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 03 Nov 2022 05:32:08 GMT", + "Date": "Wed, 09 Nov 2022 07:39:51 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "24a69f0b-d907-4b0c-9fb2-b497debb297f", + "x-ms-correlation-request-id": "5dddafa9-28b4-49aa-92bf-3bbf12869f91", "x-ms-ratelimit-remaining-subscription-reads": "11999", - "x-ms-request-id": "24a69f0b-d907-4b0c-9fb2-b497debb297f", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053209Z:24a69f0b-d907-4b0c-9fb2-b497debb297f" + "x-ms-request-id": "5dddafa9-28b4-49aa-92bf-3bbf12869f91", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073951Z:5dddafa9-28b4-49aa-92bf-3bbf12869f91" }, "ResponseBody": { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.json index f72fc676e148..c3e5eebd4ded 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.json @@ -8,26 +8,26 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "ee123806-d63c-451b-9a70-8f12e78d1833" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "21dcd0a2-f954-4ebd-b8ac-b0eaf1717dba" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Encoding": "gzip", - "Content-Length": "5265", + "Content-Length": "8628", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 03 Nov 2022 05:32:09 GMT", + "Date": "Wed, 09 Nov 2022 07:39:51 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "fe2fb4a9-1643-47d8-b2ed-f130ad6cec95", + "x-ms-correlation-request-id": "f9bae0ed-705b-49a6-9a9b-7018d834efca", "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "fe2fb4a9-1643-47d8-b2ed-f130ad6cec95", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053209Z:fe2fb4a9-1643-47d8-b2ed-f130ad6cec95" + "x-ms-request-id": "f9bae0ed-705b-49a6-9a9b-7018d834efca", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073951Z:f9bae0ed-705b-49a6-9a9b-7018d834efca" }, "ResponseBody": { "value": [ @@ -245,6 +245,145 @@ "provisioningState": "Succeeded" } }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-257", + "name": "go-sdk-test-257", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-805", + "name": "go-sdk-test-805", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-951", + "name": "go-sdk-test-951", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-676", + "name": "go-sdk-test-676", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-694", + "name": "go-sdk-test-694", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-728", + "name": "go-sdk-test-728", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-78", + "name": "go-sdk-test-78", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-836", + "name": "go-sdk-test-836", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-160", + "name": "go-sdk-test-160", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-721", + "name": "go-sdk-test-721", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-298", + "name": "go-sdk-test-298", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-385", + "name": "go-sdk-test-385", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-959", + "name": "go-sdk-test-959", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/managed-rg-qiaozhamatest", + "name": "managed-rg-qiaozhamatest", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "managedBy": "/subscriptions/azure_subscription_id/resourceGroups/qiaozhatest/providers/Microsoft.Purview/accounts/qiaozhamatest", + "tags": { + "test": "test" + }, + "properties": { + "provisioningState": "Succeeded" + } + }, + { + "id": "/subscriptions/azure_subscription_id/resourceGroups/go-sdk-test-647", + "name": "go-sdk-test-647", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus", + "properties": { + "provisioningState": "Succeeded" + } + }, { "id": "/subscriptions/azure_subscription_id/resourceGroups/ApiExplorer", "name": "ApiExplorer", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.json index fee54a36dcf4..a4f476d738d2 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.json @@ -10,8 +10,8 @@ "Connection": "keep-alive", "Content-Length": "42", "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "48b9a9a1-e873-4bd5-8185-d57d22e98c92" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "f7fa4f19-2733-4614-9707-eb69ec4ca6a0" }, "RequestBody": { "tags": { @@ -24,17 +24,17 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 03 Nov 2022 05:32:11 GMT", + "Date": "Wed, 09 Nov 2022 07:39:53 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "3963f24a-dc8e-4804-a340-f4cfb345e160", + "x-ms-correlation-request-id": "a36f3a13-ea3c-4dd1-b8fb-090add872aa4", "x-ms-ratelimit-remaining-subscription-writes": "1198", - "x-ms-request-id": "3963f24a-dc8e-4804-a340-f4cfb345e160", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053211Z:3963f24a-dc8e-4804-a340-f4cfb345e160" + "x-ms-request-id": "a36f3a13-ea3c-4dd1-b8fb-090add872aa4", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073953Z:a36f3a13-ea3c-4dd1-b8fb-090add872aa4" }, "ResponseBody": { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.json index 725f0c746270..59d8a52344f9 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.json @@ -9,8 +9,8 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "Content-Length": "0", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "9542bc9d-12c0-43e7-ad7c-4064b405798d" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "fbdebfdd-49a5-454f-8571-1df014c3f4cf" }, "RequestBody": null, "StatusCode": 200, @@ -18,17 +18,17 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 03 Nov 2022 05:32:13 GMT", + "Date": "Wed, 09 Nov 2022 07:39:56 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "5b03969c-5c8a-4150-ac73-715ae59b84f0", + "x-ms-correlation-request-id": "ea91276d-6e60-4041-b744-0032da25649c", "x-ms-ratelimit-remaining-subscription-writes": "1197", - "x-ms-request-id": "5b03969c-5c8a-4150-ac73-715ae59b84f0", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053214Z:5b03969c-5c8a-4150-ac73-715ae59b84f0" + "x-ms-request-id": "ea91276d-6e60-4041-b744-0032da25649c", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073956Z:ea91276d-6e60-4041-b744-0032da25649c" }, "ResponseBody": { "id": "/subscriptions/azure_subscription_id/tagNames/tagyyy", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.json index 1b8843544684..7f3b6f754023 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.json @@ -8,23 +8,23 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "46471654-b239-42e2-b548-1b9148c4c987" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "fc0e604b-4b42-4dbe-9b66-04ffd981d3bc" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Thu, 03 Nov 2022 05:32:20 GMT", + "Date": "Wed, 09 Nov 2022 07:40:01 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "8cb2ef67-caff-4840-b4cd-9b4a090c37ef", + "x-ms-correlation-request-id": "a8ec7ef6-c14f-4562-aa75-c82bf182c8a4", "x-ms-ratelimit-remaining-subscription-deletes": "14999", - "x-ms-request-id": "8cb2ef67-caff-4840-b4cd-9b4a090c37ef", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053220Z:8cb2ef67-caff-4840-b4cd-9b4a090c37ef" + "x-ms-request-id": "a8ec7ef6-c14f-4562-aa75-c82bf182c8a4", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074001Z:a8ec7ef6-c14f-4562-aa75-c82bf182c8a4" }, "ResponseBody": null }, @@ -36,26 +36,26 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "95095a7f-bc4d-4b4e-b5ea-c71b11f2c2c9" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "485288ed-54de-4a77-b8ce-86566dd26fcc" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Encoding": "gzip", - "Content-Length": "5000", + "Content-Length": "5550", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 03 Nov 2022 05:32:20 GMT", + "Date": "Wed, 09 Nov 2022 07:40:01 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "cb52b61a-d426-4a74-a8d3-0c36b3cf7577", + "x-ms-correlation-request-id": "e7a7dce1-eb1d-4ef7-a641-50659f80873b", "x-ms-ratelimit-remaining-subscription-reads": "11995", - "x-ms-request-id": "cb52b61a-d426-4a74-a8d3-0c36b3cf7577", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053220Z:cb52b61a-d426-4a74-a8d3-0c36b3cf7577" + "x-ms-request-id": "e7a7dce1-eb1d-4ef7-a641-50659f80873b", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074001Z:e7a7dce1-eb1d-4ef7-a641-50659f80873b" }, "ResponseBody": { "value": [ @@ -136,7 +136,7 @@ "tagName": "key1", "count": { "type": "Total", - "value": 1 + "value": 4 }, "values": [ { @@ -144,7 +144,7 @@ "tagValue": "value1", "count": { "type": "Total", - "value": 1 + "value": 4 } } ] @@ -265,6 +265,42 @@ } ] }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/test", + "tagName": "test", + "count": { + "type": "Total", + "value": 3 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/test/tagValues/test", + "tagValue": "test", + "count": { + "type": "Total", + "value": 3 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/additionalProperties", + "tagName": "additionalProperties", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/additionalProperties/tagValues/Tag1", + "tagValue": "Tag1", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, { "id": "/subscriptions/azure_subscription_id/tagNames/tag2597940633", "tagName": "tag2597940633", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.json index dc155897d791..241d9b136ac2 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.json @@ -8,8 +8,8 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "b57de260-360e-4291-8a70-871b2072f38b" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "1ece2a42-fbb1-4338-bf70-e9ebe0ee0929" }, "RequestBody": null, "StatusCode": 200, @@ -18,16 +18,16 @@ "Content-Encoding": "gzip", "Content-Length": "220", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 03 Nov 2022 05:32:14 GMT", + "Date": "Wed, 09 Nov 2022 07:39:57 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "95b8874e-269e-4c49-b3dd-0cccee1d11a3", + "x-ms-correlation-request-id": "284f1326-43b1-4ced-b574-34243454a5f6", "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "95b8874e-269e-4c49-b3dd-0cccee1d11a3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053214Z:95b8874e-269e-4c49-b3dd-0cccee1d11a3" + "x-ms-request-id": "284f1326-43b1-4ced-b574-34243454a5f6", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073957Z:284f1326-43b1-4ced-b574-34243454a5f6" }, "ResponseBody": { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1/providers/Microsoft.Resources/tags/default", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.json index 19308866824a..d59f2e26f808 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.json @@ -8,26 +8,26 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "e9628920-20aa-450a-a06c-9ac1e190558c" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "a811c75c-c2fb-4220-87b3-05819e4de4e0" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Encoding": "gzip", - "Content-Length": "5000", + "Content-Length": "5550", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 03 Nov 2022 05:32:15 GMT", + "Date": "Wed, 09 Nov 2022 07:39:58 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "a944ef05-6d17-412a-b5bb-d792a5d9add8", + "x-ms-correlation-request-id": "113ce0a6-faf2-49fb-a510-1a3f5222198a", "x-ms-ratelimit-remaining-subscription-reads": "11996", - "x-ms-request-id": "a944ef05-6d17-412a-b5bb-d792a5d9add8", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053215Z:a944ef05-6d17-412a-b5bb-d792a5d9add8" + "x-ms-request-id": "113ce0a6-faf2-49fb-a510-1a3f5222198a", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073958Z:113ce0a6-faf2-49fb-a510-1a3f5222198a" }, "ResponseBody": { "value": [ @@ -108,7 +108,7 @@ "tagName": "key1", "count": { "type": "Total", - "value": 1 + "value": 4 }, "values": [ { @@ -116,7 +116,7 @@ "tagValue": "value1", "count": { "type": "Total", - "value": 1 + "value": 4 } } ] @@ -237,6 +237,42 @@ } ] }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/test", + "tagName": "test", + "count": { + "type": "Total", + "value": 3 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/test/tagValues/test", + "tagValue": "test", + "count": { + "type": "Total", + "value": 3 + } + } + ] + }, + { + "id": "/subscriptions/azure_subscription_id/tagNames/additionalProperties", + "tagName": "additionalProperties", + "count": { + "type": "Total", + "value": 1 + }, + "values": [ + { + "id": "/subscriptions/azure_subscription_id/tagNames/additionalProperties/tagValues/Tag1", + "tagValue": "Tag1", + "count": { + "type": "Total", + "value": 1 + } + } + ] + }, { "id": "/subscriptions/azure_subscription_id/tagNames/tag2597940633", "tagName": "tag2597940633", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.json index 47b4c5f80cee..e987d560846e 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.json @@ -10,8 +10,8 @@ "Connection": "keep-alive", "Content-Length": "68", "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "95db16c2-d91a-43aa-aad3-f96e09de8b22" + "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "84de42df-4544-42f7-88c0-453c2d16b7a3" }, "RequestBody": { "operation": "Delete", @@ -26,17 +26,17 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 03 Nov 2022 05:32:18 GMT", + "Date": "Wed, 09 Nov 2022 07:39:59 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "fd30a572-7144-48fe-8462-a9529b8d74d0", + "x-ms-correlation-request-id": "cbff8c12-fcb3-460e-80f8-2f02585b0cee", "x-ms-ratelimit-remaining-subscription-writes": "1196", - "x-ms-request-id": "fd30a572-7144-48fe-8462-a9529b8d74d0", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221103T053218Z:fd30a572-7144-48fe-8462-a9529b8d74d0" + "x-ms-request-id": "cbff8c12-fcb3-460e-80f8-2f02585b0cee", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073959Z:cbff8c12-fcb3-460e-80f8-2f02585b0cee" }, "ResponseBody": { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1/providers/Microsoft.Resources/tags/default", diff --git a/sdk/resources/arm-resources/src/resourceManagementClient.ts b/sdk/resources/arm-resources/src/resourceManagementClient.ts index 51788a0bfc36..988d5e9f4695 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClient.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClient.ts @@ -74,16 +74,13 @@ export class ResourceManagementClient extends coreClient.ServiceClient { ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - if (!options.credentialScopes) { - options.credentialScopes = ["https://management.azure.com/.default"]; - } const optionsWithDefaults = { ...defaults, ...options, userAgentOptions: { userAgentPrefix }, - baseUri: + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); @@ -109,7 +106,9 @@ export class ResourceManagementClient extends coreClient.ServiceClient { this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, - scopes: `${optionsWithDefaults.credentialScopes}`, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge diff --git a/sdk/resources/arm-resources/test/resources_examples.ts b/sdk/resources/arm-resources/test/resources_examples.ts index da6dcef8788c..e7f5da95cdad 100644 --- a/sdk/resources/arm-resources/test/resources_examples.ts +++ b/sdk/resources/arm-resources/test/resources_examples.ts @@ -128,7 +128,7 @@ describe("Resources test", () => { for await (let item of client.tagsOperations.list()) { resArray.push(item); } - assert.equal(resArray.length, 19); + assert.equal(resArray.length, 21); }); it("resourceGroups delete test", async function () { From d376331690a5bd2d64c23aea1ffae25a53989507 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Thu, 10 Nov 2022 14:00:17 +0800 Subject: [PATCH 4/5] update files --- common/config/rush/pnpm-lock.yaml | 22 +- sdk/resources/arm-resources/CHANGELOG.md | 2 +- sdk/resources/arm-resources/_meta.json | 8 +- sdk/resources/arm-resources/package.json | 2 +- .../recording_resourcegroups_create_test.js | 145 ----- .../recording_resourcegroups_create_test.json | 10 +- .../recording_resourcegroups_delete_test.js | 525 ------------------ .../recording_resourcegroups_delete_test.json | 90 +-- .../recording_resourcegroups_get_test.js | 145 ----- .../recording_resourcegroups_get_test.json | 10 +- .../recording_resourcegroups_list_test.js | 145 ----- .../recording_resourcegroups_list_test.json | 10 +- .../recording_resourcegroups_update_test.js | 145 ----- .../recording_resourcegroups_update_test.json | 10 +- .../recording_tagsoperations_create_test.js | 145 ----- .../recording_tagsoperations_create_test.json | 10 +- .../recording_tagsoperations_delete_test.js | 173 ------ .../recording_tagsoperations_delete_test.json | 20 +- .../recording_tagsoperations_get_test.js | 145 ----- .../recording_tagsoperations_get_test.json | 10 +- .../recording_tagsoperations_list_test.js | 145 ----- .../recording_tagsoperations_list_test.json | 10 +- .../recording_tagsoperations_update_test.js | 145 ----- .../recording_tagsoperations_update_test.json | 10 +- ...mentsWhatIfAtManagementGroupScopeSample.ts | 6 +- ...loymentsWhatIfAtSubscriptionScopeSample.ts | 6 +- .../deploymentsWhatIfAtTenantScopeSample.ts | 6 +- .../samples-dev/deploymentsWhatIfSample.ts | 6 +- .../samples/v5/javascript/README.md | 88 --- .../deploymentsCalculateTemplateHashSample.js | 43 -- ...ateOrUpdateAtManagementGroupScopeSample.js | 42 -- .../deploymentsCreateOrUpdateAtScopeSample.js | 43 -- ...CreateOrUpdateAtSubscriptionScopeSample.js | 42 -- ...ymentsCreateOrUpdateAtTenantScopeSample.js | 41 -- .../deploymentsCreateOrUpdateSample.js | 139 ----- ...mentsWhatIfAtManagementGroupScopeSample.js | 42 -- ...loymentsWhatIfAtSubscriptionScopeSample.js | 40 -- .../deploymentsWhatIfAtTenantScopeSample.js | 40 -- .../v5/javascript/deploymentsWhatIfSample.js | 41 -- .../samples/v5/javascript/package.json | 32 -- .../providerResourceTypesListSample.js | 29 - .../providersGetAtTenantScopeSample.js | 31 -- .../v5/javascript/providersGetSample.js | 29 - .../v5/javascript/providersListSample.js | 31 -- .../providersProviderPermissionsSample.js | 29 - .../resourceGroupsCreateOrUpdateSample.js | 30 - .../javascript/resourceGroupsDeleteSample.js | 51 -- .../resourceGroupsExportTemplateSample.js | 62 --- .../samples/v5/javascript/sample.env | 4 - .../tagsCreateOrUpdateAtScopeSample.js | 53 -- .../v5/javascript/tagsGetAtScopeSample.js | 47 -- .../samples/v5/typescript/README.md | 101 ---- .../samples/v5/typescript/package.json | 41 -- .../samples/v5/typescript/sample.env | 4 - .../deploymentsCalculateTemplateHashSample.ts | 43 -- ...ateOrUpdateAtManagementGroupScopeSample.ts | 45 -- .../deploymentsCreateOrUpdateAtScopeSample.ts | 44 -- ...CreateOrUpdateAtSubscriptionScopeSample.ts | 45 -- ...ymentsCreateOrUpdateAtTenantScopeSample.ts | 44 -- .../src/deploymentsCreateOrUpdateSample.ts | 148 ----- ...mentsWhatIfAtManagementGroupScopeSample.ts | 45 -- ...loymentsWhatIfAtSubscriptionScopeSample.ts | 43 -- .../deploymentsWhatIfAtTenantScopeSample.ts | 43 -- .../typescript/src/deploymentsWhatIfSample.ts | 44 -- .../src/providerResourceTypesListSample.ts | 31 -- .../src/providersGetAtTenantScopeSample.ts | 37 -- .../v5/typescript/src/providersGetSample.ts | 29 - .../v5/typescript/src/providersListSample.ts | 31 -- .../src/providersProviderPermissionsSample.ts | 31 -- .../src/resourceGroupsCreateOrUpdateSample.ts | 33 -- .../src/resourceGroupsDeleteSample.ts | 62 --- .../src/resourceGroupsExportTemplateSample.ts | 65 --- .../src/tagsCreateOrUpdateAtScopeSample.ts | 59 -- .../v5/typescript/src/tagsGetAtScopeSample.ts | 47 -- .../samples/v5/typescript/tsconfig.json | 17 - .../arm-resources/src/models/index.ts | 4 +- .../arm-resources/src/operations/providers.ts | 5 +- .../arm-resources/src/operations/resources.ts | 4 +- .../src/operationsInterfaces/providers.ts | 5 +- .../src/operationsInterfaces/resources.ts | 4 +- 80 files changed, 130 insertions(+), 4159 deletions(-) delete mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.js delete mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.js delete mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.js delete mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.js delete mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.js delete mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.js delete mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.js delete mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.js delete mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.js delete mode 100644 sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/README.md delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/package.json delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/sample.env delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/README.md delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/package.json delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/sample.env delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts delete mode 100644 sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index a7d1b637cfff..1d2a945fb08a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -814,6 +814,21 @@ packages: - supports-color dev: false + /@azure/arm-resources/5.0.1: + resolution: {integrity: sha512-JbZtIqfEulsIA0rC3zM7jfF4KkOnye9aKcaO/jJqxJRm/gM6lAjEv7sL4njW8D+35l50P1f+UuH5OqN+UKJqNA==} + engines: {node: '>=12.0.0'} + dependencies: + '@azure/abort-controller': 1.1.0 + '@azure/core-auth': 1.4.0 + '@azure/core-client': 1.6.1 + '@azure/core-lro': 2.4.0 + '@azure/core-paging': 1.4.0 + '@azure/core-rest-pipeline': 1.10.0 + tslib: 2.4.1 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/arm-storage/17.2.1: resolution: {integrity: sha512-J2jmTPv8ZraSHDTz9l2Bx8gNL3ktfDDWo2mxWfzarn64O9Fjhb+l85YWyubGy2xUdeGuZPKzvQLltGv8bSu8eQ==} engines: {node: '>=12.0.0'} @@ -12675,11 +12690,12 @@ packages: dev: false file:projects/arm-links.tgz: - resolution: {integrity: sha512-Vdb/Dd+9IFLd8/yto66fCWhX5yjLE+N/v5pxRCYm6PaaUfLPJLXLxHgnqRlEAl++bMBr5CF0qRZPPBo3X/TNLQ==, tarball: file:projects/arm-links.tgz} + resolution: {integrity: sha512-dA1SMN8GHZj+2vmT2rgeid6pvkP3DUoWQdzbhxPrJ5QgAgjA1dZ4yckeIgZEo8z93ZWD9LP8/QJVWHccEEdwVA==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/arm-resources': 5.0.1 '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.33.5 '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 @@ -14314,7 +14330,7 @@ packages: dev: false file:projects/arm-resources.tgz: - resolution: {integrity: sha512-/bqYSaWaEdRslQxOTwX1YyA5RPcx4lnudPwrfuHMh7wXCgUHovGr6ep9Fy6Jl4p//M/VhThT8FYrPhXBYrJd/w==, tarball: file:projects/arm-resources.tgz} + resolution: {integrity: sha512-yfRrlJ8rdEfD5Lv7DEpuf/mk41z8JL6zjl4huSgddGNRHVCj0qK7OQsfRqpiySY240MvR9b1Ox97J34jKrErBg==, tarball: file:projects/arm-resources.tgz} name: '@rush-temp/arm-resources' version: 0.0.0 dependencies: @@ -14335,7 +14351,7 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444 tslib: 2.4.1 - typescript: 4.6.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - supports-color diff --git a/sdk/resources/arm-resources/CHANGELOG.md b/sdk/resources/arm-resources/CHANGELOG.md index a47456ced952..9629d6a565e3 100644 --- a/sdk/resources/arm-resources/CHANGELOG.md +++ b/sdk/resources/arm-resources/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 5.1.0 (2022-11-09) +## 5.1.0 (2022-11-10) **Features** diff --git a/sdk/resources/arm-resources/_meta.json b/sdk/resources/arm-resources/_meta.json index feb32f3aaaf1..4b98b8203a1f 100644 --- a/sdk/resources/arm-resources/_meta.json +++ b/sdk/resources/arm-resources/_meta.json @@ -1,8 +1,8 @@ { - "commit": "ae9cb5a65ff4dba1d626ed0a1bb4e94dd17583e8", - "readme": "specification/resources/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221103.1 --generate-sample=true", + "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", + "readme": "specification\\resources\\resource-manager\\readme.md", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221103.1" + "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" } \ No newline at end of file diff --git a/sdk/resources/arm-resources/package.json b/sdk/resources/arm-resources/package.json index 658a6ef2e0b5..40aab7586b3a 100644 --- a/sdk/resources/arm-resources/package.json +++ b/sdk/resources/arm-resources/package.json @@ -36,7 +36,7 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.6.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.js b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.js deleted file mode 100644 index 5460491f50b0..000000000000 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.js +++ /dev/null @@ -1,145 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "14c4c5a5a013a0a15c05e8fedab388cc"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '06e8a334-c653-458a-90ba-720269964800', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR2 ProdSlices', - 'Set-Cookie', - 'fpc=AkubDs8ysmpIsZ1pwTG3kWo; expires=Fri, 31-Dec-2021 02:42:57 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrCVFdRcAdwCo5hEAX8TTTnO6iR4geImmeb3AHXd-pJlannzGPhExNnbqZlPJmVpeYJCPlLC8xk_OW93E7pj5oqrdlPFfgcU1mr3T317lEZL0r-GomxkU3s31jRkaRpToe0KxASP0CLw6kRPY8zk8RcNWuPwvwzg4hfkEcr_he-98gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:57 GMT', - 'Content-Length', - '980' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'badfe93a-df4d-4f45-89c4-d13f27c44500', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR1 ProdSlices', - 'Set-Cookie', - 'fpc=AjqImDy-nlxMp_4FUvjzIdY; expires=Fri, 31-Dec-2021 02:42:57 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrC2I4dWlqtK6MoWBvb0uQ1Mh-wACu2jfxjeQvBwPoZq3_1FogOe8PsLY4Fw6EZEYu96Z9q-6Ayr8YbdVbPZ5fKkYxjy3mLUUasy0v-en0o2jxp3oIRj2lVqnve7CsbW8p7Y8TR0CXgQ5Xs6Nb75wjsA_8Y44CELhgS3_u_vubptMgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:57 GMT', - 'Content-Length', - '1753' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=2688783f-bcd4-406d-b9a9-6b1d1c8b3222&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '5c20cdd3-2e65-4999-871b-c936da833300', - 'x-ms-ests-server', - '2.1.12249.14 - SEASLR1 ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=AuEMAFotcolAtWKvW8M6JD4WPr5BAQAAADHYONkOAAAA; expires=Fri, 31-Dec-2021 02:42:57 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:57 GMT', - 'Content-Length', - '1374' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .put('/subscriptions/azure_subscription_id/resourcegroups/myjstest', {"location":"eastus","tags":{"tag1":"value1"}}) - .query(true) - .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc693f1a7db4cc163901f53e69af57f8e48b625a574d75de8e5fe9cb4d070cb52dab690634a87d9e35ed1a9fb5d945f3d1a35f8c9fbbf4f96556aef3dd8f7ec9e8a3555dadf2ba2d72fe9afeba2c1a7ab7585ebc6eb3167dbe5e4fa7793ecb671ffd92","5ff2ff00b20f9e64ee000000"], [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Encoding', - 'gzip', - 'Expires', - '-1', - 'Vary', - 'Accept-Encoding', - 'x-ms-ratelimit-remaining-subscription-writes', - '1197', - 'x-ms-request-id', - 'fed966e1-813f-40b7-9159-fa939fc96f1f', - 'x-ms-correlation-request-id', - 'fed966e1-813f-40b7-9159-fa939fc96f1f', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024259Z:fed966e1-813f-40b7-9159-fa939fc96f1f', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:42:58 GMT' -]); diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.json index d9ddda636e27..7ba6a080a1b5 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_create_test.json @@ -11,7 +11,7 @@ "Content-Length": "46", "Content-Type": "application/json", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "b4397320-c321-4416-85c6-a69a60795490" + "x-ms-client-request-id": "eae9c15a-0025-4138-93c1-9bd865e0a08a" }, "RequestBody": { "location": "eastus", @@ -24,15 +24,15 @@ "Cache-Control": "no-cache", "Content-Length": "225", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 09 Nov 2022 07:39:50 GMT", + "Date": "Thu, 10 Nov 2022 05:57:41 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "6d33b9d8-daac-459c-8fcd-edbf549bd4ec", + "x-ms-correlation-request-id": "100ad11c-0cee-40d7-af8e-cbd227fa7a04", "x-ms-ratelimit-remaining-subscription-writes": "1199", - "x-ms-request-id": "6d33b9d8-daac-459c-8fcd-edbf549bd4ec", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073950Z:6d33b9d8-daac-459c-8fcd-edbf549bd4ec" + "x-ms-request-id": "100ad11c-0cee-40d7-af8e-cbd227fa7a04", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055741Z:100ad11c-0cee-40d7-af8e-cbd227fa7a04" }, "ResponseBody": { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.js b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.js deleted file mode 100644 index a79694bd7adc..000000000000 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.js +++ /dev/null @@ -1,525 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "d70431774b4bad6d5046b10e20830f7c"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '54d4de93-04fa-42b5-8de4-5f95c4743300', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR2 ProdSlices', - 'Set-Cookie', - 'fpc=ArWDFWPvOJlBtXxfQYq2WV8; expires=Fri, 31-Dec-2021 02:43:03 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrGbNJXP0bKWrRSwYtmAKaXA4B6oz4l3arsH4_sAuq3fNcwf6WHTpApzwCYcx0ojMzbgjqtKd4IhlqJAb-L938iuY27zgOtBwzBJHL_v8cu6KeCzpdh58ISopxKe8RfS6RxtHvdk-TvRdCy2oZpx8Zcz-A-yFhv4bkYjOUYWedWfEgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:43:03 GMT', - 'Content-Length', - '980' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '93ef7e08-1935-4d62-bd81-4c498c1d4700', - 'x-ms-ests-server', - '2.1.12249.14 - SEASLR2 ProdSlices', - 'Set-Cookie', - 'fpc=AkYL94mhhfBLvQT_bHvND4U; expires=Fri, 31-Dec-2021 02:43:03 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevryApUtukIm0W53KKONiNx8jZbam8kHRe171HEz47b5LPuV9mhOVu3cFMKi8reGRCBhMFq1Dj-1jVz-U07ltS4FPUqAwpkPDIbp_AQQKb9Bm-LWtq_94MoQAocCfpHtu4ixPRUJ2VQu0rwVzUQe99YqygoG9IDd6RLVgs26oBrUKogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:43:03 GMT', - 'Content-Length', - '1753' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=d29af13e-9738-4ffd-a502-33c4218c6422&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '06e8a334-c653-458a-90ba-7202a7964800', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR2 ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=AmLm50YchoZBgbV15UsUCNkWPr5BAQAAADfYONkOAAAA; expires=Fri, 31-Dec-2021 02:43:04 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:43:04 GMT', - 'Content-Length', - '1374' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .delete('/subscriptions/azure_subscription_id/resourcegroups/myjstest') - .query(true) - .reply(202, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'Location', - 'https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2021-04-01', - 'Retry-After', - '0', - 'x-ms-ratelimit-remaining-subscription-deletes', - '14998', - 'x-ms-request-id', - '2f6d2a39-69c3-426e-8f25-5ea1304f8ea4', - 'x-ms-correlation-request-id', - '2f6d2a39-69c3-426e-8f25-5ea1304f8ea4', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024307Z:2f6d2a39-69c3-426e-8f25-5ea1304f8ea4', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:06 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9') - .query(true) - .reply(202, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'Location', - 'https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2021-04-01', - 'Retry-After', - '0', - 'x-ms-ratelimit-remaining-subscription-reads', - '11993', - 'x-ms-request-id', - '0cc1ac61-90b5-41df-aaa6-def66d0ae472', - 'x-ms-correlation-request-id', - '0cc1ac61-90b5-41df-aaa6-def66d0ae472', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024307Z:0cc1ac61-90b5-41df-aaa6-def66d0ae472', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:06 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9') - .query(true) - .reply(202, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'Location', - 'https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2021-04-01', - 'Retry-After', - '0', - 'x-ms-ratelimit-remaining-subscription-reads', - '11992', - 'x-ms-request-id', - 'ff06dbce-534a-4fcf-8e5d-072741042884', - 'x-ms-correlation-request-id', - 'ff06dbce-534a-4fcf-8e5d-072741042884', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024308Z:ff06dbce-534a-4fcf-8e5d-072741042884', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:07 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9') - .query(true) - .reply(202, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'Location', - 'https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2021-04-01', - 'Retry-After', - '0', - 'x-ms-ratelimit-remaining-subscription-reads', - '11991', - 'x-ms-request-id', - '6f69947c-aa97-45d1-8b27-9d3e9346552f', - 'x-ms-correlation-request-id', - '6f69947c-aa97-45d1-8b27-9d3e9346552f', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024308Z:6f69947c-aa97-45d1-8b27-9d3e9346552f', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:08 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9') - .query(true) - .reply(202, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'Location', - 'https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2021-04-01', - 'Retry-After', - '0', - 'x-ms-ratelimit-remaining-subscription-reads', - '11990', - 'x-ms-request-id', - 'd0eee467-f383-49cf-8141-83662514b282', - 'x-ms-correlation-request-id', - 'd0eee467-f383-49cf-8141-83662514b282', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024309Z:d0eee467-f383-49cf-8141-83662514b282', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:08 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9') - .query(true) - .reply(202, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'Location', - 'https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2021-04-01', - 'Retry-After', - '0', - 'x-ms-ratelimit-remaining-subscription-reads', - '11989', - 'x-ms-request-id', - '0250e4c3-0c11-4f9c-8f28-b70f93220515', - 'x-ms-correlation-request-id', - '0250e4c3-0c11-4f9c-8f28-b70f93220515', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024309Z:0250e4c3-0c11-4f9c-8f28-b70f93220515', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:09 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9') - .query(true) - .reply(202, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'Location', - 'https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2021-04-01', - 'Retry-After', - '0', - 'x-ms-ratelimit-remaining-subscription-reads', - '11988', - 'x-ms-request-id', - 'fe4be86c-6c2a-4042-98ef-44d75ed09b55', - 'x-ms-correlation-request-id', - 'fe4be86c-6c2a-4042-98ef-44d75ed09b55', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024310Z:fe4be86c-6c2a-4042-98ef-44d75ed09b55', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:09 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9') - .query(true) - .reply(202, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'Location', - 'https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2021-04-01', - 'Retry-After', - '0', - 'x-ms-ratelimit-remaining-subscription-reads', - '11987', - 'x-ms-request-id', - '2cbd7548-94c4-429d-8596-a4141d5ddb81', - 'x-ms-correlation-request-id', - '2cbd7548-94c4-429d-8596-a4141d5ddb81', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024311Z:2cbd7548-94c4-429d-8596-a4141d5ddb81', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:10 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9') - .query(true) - .reply(202, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'Location', - 'https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2021-04-01', - 'Retry-After', - '0', - 'x-ms-ratelimit-remaining-subscription-reads', - '11986', - 'x-ms-request-id', - '639ed7a3-2b8b-4801-983f-d33581cd948f', - 'x-ms-correlation-request-id', - '639ed7a3-2b8b-4801-983f-d33581cd948f', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024311Z:639ed7a3-2b8b-4801-983f-d33581cd948f', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:10 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9') - .query(true) - .reply(202, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'Location', - 'https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2021-04-01', - 'Retry-After', - '0', - 'x-ms-ratelimit-remaining-subscription-reads', - '11985', - 'x-ms-request-id', - 'e4ce8717-3d4f-4a3d-9682-e2aef9bdba9c', - 'x-ms-correlation-request-id', - 'e4ce8717-3d4f-4a3d-9682-e2aef9bdba9c', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024312Z:e4ce8717-3d4f-4a3d-9682-e2aef9bdba9c', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:11 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9') - .query(true) - .reply(202, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'Location', - 'https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2021-04-01', - 'Retry-After', - '0', - 'x-ms-ratelimit-remaining-subscription-reads', - '11984', - 'x-ms-request-id', - '943a8b89-49c6-4fbd-8fff-b6753b785223', - 'x-ms-correlation-request-id', - '943a8b89-49c6-4fbd-8fff-b6753b785223', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024312Z:943a8b89-49c6-4fbd-8fff-b6753b785223', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:12 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVC1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9') - .query(true) - .reply(200, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'x-ms-ratelimit-remaining-subscription-reads', - '11983', - 'x-ms-request-id', - '0f4e5ff6-d94b-4377-a31b-5977e79a072a', - 'x-ms-correlation-request-id', - '0f4e5ff6-d94b-4377-a31b-5977e79a072a', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024313Z:0f4e5ff6-d94b-4377-a31b-5977e79a072a', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:12 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/resourcegroups') - .query(true) - .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bd5ffc5131fbe8d147779bf5a499d6c5aa2daa6573f7e1def9c3fbb383f3ed7bd34f1f6cefefeeed6f3fdc9d3ed83e989eef3c98ce26e77bfbbb77ebbca9d6f534ffbcaed6abe66e337bbbbdccdbed366fdaed5f94ed7d34fa68992da88f8f22dfb4d72b7cf34531adaba63a6fc7af1458d3014b6dcb6a9a012d6a9f674dbbc6676d76d17cf4e817ff92d147abba5ae5755be4f81b7f5d160d352e9617afdbac4527afd7d3699ecff2d947bfe4978cbeb9f116d7e54fcff6aedaea17cdf7efcdf27ab97fafc9ae7eb0f845efdee6595ddc9b4c7f5191cd2ece9b36dfafd6ed4f139cc5a2292febfdebf3abbdcb45ddfca2bca82e1645fbd3342025d5370bf41ba2f2474ff3326ff3e3f336afe9ebbd9dbd9ded9d83edddfb6f761e3cdad97bb4f7e9f8dede83837bfb1ffd5ccec7f10f5ee7d397d9f4edf1baad4eaae57971f1ea731a845276e8eb0fa5118df0e766bc4ff3f36c5db6065dfe74fbf4abd784930e79438bffcf8e9ad8bffac19cba685a4243071a7ef8a16353aeffb9e4e5fa6275bd7d71fffebde9e40757b3bdf983eb8b8bf95ef6f6eae2bc7870af7cbbbfbaae7e7a7fff17bdfbc1249bbf5d14e54fefad3e7d7baf78f060954fb36c71beff8beebfdd7bfbf67e71fe8b1efca09dd1a894543f0b90bf217a13bb76b4cceef62e299a876f76f71fedee3cbab74b6d9fac8b7276062a0352693ef94e35e97ef462bd9830a0e0d357d42bf72e9ffe9ccf713e59ecfff4e5b2b9fc45ab9f2eeeb79f4edaebab07cdbb9fbeb8df3c2896c5bd9f6eaaabe5a43cbf7e502d2fd6fbd73407efe6b3f3eb8b4f57b3f9f5bdc983f96472be9c5e4e17e734447f8ebf59c83fa439deffffe31c67c5fdfbcbcbc9fa07ef3e7d505ed6ebf3f6bcacaa5ff483e5a78bb67efb8bda62ba98edad1fac2e7f30bd3729ef9f37b3f6174d7e7a7ffad365397bdb4ee6d7efde2dafcef3b7b3694d43f4e7f89b85fcc398e3fb9f3eba77406d79a2fe7f34c7b3e2172dee7f7afeb6acebe5a2783bdb5ffff4fdf3eca7dfaeeeefb5d3bde9aa5d5c650faedeadaeb37bef1e4cf77ffafebdd9d5d583457ef936fbc1e4a22aa6cb966667fed3b3f60734447f8ebf59c83f94397ef0e8dea7d49627eaff4773bc77fdd3173f9d4fde5ecedb657b515ffea06d1fdcdf7ff76ebabaff8b26d5fdf3c94fb78b1fb4d3362b26e54fb7fbd79ffea24fcf17edf545fd8ba6e5bbcbe50fc88dbf97e5f5fd9fde8397e2cff1370bf9677f8eef3fdad97db4fbffc739860bf9fb4fcbe2f75f5c2cdadf9f82d6abaa7efbfb9f17757e9595e5efcf5feba7070f09c86e0e8be5cf2537796f083fbb7346911a19d77bf71fdddfa7b64cf8ff1fcdd9bdbdfdf672fa6e42ce6cfeee325b4deebf2df27936b95ccc17d9d52fbafae97bebfa417e3ebd7c57ccf73ebd58de6bafdbfae2ddfdf607f756fbf555d5943fbd9fdf2b7ffad3fa8286e8cfe5370bf967778e452ef71e3edab9476d79a2fe7f34c717b3fb55f6d3efb2f90f5697cd4f5fb6f564afb8f845c583f38b767d7ff2e96cf6d3fbe73f7dbdaaf37bfb3ffd76efe2fea7cbea172daff6ab2cff45f78b7c552cefe5e757f9fdf5f524a321fa73fccd42fe61ccf1bd9dff7fcef12fba57df7f3bb9ba6cdb5f54de9bdd7ff7801cd3fdfb4533dbfbe94531cbceb3bdd54f7ffa83f9bd6c7a55b4ed0f2e9aecfc07f7afafcedb8babbdf3a6c9af1f4c160f286ff683bd2b1aa23fc7df2ce41fd21cdf439e9427eaff47733cbfbecedbe5e4fa0189dc058d7f92b53fd8bb3c3fbfdedf9b2fe79faecbe583d9836c7df1f6fcfc7e7e2f7b3b230aff60b9ffe94f67f38b6c3269eebdbb7cf083f5457bfef61d0dd19fe36f16f20f658e771feddda7b63c51ff3f9ae37bd37cff6279fee041565e5ecfdafad359f38b3e2d7e503eb83f9f5f5ce5efee91bb7a55df9bdf5bac2ef62e66d5fdfa6dd3ccaad522cb9af3c52aafd6970f2ed6d7949c0075fc39fe6621ff50e6f8dea3bd1d6acb13f5ffa339fe45f36535dfdf7ffb83c5455edf5b5c15f562f6f6fe2cbff7837bebb76556eecdb34ff39fa660f5fe6c31bbfee9b7f5e4a2985f2d17f7cf57a4441f646f7f7aff6aba9f5dcd8b390dd19fe36f16f20f658e2975f5ffc758e8dddee4ea41bba8aef756d3b70f66ab7bf7effff4bbd5d5deecedf534bf575cff60feeea7dffee017ed3fb8b857edffa28ba6ada6f79af37276717faf9d2c3e6ddf4edb72fa6efdf6c1644d43f4e7f89b85fc439ae3bdff3ffa5cedbdeb7245e9c377ed79b597b7f3b7f756f7ee3d382fef5d4c96f90fee519e69feaedeffc1a76fdb1fccea7bedbdcb2a9f4ce64d71b1f736a375caeaa7d7d307b369b9f8e9fa010dd19fe36f16f20f658ee97fe88b27eaff47739c55d572bddc5facf6f7ae1764267fd066e52f9a4c174493ebf26ab1fec1bcfc4559d93c7877afddcb67d5fafabaca48f626f5b2bafce9d9db79f1837bb309ad085cd558edf1e7f89b85fc4399e34f1fedffffd11e3f98fea0bdffd34d917dba7f2f232fe8fee20775f1e9bbcbf376beb76c2eaab757f7d7ef26c5797b6f9add6fdf65efda7ab12ade5d2cdf9e5fccdebefd458bebfd8b6cffea6d7d8195007f8ebf59c83ffb73fce9a3fbbbf43f6acb13f5ffa339cef2f379bd78777fbd9a3d98cc3fddbf9a65ef566fe7d7976f6b5ae9bbbaf8458b4b8a64defde09296087e70b937dbaf97efdefdf4745a14d7cda70fdad50f7ed1d5fefedeea07f54fe734447f8ebf59c83fbb73bcbbff66f7c1a35dca3fffff3197797ff58b661757b362daaca717b45c7b3edf9fe5e50f7ed17d9aae77ebf65ed1e6e7d9455156ababea6afed3ab9f9e5cfca28b7c72effe0f2eaf66d5f55533fbc1fadd62f2f6ed12abb6f41210fe5980fc439ae3bdff3fe640dafbeb9faef78a4f2fe63f5dfda207f39ab2cbbfe832bfce6929e7dddeeafc17bdcde68bf3abfaedfebb753ebb7abbaee98ffadebde9e5629fd66f3f7d77bd773fa3d5faec073f002569fa80f0cf02e49fe539beff66e7e1a3fdbd47fbff7ff4b9ae7e50e79f5efda2c5747e3e2d2f67cde562f1834f97979f7e3a5fe4453399bcdbabae7f3a6beeddffe9fbd9f4f2edbdebf9f2a7ef4d7f70fde979395fcc57ef2e2717fb93627d35992c6888fe1c7fb3907f4873fcffcb75a772efed0f2e57f3fa7aefb258accfef5f4dd657797e9d5d53f8322b09a962359f16b3aada3f9fec17d3453ecfaf7ff08bf67e5139af8b1fb4cda72466597d7e7fde3e98d010fd39fe6621ffaccf31d616e97fff7fd4d5fbcb65733dbfbc57cd7ed1de64ff174dead9fd76767d7ebfb87fff1765ebd574b2ffd3ab0bea7e7aef9ab2cbf31f64e5fcea9c22dd4ff73e6dab4f7f5135ad7ed0525663b6582053e1cff1370bf98732c7648f0fa82d4fd4ff8fe6b8be9767d349797db52e8ae9c52faadebe5b5c5dddfbc1c5a745d9fca2f52faae68459763d994f9afad3f3d5a7ed7a7eafb8f7e90f2e266d9e53028bd618f6cbfdd97affdef98a86e8cff1370bf98732c7fbffbf8b9d9e925fbb2e5b432cfe74fbbb5fbd265475ae36b4f89a34bfca95e634ce9f9b512fb2657691cfb6eb8bed9f6e5a4227df436ca6231ef8f683460bf5af709f5cd3a7773f7c10bfa8c8aa1fcc894e4d7b976937cbebe6ae43efe5babe2cf2abbbd9745aad976d7337188cb0fbcf25eb35d96255e6dbe6d3ed0b7c8c34b24ec3e0f71f3c1134c8ff170d192baa9b868cef7fc843fefe2ff97f0097e7348e04350000"], [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Encoding', - 'gzip', - 'Expires', - '-1', - 'Vary', - 'Accept-Encoding', - 'x-ms-ratelimit-remaining-subscription-reads', - '11982', - 'x-ms-request-id', - 'ac250935-3a62-4277-84f7-7fc1b7f9be6d', - 'x-ms-correlation-request-id', - 'ac250935-3a62-4277-84f7-7fc1b7f9be6d', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024313Z:ac250935-3a62-4277-84f7-7fc1b7f9be6d', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:12 GMT', - 'Content-Length', - '2799' -]); diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.json index a3140a35890b..95bf548e10d5 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_delete_test.json @@ -9,24 +9,24 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "91ccd3ef-d8a1-49fc-bddf-a13b005bea2d" + "x-ms-client-request-id": "f0a8b846-4341-4d42-a8ab-907977780dbc" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Wed, 09 Nov 2022 07:40:05 GMT", + "Date": "Thu, 10 Nov 2022 05:57:56 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "f3b7cf10-dc94-43b1-b996-c764bde30180", + "x-ms-correlation-request-id": "a7068e54-4191-448f-b1fb-303dc4274bfb", "x-ms-ratelimit-remaining-subscription-deletes": "14998", - "x-ms-request-id": "f3b7cf10-dc94-43b1-b996-c764bde30180", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074005Z:f3b7cf10-dc94-43b1-b996-c764bde30180" + "x-ms-request-id": "a7068e54-4191-448f-b1fb-303dc4274bfb", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055757Z:a7068e54-4191-448f-b1fb-303dc4274bfb" }, "ResponseBody": null }, @@ -39,24 +39,24 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "f209489a-f9ab-49ad-9d07-67b16114c2cf" + "x-ms-client-request-id": "9051152a-c5d7-4399-a1ff-86f20cf8c45c" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Wed, 09 Nov 2022 07:40:06 GMT", + "Date": "Thu, 10 Nov 2022 05:57:57 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "270a6209-2c96-489a-a625-8977e10fc6c5", + "x-ms-correlation-request-id": "55825b55-b348-4cf5-aff7-bfa2dd3380e9", "x-ms-ratelimit-remaining-subscription-reads": "11994", - "x-ms-request-id": "270a6209-2c96-489a-a625-8977e10fc6c5", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074006Z:270a6209-2c96-489a-a625-8977e10fc6c5" + "x-ms-request-id": "55825b55-b348-4cf5-aff7-bfa2dd3380e9", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055757Z:55825b55-b348-4cf5-aff7-bfa2dd3380e9" }, "ResponseBody": null }, @@ -69,24 +69,24 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "9eb92b30-1063-40d5-8028-9dd9f9a05806" + "x-ms-client-request-id": "2750fe51-dafb-494a-9000-8188f1dba2d1" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Wed, 09 Nov 2022 07:40:06 GMT", + "Date": "Thu, 10 Nov 2022 05:57:57 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "42b3b574-8bf1-4b87-b1bc-6af9a7cfbd3c", + "x-ms-correlation-request-id": "19de3b6b-037f-428b-b239-01e31c116ad4", "x-ms-ratelimit-remaining-subscription-reads": "11993", - "x-ms-request-id": "42b3b574-8bf1-4b87-b1bc-6af9a7cfbd3c", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074006Z:42b3b574-8bf1-4b87-b1bc-6af9a7cfbd3c" + "x-ms-request-id": "19de3b6b-037f-428b-b239-01e31c116ad4", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055758Z:19de3b6b-037f-428b-b239-01e31c116ad4" }, "ResponseBody": null }, @@ -99,24 +99,24 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "ebe25d1b-90a5-4229-ae96-1eb469d550b2" + "x-ms-client-request-id": "89abdd14-eb0d-49c2-a307-75ed8798d619" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Wed, 09 Nov 2022 07:40:22 GMT", + "Date": "Thu, 10 Nov 2022 05:58:12 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "bb10ce94-ef09-4a7a-9418-6aec18945336", + "x-ms-correlation-request-id": "b47eec88-5c34-45ce-a6e2-956f821ca0bd", "x-ms-ratelimit-remaining-subscription-reads": "11992", - "x-ms-request-id": "bb10ce94-ef09-4a7a-9418-6aec18945336", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074022Z:bb10ce94-ef09-4a7a-9418-6aec18945336" + "x-ms-request-id": "b47eec88-5c34-45ce-a6e2-956f821ca0bd", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055813Z:b47eec88-5c34-45ce-a6e2-956f821ca0bd" }, "ResponseBody": null }, @@ -129,24 +129,24 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "77087689-c60c-4096-b5d9-9839ea8f838a" + "x-ms-client-request-id": "abfbf64f-bee3-411f-8cd2-e33bb71e7b50" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Wed, 09 Nov 2022 07:40:37 GMT", + "Date": "Thu, 10 Nov 2022 05:58:28 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0528f871-3920-42c6-abac-87b97432c920", + "x-ms-correlation-request-id": "e88ed880-1baf-4272-b47a-c516dbcd9a7b", "x-ms-ratelimit-remaining-subscription-reads": "11991", - "x-ms-request-id": "0528f871-3920-42c6-abac-87b97432c920", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074038Z:0528f871-3920-42c6-abac-87b97432c920" + "x-ms-request-id": "e88ed880-1baf-4272-b47a-c516dbcd9a7b", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055829Z:e88ed880-1baf-4272-b47a-c516dbcd9a7b" }, "ResponseBody": null }, @@ -159,24 +159,24 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "35ff4ecb-af16-45ff-b396-b131523611ae" + "x-ms-client-request-id": "89672b06-8a9c-4bf8-86a2-89e75f3251f9" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Wed, 09 Nov 2022 07:40:52 GMT", + "Date": "Thu, 10 Nov 2022 05:58:44 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "3816b811-9780-4d61-8ed3-b5a59efe1eb7", + "x-ms-correlation-request-id": "084cfaf7-7693-4667-a94a-d584cdfaf626", "x-ms-ratelimit-remaining-subscription-reads": "11990", - "x-ms-request-id": "3816b811-9780-4d61-8ed3-b5a59efe1eb7", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074053Z:3816b811-9780-4d61-8ed3-b5a59efe1eb7" + "x-ms-request-id": "084cfaf7-7693-4667-a94a-d584cdfaf626", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055844Z:084cfaf7-7693-4667-a94a-d584cdfaf626" }, "ResponseBody": null }, @@ -189,24 +189,24 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "81a0d698-a85e-4858-8894-1cd0669c9525" + "x-ms-client-request-id": "4b091d52-7aa7-441b-9c57-4b6304857910" }, "RequestBody": null, "StatusCode": 202, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Wed, 09 Nov 2022 07:41:09 GMT", + "Date": "Thu, 10 Nov 2022 05:59:00 GMT", "Expires": "-1", "Location": "https://management.azure.com/subscriptions/azure_subscription_id/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1NWUpTVEVTVDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2021-04-01", "Pragma": "no-cache", "Retry-After": "15", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "950f92f3-9c12-4c1b-a539-c8180cacf612", + "x-ms-correlation-request-id": "1bf753c7-6ce6-44ba-9918-634d1a69ef39", "x-ms-ratelimit-remaining-subscription-reads": "11989", - "x-ms-request-id": "950f92f3-9c12-4c1b-a539-c8180cacf612", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074109Z:950f92f3-9c12-4c1b-a539-c8180cacf612" + "x-ms-request-id": "1bf753c7-6ce6-44ba-9918-634d1a69ef39", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055900Z:1bf753c7-6ce6-44ba-9918-634d1a69ef39" }, "ResponseBody": null }, @@ -219,22 +219,22 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "40981c14-5650-454d-b55a-b50adf84c30d" + "x-ms-client-request-id": "11e6235f-0285-42fe-82c0-d86ff7a4e48f" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Wed, 09 Nov 2022 07:41:24 GMT", + "Date": "Thu, 10 Nov 2022 05:59:15 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "907c044e-75f7-47cb-9132-1485e203170b", + "x-ms-correlation-request-id": "8b75ba6c-c218-4565-a2b0-f9bcda14ea7e", "x-ms-ratelimit-remaining-subscription-reads": "11988", - "x-ms-request-id": "907c044e-75f7-47cb-9132-1485e203170b", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074125Z:907c044e-75f7-47cb-9132-1485e203170b" + "x-ms-request-id": "8b75ba6c-c218-4565-a2b0-f9bcda14ea7e", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055915Z:8b75ba6c-c218-4565-a2b0-f9bcda14ea7e" }, "ResponseBody": null }, @@ -247,7 +247,7 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "fef661ff-4c99-4314-aacd-6efcfdddd06d" + "x-ms-client-request-id": "ff64df9a-9531-4f03-9083-32f1c85599d4" }, "RequestBody": null, "StatusCode": 200, @@ -256,16 +256,16 @@ "Content-Encoding": "gzip", "Content-Length": "8402", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 09 Nov 2022 07:41:24 GMT", + "Date": "Thu, 10 Nov 2022 05:59:15 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "5845e992-b730-4c36-be79-5e6b4aca9519", + "x-ms-correlation-request-id": "d3596bf5-5ddb-48f9-ac6a-61971951896e", "x-ms-ratelimit-remaining-subscription-reads": "11987", - "x-ms-request-id": "5845e992-b730-4c36-be79-5e6b4aca9519", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074125Z:5845e992-b730-4c36-be79-5e6b4aca9519" + "x-ms-request-id": "d3596bf5-5ddb-48f9-ac6a-61971951896e", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055916Z:d3596bf5-5ddb-48f9-ac6a-61971951896e" }, "ResponseBody": { "value": [ diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.js b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.js deleted file mode 100644 index 8efd5c4b6739..000000000000 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.js +++ /dev/null @@ -1,145 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "3f44beecc129705f2cbe0b314a4a8459"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'badfe93a-df4d-4f45-89c4-d13f3ec44500', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR1 ProdSlices', - 'Set-Cookie', - 'fpc=AtnNXV7NchVIiPeMpxj2hPE; expires=Fri, 31-Dec-2021 02:42:59 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrW_SyvklfZfKzorxgE0kfUxwanYU-D9UALD-yPkuCZwC_t69dmhWrj3eKNB_6U0M4mzjK4yawyLJ3xqbxfmFQoHR6eFMjoCSd3eYs8PGwB2cf7pWD-egDdB_15DiDLUOJufGLm-rXNpiTkV8nkF_q8m_GR6XaZ4LVCGYkd1BXCo0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:59 GMT', - 'Content-Length', - '980' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '74e93c75-7e31-4cc2-85bf-63994e944900', - 'x-ms-ests-server', - '2.1.12249.14 - SEASLR2 ProdSlices', - 'Set-Cookie', - 'fpc=Am-uv3Rhou9Mlx-2wXeofxA; expires=Fri, 31-Dec-2021 02:42:59 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr2HTvIu_x0QkswGJJWAfTYQahdLe-R0gZBEnZ1EitGE0XiBo2N4pOr_qVws6tDUNtg8ZWyPAuicyqZDK-DTsY-1z7skOw3ZsHlUIncDVbWs9amE8FABmYdwQAxh3FwKYdPR4OfGEt4-2Z4qd4-8eu6AlY-bqJz-PyhT0Ns9XdTuQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:59 GMT', - 'Content-Length', - '1753' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=d5c78d47-9070-4392-b8ff-396b1784b261&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '93ef7e08-1935-4d62-bd81-4c49611d4700', - 'x-ms-ests-server', - '2.1.12249.14 - SEASLR2 ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=ArpoQz3GzUFLs0D_R3epcQcWPr5BAQAAADTYONkOAAAA; expires=Fri, 31-Dec-2021 02:43:00 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:43:00 GMT', - 'Content-Length', - '1374' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/resourcegroups/myjstest') - .query(true) - .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc693f1a7db4cc163901f53e69af57f8e48b625a574d75de8e5fe9cb4d070cb52dab690634a87d9e35ed1a9fb5d945f3d1a35f8c9fbbf4f96556aef3dd8f7ec9e8a3555dadf2ba2d72fe9afeba2c1a7ab7585ebc6eb3167dbe5e4fa7793ecb671ffd925ff2ff00b20f9e64ee000000"], [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Encoding', - 'gzip', - 'Expires', - '-1', - 'Vary', - 'Accept-Encoding', - 'x-ms-ratelimit-remaining-subscription-reads', - '11995', - 'x-ms-request-id', - 'cd728f33-1b89-40a7-a929-d7bdc16a308d', - 'x-ms-correlation-request-id', - 'cd728f33-1b89-40a7-a929-d7bdc16a308d', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024300Z:cd728f33-1b89-40a7-a929-d7bdc16a308d', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:42:59 GMT', - 'Content-Length', - '296' -]); diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.json index 9a6286db19e7..c64d1ee841da 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_get_test.json @@ -9,7 +9,7 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "bf29306c-07fd-47eb-ab1c-749cdc10fcb7" + "x-ms-client-request-id": "96a94021-7f83-4fa8-97df-26b33a303c26" }, "RequestBody": null, "StatusCode": 200, @@ -18,16 +18,16 @@ "Content-Encoding": "gzip", "Content-Length": "225", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 09 Nov 2022 07:39:51 GMT", + "Date": "Thu, 10 Nov 2022 05:57:42 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "5dddafa9-28b4-49aa-92bf-3bbf12869f91", + "x-ms-correlation-request-id": "01171235-c1b1-4cad-8e55-4df19ac6193b", "x-ms-ratelimit-remaining-subscription-reads": "11999", - "x-ms-request-id": "5dddafa9-28b4-49aa-92bf-3bbf12869f91", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073951Z:5dddafa9-28b4-49aa-92bf-3bbf12869f91" + "x-ms-request-id": "01171235-c1b1-4cad-8e55-4df19ac6193b", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055742Z:01171235-c1b1-4cad-8e55-4df19ac6193b" }, "ResponseBody": { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.js b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.js deleted file mode 100644 index 47ef2b624b2e..000000000000 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.js +++ /dev/null @@ -1,145 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "b2e158b2e5dd4fe209f4c56ad666f8b6"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '06e8a334-c653-458a-90ba-720289964800', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR2 ProdSlices', - 'Set-Cookie', - 'fpc=AnF7wmwIzVtEuJrif9cMjWg; expires=Fri, 31-Dec-2021 02:43:00 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrASUMTIMmHHnQePPT35KM0gDhBYB5mNKgsiED_KWJ6GcxH5Z-OJcM0CLQhM5eGXqTRQEe_k5GIM5fbKfvNbBFWHK5zLWkk0_t8nK9naAhePAoU3rsCwD8TqvrXX5ek5zqencvvnx7B7u6TPl65X4SUsA9u7FPpBObrba3IAlqSHwgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:43:00 GMT', - 'Content-Length', - '980' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '5c20cdd3-2e65-4999-871b-c936ed833300', - 'x-ms-ests-server', - '2.1.12249.14 - SEASLR1 ProdSlices', - 'Set-Cookie', - 'fpc=AjYxF5tGTkFKhQ-cnK2JKkc; expires=Fri, 31-Dec-2021 02:43:00 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrYhrtZd6KHWjplBZ9p28qcnTcwux0V2gwuXr23ig1_evQ0goSa67g5wol0O54EiJNHV7u-XmtSD0DT3GklB-Sc-0zxXZkOQc7yeXOQ8_c40e3mYZsXxRpbaHxAHvxypvMEz98HjdJAw-g8IFmnRulUXr_jA2_X3jGyJm_odEvgqogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:43:00 GMT', - 'Content-Length', - '1753' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=b75bbfb0-835a-4ff3-8c97-ca55c064a689&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '93ef7e08-1935-4d62-bd81-4c49711d4700', - 'x-ms-ests-server', - '2.1.12249.14 - SEASLR2 ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=ApeRO671ha1FjvSGBrTGyUoWPr5BAQAAADTYONkOAAAA; expires=Fri, 31-Dec-2021 02:43:01 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:43:01 GMT', - 'Content-Length', - '1374' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/resourcegroups') - .query(true) - .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bd5ffc5131fbe8d147779bf5a499d6c5aa2daa6573f7e1def9c3fbb383f3ed7bd34f1f6cefefeeed6f3fdc9d3ed83e989eef3c98ce26e77bfbbb77ebbca9d6f534ffbcaed6abe66e337bbbbdccdbed366fdaed5f94ed7d34fa68992da88f8f22dfb4d72b7cf34531adaba63a6fc7af1458d3014b6dcb6a9a012d6a9f674dbbc6676d76d17cf4e817ff92d147abba5ae5755be4f81b7f5d160d352e9617afdbac4527afd7d3699ecff2d947bfe4978cbeb9f116d7e54fcff6aedaea17cdf7efcdf27ab97fafc9ae7eb0f845efdee6595ddc9b4c7f5191cd2ece9b36dfafd6ed4f139cc5a2292febfdebf3abbdcb45ddfca2bca82e1645fbd3342025d5370bf41ba2f2474ff3326ff3e3f336afe9ebbd9dbd9ded9d83edddfb6f761e3cdad97bb4f7e9f8dede83837bfb1ffd5ccec7f10f5ee7d397d9f4edf1baad4eaae57971f1ea731a845276e8eb0fa5118df0e766bc4ff3f36c5db6065dfe74fbf4abd784930e79438bffcf8e9ad8bffac19cba685a4243071a7ef8a16353aeffb9e4e5fa6275bd7d71fffebde9e40757b3bdf983eb8b8bf95ef6f6eae2bc7870af7cbbbfbaae7e7a7fff17bdfbc1249bbf5d14e54fefad3e7d7baf78f060954fb36c71beff8beebfdd7bfbf67e71fe8b1efca09dd1a894543f0b90bf217a13bb76b4cceef62e299a876f76f71fedee3cbab74b6d9fac8b7276062a0352693ef94e35e97ef462bd9830a0e0d357d42bf72e9ffe9ccf713e59ecfff4e5b2b9fc45ab9f2eeeb79f4edaebab07cdbb9fbeb8df3c2896c5bd9f6eaaabe5a43cbf7e502d2fd6fbd73407efe6b3f3eb8b4f57b3f9f5bdc983f96472be9c5e4e17e734447f8ebf59c83fa439deffffe31c67c5fdfbcbcbc9fa07ef3e7d505ed6ebf3f6bcacaa5ff483e5a78bb67efb8bda62ba98edad1fac2e7f30bd3729ef9f37b3f6174d7e7a7ffad365397bdb4ee6d7efde2dafcef3b7b3694d43f4e7f89b85fcc398e3fb9f3eba77406d79a2fe7f34c7b3e2172dee7f7afeb6acebe5a2783bdb5ffff4fdf3eca7dfaeeeefb5d3bde9aa5d5c650faedeadaeb37bef1e4cf77ffafebdd9d5d583457ef936fbc1e4a22aa6cb966667fed3b3f60734447f8ebf59c83f94397ef0e8dea7d49627eaff4773bc77fdd3173f9d4fde5ecedb657b515ffea06d1fdcdf7ff76ebabaff8b26d5fdf3c94fb78b1fb4d3362b26e54fb7fbd79ffea24fcf17edf545fd8ba6e5bbcbe50fc88dbf97e5f5fd9fde8397e2cff1370bf9677f8eef3fdad97db4fbffc739860bf9fb4fcbe2f75f5c2cdadf9f82d6abaa7efbfb9f17757e9595e5efcf5feba7070f09c86e0e8be5cf2537796f083fbb7346911a19d77bf71fdddfa7b64cf8ff1fcdd9bdbdfdf672fa6e42ce6cfeee325b4deebf2df27936b95ccc17d9d52fbafae97bebfa417e3ebd7c57ccf73ebd58de6bafdbfae2ddfdf607f756fbf555d5943fbd9fdf2b7ffad3fa8286e8cfe5370bf967778e452ef71e3edab9476d79a2fe7f34c717b3fb55f6d3efb2f90f5697cd4f5fb6f564afb8f845c583f38b767d7ff2e96cf6d3fbe73f7dbdaaf37bfb3ffd76efe2fea7cbea172daff6ab2cff45f78b7c552cefe5e757f9fdf5f524a321fa73fccd42fe61ccf1bd9dff7fcef12fba57df7f3bb9ba6cdb5f54de9bdd7ff7801cd3fdfb4533dbfbe94531cbceb3bdd54f7ffa83f9bd6c7a55b4ed0f2e9aecfc07f7afafcedb8babbdf3a6c9af1f4c160f286ff683bd2b1aa23fc7df2ce41fd21cdf439e9427eaff47733cbfbecedbe5e4fa0189dc058d7f92b53fd8bb3c3fbfdedf9b2fe79faecbe583d9836c7df1f6fcfc7e7e2f7b3b230aff60b9ffe94f67f38b6c3269eebdbb7cf083f5457bfef61d0dd19fe36f16f20f658e771feddda7b63c51ff3f9ae37bd37cff6279fee041565e5ecfdafad359f38b3e2d7e503eb83f9f5f5ce5efee91bb7a55df9bdf5bac2ef62e66d5fdfa6dd3ccaad522cb9af3c52aafd6970f2ed6d7949c0075fc39fe6621ff50e6f8dea3bd1d6acb13f5ffa339fe45f36535dfdf7ffb83c5455edf5b5c15f562f6f6fe2cbff7837bebb76556eecdb34ff39fa660f5fe6c31bbfee9b7f5e4a2985f2d17f7cf57a4441f646f7f7aff6aba9f5dcd8b390dd19fe36f16f20f658e2975f5ffc758e8dddee4ea41bba8aef756d3b70f66ab7bf7effff4bbd5d5deecedf534bf575cff60feeea7dffee017ed3fb8b857edffa28ba6ada6f79af37276717faf9d2c3e6ddf4edb72fa6efdf6c1644d43f4e7f89b85fc439ae3bdff3ffa5cedbdeb7245e9c377ed79b597b7f3b7f756f7ee3d382fef5d4c96f90fee519e69feaedeffc1a76fdb1fccea7bedbdcb2a9f4ce64d71b1f736a375caeaa7d7d307b369b9f8e9fa010dd19fe36f16f20f658ee97fe88b27eaff47739c55d572bddc5facf6f7ae1764267fd066e52f9a4c174493ebf26ab1fec1bcfc4559d93c7877afddcb67d5fafabaca48f626f5b2bafce9d9db79f1837bb309ad085cd558edf1e7f89b85fc4399e34f1fedffffd11e3f98fea0bdffd34d917dba7f2f232fe8fee20775f1e9bbcbf376beb76c2eaab757f7d7ef26c5797b6f9add6fdf65efda7ab12ade5d2cdf9e5fccdebefd458bebfd8b6cffea6d7d8195007f8ebf59c83ffb73fce9a3fbbbf43f6acb13f5ffa339cef2f379bd78777fbd9a3d98cc3fddbf9a65ef566fe7d7976f6b5ae9bbbaf8458b4b8a64defde09296087e70b937dbaf97efdefdf4745a14d7cda70fdad50f7ed1d5fefedeea07f54fe734447f8ebf59c83fbb73bcbbff66f7c1a35dca3fffff3197797ff58b661757b362daaca717b45c7b3edf9fe5e50f7ed17d9aae77ebf65ed1e6e7d9455156ababea6afed3ab9f9e5cfca28b7c72effe0f2eaf66d5f55533fbc1fadd62f2f6ed12abb6f41210fe5980fc439ae3bdff3fe640dafbeb9faef78a4f2fe63f5dfda207f39ab2cbbfe832bfce6929e7dddeeafc17bdcde68bf3abfaedfebb753ebb7abbaee98ffadebde9e5629fd66f3f7d77bd773fa3d5faec073f002569fa80f0cf02e49fe539beff66e7e1a3fdbd47fbff7ff4b9ae7e50e79f5efda2c5747e3e2d2f67cde562f1834f97979f7e3a5fe4453399bcdbabae7f3a6beeddffe9fbd9f4f2edbdebf9f2a7ef4d7f70fde979395fcc57ef2e2717fb93627d35992c6888fe1c7fb3907f4873fcffcb75a772efed0f2e57f3fa7aefb258accfef5f4dd657797e9d5d53f8322b09a962359f16b3aada3f9fec17d3453ecfaf7ff08bf67e5139af8b1fb4cda72466597d7e7fde3e98d010fd39fe6621ffaccf31d616e97fff7fd4d5fbcb65733dbfbc57cd7ed1de64ff174dead9fd76767d7ebfb87fff1765ebd574b2ffd3ab0bea7e7aef9ab2cbf31f64e5fcea9c22dd4ff73e6dab4f7f5135ad7ed0525663b6582053e1cff1370bf98732c7648f0fa82d4fd4ff8fe6b8be9767d349797db52e8ae9c52faadebe5b5c5dddfbc1c5a745d9fca2f52faae68459763d994f9afad3f3d5a7ed7a7eafb8f7e90f2e266d9e53028bd618f6cbfdd97affdef98a86e8cff1370bf98732c7fbffbf8b9d16d73fddb479d3126a3a37de27df144de9e72e7d7e9995eb7cf7e774b84fc98d5f97ad19077fbafdddaf5e13b23afc0d2dbe2639ae88984c0e1ae7cfcda817d932bbc867dbf5c5b6cc6dbe875054473cf0ed078d16d64ee13eb9a64fef7ef8207e5191553f98139d9af62ed36e96d7cd5d87decb757d59e45777b3e9b45a2fdbe66e3018e1c49f4bd66bb2c5aaccb7cda7db17f81859739d86c1ef3f78226890ff2f1a321690370d19dfff9087fcfd5ff2ff004eebb0e8f3350000"], [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Encoding', - 'gzip', - 'Expires', - '-1', - 'Vary', - 'Accept-Encoding', - 'x-ms-ratelimit-remaining-subscription-reads', - '11994', - 'x-ms-request-id', - 'a0839e58-7cc2-414d-ad26-196a26880724', - 'x-ms-correlation-request-id', - 'a0839e58-7cc2-414d-ad26-196a26880724', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024301Z:a0839e58-7cc2-414d-ad26-196a26880724', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:00 GMT', - 'Content-Length', - '2826' -]); diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.json index c3e5eebd4ded..c3f96922677e 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_list_test.json @@ -9,7 +9,7 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "21dcd0a2-f954-4ebd-b8ac-b0eaf1717dba" + "x-ms-client-request-id": "77c54712-bcea-4739-ba31-6c5f634d847d" }, "RequestBody": null, "StatusCode": 200, @@ -18,16 +18,16 @@ "Content-Encoding": "gzip", "Content-Length": "8628", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 09 Nov 2022 07:39:51 GMT", + "Date": "Thu, 10 Nov 2022 05:57:42 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "f9bae0ed-705b-49a6-9a9b-7018d834efca", + "x-ms-correlation-request-id": "34d39512-bcf7-4106-8d8d-a1f20d373d4f", "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "f9bae0ed-705b-49a6-9a9b-7018d834efca", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073951Z:f9bae0ed-705b-49a6-9a9b-7018d834efca" + "x-ms-request-id": "34d39512-bcf7-4106-8d8d-a1f20d373d4f", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055743Z:34d39512-bcf7-4106-8d8d-a1f20d373d4f" }, "ResponseBody": { "value": [ diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.js b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.js deleted file mode 100644 index 433c0d7a3deb..000000000000 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.js +++ /dev/null @@ -1,145 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "ee3ce65d92e13cb3f8155e5b5d26b3ab"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '54d4de93-04fa-42b5-8de4-5f95ac743300', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR2 ProdSlices', - 'Set-Cookie', - 'fpc=AjogL6hywhJCv2xgOgvJR5A; expires=Fri, 31-Dec-2021 02:43:01 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrpJxEYMaSp1tnLitGgJyAoboKrJOT551Dp2kqpl-K7C-IrjTAiLxJVCVQFOEcG_wJAUTnDlxRqSo51q9jEZMrrbgle4LejXeg-qXUjubt6Wn74G6-4rPvhvcKDsXBVkxFfxKU1-qI4pTXTE-SNT10WU2BbDmaoD-JLMu7Upu6kaMgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:43:01 GMT', - 'Content-Length', - '980' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '93ef7e08-1935-4d62-bd81-4c49781d4700', - 'x-ms-ests-server', - '2.1.12249.14 - SEASLR2 ProdSlices', - 'Set-Cookie', - 'fpc=AjtmIpj8GwVFvGka0l7Vh8k; expires=Fri, 31-Dec-2021 02:43:01 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr53sMV8FoJtsd7KGUjglCoYI1TB4SuNSS03V2urCrVsF6YEjxtbm_zTufoLmdgfD1R6zF3i2WLJxzU9FaR2j1ADviHLKby5nlnmwTi97dnIzVcYYVwBezzc0TbTkBos_aUGV7jUxp5HtqSSNxq7G0gNhUiyhMvrYjmzgcOglL3jQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:43:01 GMT', - 'Content-Length', - '1753' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=f25c54a8-b761-412e-b9ab-86ae92662623&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '06e8a334-c653-458a-90ba-720295964800', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR2 ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=Asytzi5O8ElPi7QNuRy_ubYWPr5BAQAAADTYONkOAAAA; expires=Fri, 31-Dec-2021 02:43:01 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:43:01 GMT', - 'Content-Length', - '1374' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .patch('/subscriptions/azure_subscription_id/resourcegroups/myjstest', {"tags":{"tag1":"value1","tag2":"value2"}}) - .query(true) - .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc693f1a7db4cc163901f53e69af57f8e48b625a574d75de8e5fe9cb4d070cb52dab690634a87d9e35ed1a9fb5d945f3d1a35f8c9fbbf4f96556aef35df97ccffcbdf7d12f197db4aaab555eb745cecde9afcba22158c5f2e2759bb5c0e1f57a3acdf3593efbe897fc","92ff0769766958fe000000"], [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Encoding', - 'gzip', - 'Expires', - '-1', - 'Vary', - 'Accept-Encoding', - 'x-ms-ratelimit-remaining-subscription-writes', - '1196', - 'x-ms-request-id', - '13022410-1050-4aa1-a5e5-708b8601105a', - 'x-ms-correlation-request-id', - '13022410-1050-4aa1-a5e5-708b8601105a', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024303Z:13022410-1050-4aa1-a5e5-708b8601105a', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:43:02 GMT' -]); diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.json index a4f476d738d2..4b5c60ffbb00 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_resourcegroups_update_test.json @@ -11,7 +11,7 @@ "Content-Length": "42", "Content-Type": "application/json", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "f7fa4f19-2733-4614-9707-eb69ec4ca6a0" + "x-ms-client-request-id": "076daba2-ad10-4b32-bb8e-fce1118c6ca7" }, "RequestBody": { "tags": { @@ -24,17 +24,17 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 09 Nov 2022 07:39:53 GMT", + "Date": "Thu, 10 Nov 2022 05:57:45 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "a36f3a13-ea3c-4dd1-b8fb-090add872aa4", + "x-ms-correlation-request-id": "8e0147ae-40e8-492d-a1ba-93d0efb452a3", "x-ms-ratelimit-remaining-subscription-writes": "1198", - "x-ms-request-id": "a36f3a13-ea3c-4dd1-b8fb-090add872aa4", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073953Z:a36f3a13-ea3c-4dd1-b8fb-090add872aa4" + "x-ms-request-id": "8e0147ae-40e8-492d-a1ba-93d0efb452a3", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055745Z:8e0147ae-40e8-492d-a1ba-93d0efb452a3" }, "ResponseBody": { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.js b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.js deleted file mode 100644 index e347eaa5a704..000000000000 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.js +++ /dev/null @@ -1,145 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "b988ad4032d39fd53163c00b226b9e14"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '2aa0e74a-1391-4187-b36e-afa90a934700', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR1 ProdSlices', - 'Set-Cookie', - 'fpc=AjeG_uGL5AVAr6JGwU1al74; expires=Fri, 31-Dec-2021 02:42:49 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrVqSlIC4HOR-g0aBdhOQz56OLikuy5FkakTiyzGBtAminRl19f_vM9tWMSqcmYCY0av5oQednc7saEilKrDvfG8-RxcXAkp8sRW8hWx_0R6awlxSVX99TWc6S_BusD2eOIgDmGFaKIzNKCQjrztg3JHs-2dE6NubeAiAm19-EYKEgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:48 GMT', - 'Content-Length', - '980' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '54d4de93-04fa-42b5-8de4-5f9539743300', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR2 ProdSlices', - 'Set-Cookie', - 'fpc=Ai2uQGBRYBZIqIDUjgu7bk8; expires=Fri, 31-Dec-2021 02:42:49 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrJcGS3qBgpvkX0caXd9rI6oXaizcM3e516s_P0MCl2kf_76udiyUEkv4wOj0ewwmy9xpLLuxDeM13hhMg421kkOqCtIlVxQO2ENSxPoKfIPCOlFbwHRTKF6clRPWU5vBwdJNVcyMt7m7cuGcvUEpkfINIqP2rzHmwkp9a28SHCeogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:48 GMT', - 'Content-Length', - '1753' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=da125f07-e2ad-44f8-b9c6-1412d50dc1a7&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '54d4de93-04fa-42b5-8de4-5f953c743300', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR2 ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=Ag7c7sMbICZBsdLy2SXJY94WPr5BAQAAACjYONkOAAAA; expires=Fri, 31-Dec-2021 02:42:49 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:48 GMT', - 'Content-Length', - '1374' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .put('/subscriptions/azure_subscription_id/tagNames/tagyyy') - .query(true) - .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefde6db38b17d9226ff0cbf5f5f547a38fe8177c42f0e837f9685aad97ed478f7ef147edf50a5fbca9daaca4cf2fb3724d7feffc12fdb5f9e8d1f7beff","4bfe1f7616d8a48e000000"], [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Encoding', - 'gzip', - 'Expires', - '-1', - 'Vary', - 'Accept-Encoding', - 'x-ms-ratelimit-remaining-subscription-writes', - '1199', - 'x-ms-request-id', - 'e28abb76-dbf1-411d-bdb6-5986e4a58919', - 'x-ms-correlation-request-id', - 'e28abb76-dbf1-411d-bdb6-5986e4a58919', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024251Z:e28abb76-dbf1-411d-bdb6-5986e4a58919', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:42:51 GMT' -]); diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.json index 59d8a52344f9..b84088fc532b 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_create_test.json @@ -10,7 +10,7 @@ "Connection": "keep-alive", "Content-Length": "0", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "fbdebfdd-49a5-454f-8571-1df014c3f4cf" + "x-ms-client-request-id": "b29f5073-a2e9-41f9-97d0-625140b55a00" }, "RequestBody": null, "StatusCode": 200, @@ -18,17 +18,17 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 09 Nov 2022 07:39:56 GMT", + "Date": "Thu, 10 Nov 2022 05:57:48 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "ea91276d-6e60-4041-b744-0032da25649c", + "x-ms-correlation-request-id": "be41284c-b3b3-453b-adb0-c56decd6cc05", "x-ms-ratelimit-remaining-subscription-writes": "1197", - "x-ms-request-id": "ea91276d-6e60-4041-b744-0032da25649c", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073956Z:ea91276d-6e60-4041-b744-0032da25649c" + "x-ms-request-id": "be41284c-b3b3-453b-adb0-c56decd6cc05", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055748Z:be41284c-b3b3-453b-adb0-c56decd6cc05" }, "ResponseBody": { "id": "/subscriptions/azure_subscription_id/tagNames/tagyyy", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.js b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.js deleted file mode 100644 index 1acfaf6c6168..000000000000 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.js +++ /dev/null @@ -1,173 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "0c894391b37e47ed6a2a1ef03664d101"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '5c20cdd3-2e65-4999-871b-c936c3833300', - 'x-ms-ests-server', - '2.1.12249.14 - SEASLR1 ProdSlices', - 'Set-Cookie', - 'fpc=Aja6ynrCTR1DkXLw5jMLwqA; expires=Fri, 31-Dec-2021 02:42:56 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr9-mZp8eVdfexnaqNfTVH4nif1-ooq8MXxYSuPJITYHYPIeKnqoQHH0nEBNFCBGkWfIH2-BTcxZhA0jBtn3O8vNaxQ76-faNylpU0oJ5C-hKM86XXsgm0n8p_1dsYGKKcMlfo_C_mNFSj_sBHXTq-BWlmLugyyo76J6iWPh5dpH4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:56 GMT', - 'Content-Length', - '980' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'badfe93a-df4d-4f45-89c4-d13f1ac44500', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR1 ProdSlices', - 'Set-Cookie', - 'fpc=AuQTwzhtk0tFjf_MfQKfYGo; expires=Fri, 31-Dec-2021 02:42:56 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrZhSD7Aia0Z0nutq9TQ3dnut__0phk6IzNm-QQjs8QMuOb4DIlm4gmTq4q2XwA5w363RlwMBUCLeUs_zzuaBmDD1dsdrCE25WpjvVvPpkzb_PiP54KvwJ8MiL3VRiRTz6LtNNYTNa-nZbwBo83Ly1WRuaXtmwaSwOIiqZd1BSiaAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:56 GMT', - 'Content-Length', - '1753' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=5a96479b-552d-48a7-b3a0-277435ca7dad&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '06e8a334-c653-458a-90ba-720266964800', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR2 ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=AmOd0EKYSPNKoRMxQolFmy0WPr5BAQAAAC_YONkOAAAA; expires=Fri, 31-Dec-2021 02:42:56 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:56 GMT', - 'Content-Length', - '1374' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .delete('/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/Microsoft.Resources/tags/default') - .query(true) - .reply(200, "", [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Expires', - '-1', - 'x-ms-ratelimit-remaining-subscription-deletes', - '14999', - 'x-ms-request-id', - 'd022581b-ee1b-46cd-87ab-33f46cb34e1b', - 'x-ms-correlation-request-id', - 'd022581b-ee1b-46cd-87ab-33f46cb34e1b', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024256Z:d022581b-ee1b-46cd-87ab-33f46cb34e1b', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:42:56 GMT', - 'Content-Length', - '0' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/tagNames') - .query(true) - .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bd5ffc5131fbe8d147779bf5a499d6c5aa2daa6573f7e1def9c3fbb383f3ed7bd34f1f6cefefeeed6f3fdc9d3ed83e989eef3c98ce26e77bfbbb77dbece245b6c81bfcb2fbd1e823fa81bf091afd860fa6d57ad97ef4e8177fd45eaff0f19baacd4afa5cfbdefd25fa6bf30de2817f7e3203d0bb0c1b78988f08befdec46dc7ec9f77fc9e81b426a8fe0d20ffc4dd0e8377c702302faeb37489c3dfcc39450e2000ff311c1b79fdd88db37459cec074d3e5d65d3b7045c3f2490fea737a2a2bf7e5364b27de323264c7377592d577535a35ecd67d48bfbf04614bf296aadcaac3dafea4593b76db1bc68c6f3aa697fff7c7959d4d572912fdb7193d797c5341f9b96bf7fb56af359b1fcfde98fdfbfaeaa769ad76d43b8294cc2c834fd0680de4808fdf59b9a2b83d087a20e883cadf45b4d983279f803c2503fb9716cdfd424bfcdaf09acfe49c0e4ef1bbbd75fbf29d252aff88389a0ca025ad37c44e0ed6737a2f64d51e6a4ceb3b6aa09b47e4400dd6737a1f1e9374d22ed1a1f304d9abbc7ebb65a646d31cdcaf23acd66b37c964eaed317afbe789d1eff605de7e9cbaa2ca6984ff31221f11e6fdd3cc66f8ad6e87dfb6c795e1174fd9040fa9fde8c8bfefe4dd1db768e8f9878cddd79dbae1eddbd9bbdcdc60bd2d3a40a0803f3357518fdfe66ccbf512afe645e37f42e75a09f13d4ce173763a4bf7fa3b4d4fef129d3abb9bbb7b3fb707be7def6de0e756e3ea6be82cf6f46f69b221f29212818fd9ba0e907376070ef9ba616bac55f4c8e0fd386f7be31e2d02f7bf71f3e78b8bff3e9bd7bd401fd8d2f082cfd167c73034a3bdf34b9e817d73ffe622229dddc378481f98e7aec7f7923dadf14259fe665dee6c7e76d0e3ba21f13d0f0f31bd0d9dbffa6c9e8758f0f995010d1bd9ded9d83edddfb6f761e3cdad97bb4f7e9f8dede83837bfb848b69465d6f6c77c358c8647fd384c5878c1a8f60777b97907bf86677ffd1eecea37b901bf33df5196ff0ff2e9cf78192f99efa8c37f87f11cef73f7d74ef80ba36df539ff106ff6fc2f9c1a37b9f52d7e67bea33dee0ff3538df7fb4b34b1690ba36df539ff106ffafc099b403f1eabdfb8fee432d98efa9cf7883ff57e02c64dc7bf8680756c27c4f7dc61bfcbf08e77b3b8292f99efa8c37f87f17cef7901232df539ff106ff6fc279f7d1de7deada7c4f7dc61bfcbf09e77b8fd8bb36df539ff106ff6fc2992c1d5499f99efa8c37f87f17ce7b1031f33df5196ff0ff269ce97f0fa86bf33df5196ff0ff269c3f7db40f7635df539ff106ffafc1f9d347f777e97fd4b5f99efa8c37f87f05cebbfb6f761f3cda257702a6d97c4f7dc61bfcbf0be73d980cf33df5196ff0ff0e9c29827af8687fefd13e44cc7c4f7dc61bfcbf0b6776dbccf7d467bcc1ff5b7086ab49ffc3d49befa9cf7883ff37e14cec8ad0c97c4f7dc61bfcbf09678a9ea0caccf7d467bcc1cd387f43699827eba29c9d61414d3f2280eeb31bd0d8fbc6937eda353e60023577cb8a52f4d4a5f9847a301fdd8cdd374aa5ef541302ae9f1144efc39b31c1eff4fb374a27ea1b9f3059fedf44a817ebc584b377fa31010d3fbf191ffdfd1b2597748f0f993eff6fa2d8ab3c6b784d423f26a0e1e737e3a3bf7fa31493eef121d3e7ff2514a35feeed3eb87f7f7f678f6d12fd8d2f082cfd167c73034e410efe9b436e7fefdefebd9d877b7b30f2f437be20b0f45bf0cdcf0d72f7f71ededbbbf7e90e0c23fd89cf092afde67ff17383daf535565be9177c42f0e837f9e8fdd0f9fe2ff97f00fb5ae29668250000"], [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Encoding', - 'gzip', - 'Expires', - '-1', - 'Vary', - 'Accept-Encoding', - 'x-ms-ratelimit-remaining-subscription-reads', - '11996', - 'x-ms-request-id', - '6d42261c-c870-4ff0-9f0b-6e364e6d65e7', - 'x-ms-correlation-request-id', - '6d42261c-c870-4ff0-9f0b-6e364e6d65e7', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024257Z:6d42261c-c870-4ff0-9f0b-6e364e6d65e7', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:42:56 GMT', - 'Content-Length', - '1408' -]); diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.json index 7f3b6f754023..dc6713ac5878 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_delete_test.json @@ -9,22 +9,22 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "fc0e604b-4b42-4dbe-9b66-04ffd981d3bc" + "x-ms-client-request-id": "a0ad9e19-a521-4ac5-a291-19db5841fd50" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Wed, 09 Nov 2022 07:40:01 GMT", + "Date": "Thu, 10 Nov 2022 05:57:52 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "a8ec7ef6-c14f-4562-aa75-c82bf182c8a4", + "x-ms-correlation-request-id": "e6e7f1b5-d3c2-43bf-8371-cdee1ad0a893", "x-ms-ratelimit-remaining-subscription-deletes": "14999", - "x-ms-request-id": "a8ec7ef6-c14f-4562-aa75-c82bf182c8a4", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074001Z:a8ec7ef6-c14f-4562-aa75-c82bf182c8a4" + "x-ms-request-id": "e6e7f1b5-d3c2-43bf-8371-cdee1ad0a893", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055753Z:e6e7f1b5-d3c2-43bf-8371-cdee1ad0a893" }, "ResponseBody": null }, @@ -37,7 +37,7 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "485288ed-54de-4a77-b8ce-86566dd26fcc" + "x-ms-client-request-id": "b194a774-a346-42aa-9936-02df5d01c58e" }, "RequestBody": null, "StatusCode": 200, @@ -46,16 +46,16 @@ "Content-Encoding": "gzip", "Content-Length": "5550", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 09 Nov 2022 07:40:01 GMT", + "Date": "Thu, 10 Nov 2022 05:57:53 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "e7a7dce1-eb1d-4ef7-a641-50659f80873b", + "x-ms-correlation-request-id": "fe737c63-0321-45b9-8c33-63b8c2e2b532", "x-ms-ratelimit-remaining-subscription-reads": "11995", - "x-ms-request-id": "e7a7dce1-eb1d-4ef7-a641-50659f80873b", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T074001Z:e7a7dce1-eb1d-4ef7-a641-50659f80873b" + "x-ms-request-id": "fe737c63-0321-45b9-8c33-63b8c2e2b532", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055753Z:fe737c63-0321-45b9-8c33-63b8c2e2b532" }, "ResponseBody": { "value": [ diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.js b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.js deleted file mode 100644 index 0fe4cdf829d8..000000000000 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.js +++ /dev/null @@ -1,145 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "18dc3a802a2d8da36cf496157b55dbeb"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '54d4de93-04fa-42b5-8de4-5f9553743300', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR2 ProdSlices', - 'Set-Cookie', - 'fpc=AnO23u60Hn9OitnRLyb2Rt8; expires=Fri, 31-Dec-2021 02:42:51 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrWR7sHkibZacx-2iNJWlcsEDNjcNshqgvzcmgz5TdZMokv81-O6UJahsKf1spJdFShS6tFJahXHb6AUX-7CSUuHm6-EKM8om67yqcW4eGmfCZcDn85kehykct4JJ0n4G2sMM_NC8Z1vf7Eh14xUx4jm_KR168TWzsTRa4SwcouDIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:51 GMT', - 'Content-Length', - '980' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '2aa0e74a-1391-4187-b36e-afa921934700', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR1 ProdSlices', - 'Set-Cookie', - 'fpc=AsS-8qmAj4FIuYDpjN8uHkE; expires=Fri, 31-Dec-2021 02:42:51 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr7xJITawjZbeOjkMAVUPMcBTh-PxuMrklbUoFZy9Gxf0uRa15c2d9dC7SQpIIyZwc4sgBU0TjN4J3JIkGtje9MkyDad6F5wlwFGDqL8kJ4jWefEIrZgNnX8jXt1mEQYUmRazsHAvtnmwUIMdlTe3as5JIYVFDNIag1QP5tvdh0BsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:52 GMT', - 'Content-Length', - '1753' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=fdde4032-8bc5-4299-8fba-504b6f82ca44&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '06e8a334-c653-458a-90ba-72023e964800', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR2 ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=Aq76iE2Mfb9NiwEwFRaURzQWPr5BAQAAACvYONkOAAAA; expires=Fri, 31-Dec-2021 02:42:52 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:52 GMT', - 'Content-Length', - '1374' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/Microsoft.Resources/tags/default') - .query(true) - .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e5f69dbe66e9b5d347767f979b62edb8f461f2db3454efdbb0fdaeb153e187a955a10fc555eb745de7cf4e8177fc41f3efac5bfe497fc92ff077ce1ccd5cb000000"], [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Encoding', - 'gzip', - 'Expires', - '-1', - 'Vary', - 'Accept-Encoding', - 'x-ms-ratelimit-remaining-subscription-reads', - '11998', - 'x-ms-request-id', - 'd59c3cb2-2eb7-4041-aff3-b8795a9450ec', - 'x-ms-correlation-request-id', - 'd59c3cb2-2eb7-4041-aff3-b8795a9450ec', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024252Z:d59c3cb2-2eb7-4041-aff3-b8795a9450ec', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:42:52 GMT', - 'Content-Length', - '270' -]); diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.json index 241d9b136ac2..800d67c04154 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_get_test.json @@ -9,7 +9,7 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "1ece2a42-fbb1-4338-bf70-e9ebe0ee0929" + "x-ms-client-request-id": "90e9fa25-088e-4b77-8810-9e0606970a9f" }, "RequestBody": null, "StatusCode": 200, @@ -18,16 +18,16 @@ "Content-Encoding": "gzip", "Content-Length": "220", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 09 Nov 2022 07:39:57 GMT", + "Date": "Thu, 10 Nov 2022 05:57:48 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "284f1326-43b1-4ced-b574-34243454a5f6", + "x-ms-correlation-request-id": "a4ea3e00-de8c-4c8c-a23d-7e6ac2666d7e", "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "284f1326-43b1-4ced-b574-34243454a5f6", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073957Z:284f1326-43b1-4ced-b574-34243454a5f6" + "x-ms-request-id": "a4ea3e00-de8c-4c8c-a23d-7e6ac2666d7e", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055749Z:a4ea3e00-de8c-4c8c-a23d-7e6ac2666d7e" }, "ResponseBody": { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1/providers/Microsoft.Resources/tags/default", diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.js b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.js deleted file mode 100644 index 01ef4a06b8e7..000000000000 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.js +++ /dev/null @@ -1,145 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "fda7d22a1dc9867c5f8178de7c1d32d6"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'badfe93a-df4d-4f45-89c4-d13ff6c34500', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR1 ProdSlices', - 'Set-Cookie', - 'fpc=Al76hohRhYVCl6cyiOz6wqU; expires=Fri, 31-Dec-2021 02:42:52 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr9wQkR1JU_EwBA-NE0fuc6TCn6rh9KqmOHYDq5qtBoY3mhAttv3wm8S5HDyADhlMjO_w0FZl0DtatTTSXRhhjiV_FaLzOYmAAYDqXzphpKWLX0zNFyg8RtA7HMyq7U2mQE65AVqo7gl_1LXBH2Vg-x3UKUfX10-QApxAwh9YSlAkgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:52 GMT', - 'Content-Length', - '980' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '5c20cdd3-2e65-4999-871b-c936a4833300', - 'x-ms-ests-server', - '2.1.12249.14 - SEASLR1 ProdSlices', - 'Set-Cookie', - 'fpc=Ahr6z6Fomx1Bk_QO86BPtek; expires=Fri, 31-Dec-2021 02:42:53 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrI2npNiS5ozTnf1o-q8IfPxzqYSqvcDoR5Wxv49WTNLjIInWqs31jstD0bRIXZdgbiFRW19WiXxmUJ_AfylpGOqANB7ENTTjCenLv5FaPmOlgNZbIOX_HsZ6Ot-It9_JpNNzt04DRKCUMCPwrD1QvXRLucZmVg9flgizGYkKvUKIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:53 GMT', - 'Content-Length', - '1753' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=6820b269-dd7f-4dbc-aa6a-124906711265&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'badfe93a-df4d-4f45-89c4-d13ffcc34500', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR1 ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=AvZOGmZQxWdKvrnrgYBWfsgWPr5BAQAAAC3YONkOAAAA; expires=Fri, 31-Dec-2021 02:42:53 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:53 GMT', - 'Content-Length', - '1374' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .get('/subscriptions/azure_subscription_id/tagNames') - .query(true) - .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bd5ffc5131fbe8d147779bf5a499d6c5aa2daa6573f7e1def9c3fbb383f3ed7bd34f1f6cefefeeed6f3fdc9d3ed83e989eef3c98ce26e77bfbbb77dbece245b6c81bfcb2fbd1e823fa81bf091afd860fa6d57ad97ef4e8177fd45eaff0f19baacd4afa5cfbdefd25fa6bf30de2817f7e3203d0bb0c1b78988f08befdec46dc7ec9f77fc9e81b426a8fe0d20ffc4dd0e8377c702302faeb37489c3dfcc39450e2000ff311c1b79fdd88db37459cec074d3e5d65d3b7045c3f2490fea737a2a2bf7e5364b27de323264c7377592d577535a35ecd67d48bfbf04614bf296aadcaac3dafea4593b76db1bc68c6f3aa697fff7c7959d4d572912fdb7193d797c5341f9b96bf7fb56af359b1fcfde98fdfbfaeaa769ad76d43b8294cc2c834fd0680de4808fdf59b9a2b83d087a20e883cadf45b4d983279f803c2503fb9716cdfd424bfcdaf09acfe49c0e4ef1bbbd75fbf29d252aff88389a0ca025ad37c44e0ed6737a2f64d51e6a4ceb3b6aa09b47e4400dd6737a1f1e9374d22ed1a1f304d9abbc7ebb65a646d31cdcaf23acd66b37c964eaed317afbe789d1eff605de7e9cbaa2ca6984ff31221f11e6fdd3cc66f8ad6e87dfb6c795e1174fd9040fa9fde8c8bfefe4dd1db768e8f9878cddd79dbae1eddbd9bbdcdc60bd2d3a40a0803f3357518fdfe66ccbf512afe645e37f42e75a09f13d4ce173763a4bf7fa3b4d4fef129d3abb9bbb7b3fb707be7def6de0e756e3ea6be82cf6f46f69b221f29212818fd9ba0e907376070ef9ba616bac55f4c8e0fd386f7be31e2d02f7bf71f3e78b8bff3e9bd7bd401fd8d2f082cfd167c73034a3bdf34b9e817d73ffe622229dddc378481f98e7aec7f7923dadf14259fe665dee6c7e76d0e3ba21f13d0f0f31bd0d9dbffa6c9e8758f0f995010d1bd9ded9d83edddfb6f761e3cdad97bb4f7e9f8dede83837bfb848b69465d6f6c77c358c8647fd384c5878c1a8f60777b97907bf86677ffd1eecea37b901bf33df5196ff0ff2e9cf78192f99efa8c37f87f11cef73f7d74ef80ba36df539ff106ff6fc2f9c1a37b9f52d7e67bea33dee0ff3538df7fb4b34b1690ba36df539ff106ffafc099b403f1eabdfb8fee432d98efa9cf7883ff57e02c64dc7bf8680756c27c4f7dc61bfcbf08e77b3b8292f99efa8c37f87f17cef7901232df539ff106ff6fc279f7d1de7deada7c4f7dc61bfcbf09e77b8fd8bb36df539ff106ff6fc2992c1d5499f99efa8c37f87f17ce7b1031f33df5196ff0ff269ce97f0fa86bf33df5196ff0ff269c3f7db40f7635df539ff106ffafc1f9d347f777e97fd4b5f99efa8c37f87f05cebbfb6f761f3cda257702a6d97c4f7dc61bfcbf0be73d980cf33df5196ff0ff0e9c29827af8687fefd13e44cc7c4f7dc61bfcbf0b6776dbccf7d467bcc1ff5b7086ab49ffc3d49befa9cf7883ff37e14cec8ad0c97c4f7dc61bfcbf09678a9ea0caccf7d467bcc1cd387f43699827eba29c9d61414d3f2280eeb31bd0d8fbc6937eda353e60023577cb8a52f4d4a5f9847a301fdd8cdd374aa5ef541302ae9f1144efc39b31c1eff4fb374a27ea1b9f3059fedf44a817ebc584b377fa31010d3fbf191ffdfd1b2597748f0f993eff6fa2d8ab3c6b784d423f26a0e1e737e3a3bf7fa31493eef121d3e7ff2514a35feeed3eb87f7f7f678f6d12fd8d2f082cfd167c73034e410efe9b436e7fefdefebd9d877b7b30f2f437be20b0f45bf0cdcf0d72f7f71ededbbbf7e90e0c23fd89cf092afde67ff17383daf535565be9177c42f0e837f9e8fdd0f9fe2ff97f00fb5ae29668250000"], [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Encoding', - 'gzip', - 'Expires', - '-1', - 'Vary', - 'Accept-Encoding', - 'x-ms-ratelimit-remaining-subscription-reads', - '11997', - 'x-ms-request-id', - 'd58f96bf-0b9d-490c-8102-d336a4d0a3ba', - 'x-ms-correlation-request-id', - 'd58f96bf-0b9d-490c-8102-d336a4d0a3ba', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024253Z:d58f96bf-0b9d-490c-8102-d336a4d0a3ba', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:42:53 GMT', - 'Content-Length', - '1408' -]); diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.json index d59f2e26f808..9e8367129903 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_list_test.json @@ -9,7 +9,7 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "a811c75c-c2fb-4220-87b3-05819e4de4e0" + "x-ms-client-request-id": "e88590b6-208b-40fd-af1a-06b68560554f" }, "RequestBody": null, "StatusCode": 200, @@ -18,16 +18,16 @@ "Content-Encoding": "gzip", "Content-Length": "5550", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 09 Nov 2022 07:39:58 GMT", + "Date": "Thu, 10 Nov 2022 05:57:49 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "113ce0a6-faf2-49fb-a510-1a3f5222198a", + "x-ms-correlation-request-id": "63919bf5-09c2-4456-b554-733665e57735", "x-ms-ratelimit-remaining-subscription-reads": "11996", - "x-ms-request-id": "113ce0a6-faf2-49fb-a510-1a3f5222198a", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073958Z:113ce0a6-faf2-49fb-a510-1a3f5222198a" + "x-ms-request-id": "63919bf5-09c2-4456-b554-733665e57735", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055750Z:63919bf5-09c2-4456-b554-733665e57735" }, "ResponseBody": { "value": [ diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.js b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.js deleted file mode 100644 index f2333be2788a..000000000000 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.js +++ /dev/null @@ -1,145 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "9952cc0ea1c4994aadeca9a2793db6cf"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '54d4de93-04fa-42b5-8de4-5f9566743300', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR2 ProdSlices', - 'Set-Cookie', - 'fpc=AiL5YOWDY0xNtHqiPZHQOvo; expires=Fri, 31-Dec-2021 02:42:53 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrq0_0DqsPB-HusQcZc9ZZLFKyFAGYcs8ob22JJDxW2Ec6ga17vIKQtB_MN6KGtqnOvQTTpp8yckSglwDnn0oHfp0uefW8jSMhHbI6eCzjO7hfOfrobb1mQJWgIHdM0Rm87aMt8jj58VzBqSNBDpoM0cUhnqz8x6T23wiea6Tb_JIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:53 GMT', - 'Content-Length', - '980' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '74e93c75-7e31-4cc2-85bf-639934944900', - 'x-ms-ests-server', - '2.1.12249.14 - SEASLR2 ProdSlices', - 'Set-Cookie', - 'fpc=Am5je4_BAZFKmphb0eDuXmE; expires=Fri, 31-Dec-2021 02:42:54 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrlCgupCyYWFvK4mT2IGveiAtaJGllnF3_jWcWDH-gJwkE9jdjyBzdtpJ8Q5fhQVlxdDkzsQNfjO74JGPGLT8PSbqUjsO4eVrxsVzPf2_pvO4lc9mWVaGWnXxkQqvWHrdijxXLhzGyJVi06aHu0JlQyWKBzFKJWt2hMunq7zDlYCYgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:54 GMT', - 'Content-Length', - '1753' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=cefd2c72-e1a2-42b4-ac39-30e1d8727afd&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") - .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'badfe93a-df4d-4f45-89c4-d13f05c44500', - 'x-ms-ests-server', - '2.1.12249.14 - KRSLR1 ProdSlices', - 'x-ms-clitelem', - '1,0,0,,', - 'Set-Cookie', - 'fpc=Ajn_PmnV-ZxGrIdYBOotwd0WPr5BAQAAAC7YONkOAAAA; expires=Fri, 31-Dec-2021 02:42:54 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 01 Dec 2021 02:42:54 GMT', - 'Content-Length', - '1374' -]); - -nock('https://management.azure.com:443', {"encodedQueryParams":true}) - .patch('/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/Microsoft.Resources/tags/default', {"operation":"Delete","properties":{"tags":{"tagkey1":"tagvalue1"}}}) - .query(true) - .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e5f69dbe66e9b5d347767f979b62edb8f461f2db3454efdbb0fdaeb153e187a955a10fc555eb745de7cf4e8177fc41f3efac5bfe497","fc92ff077ce1ccd5cb000000"], [ - 'Cache-Control', - 'no-cache', - 'Pragma', - 'no-cache', - 'Transfer-Encoding', - 'chunked', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Encoding', - 'gzip', - 'Expires', - '-1', - 'Vary', - 'Accept-Encoding', - 'x-ms-ratelimit-remaining-subscription-writes', - '1198', - 'x-ms-request-id', - '9b859ea2-f1f6-47e7-ba23-a26bde0d8fbe', - 'x-ms-correlation-request-id', - '9b859ea2-f1f6-47e7-ba23-a26bde0d8fbe', - 'x-ms-routing-request-id', - 'SOUTHEASTASIA:20211201T024255Z:9b859ea2-f1f6-47e7-ba23-a26bde0d8fbe', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Date', - 'Wed, 01 Dec 2021 02:42:55 GMT' -]); diff --git a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.json b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.json index e987d560846e..94667bee2793 100644 --- a/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.json +++ b/sdk/resources/arm-resources/recordings/node/resources_test/recording_tagsoperations_update_test.json @@ -11,7 +11,7 @@ "Content-Length": "68", "Content-Type": "application/json", "User-Agent": "azsdk-js-arm-resources/5.1.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "84de42df-4544-42f7-88c0-453c2d16b7a3" + "x-ms-client-request-id": "5d35bea3-5c89-4ab7-a7d3-db0e248ec54c" }, "RequestBody": { "operation": "Delete", @@ -26,17 +26,17 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 09 Nov 2022 07:39:59 GMT", + "Date": "Thu, 10 Nov 2022 05:57:51 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "cbff8c12-fcb3-460e-80f8-2f02585b0cee", + "x-ms-correlation-request-id": "a94d72f4-2a47-44a4-84e2-b1729f72fee2", "x-ms-ratelimit-remaining-subscription-writes": "1196", - "x-ms-request-id": "cbff8c12-fcb3-460e-80f8-2f02585b0cee", - "x-ms-routing-request-id": "SOUTHEASTASIA:20221109T073959Z:cbff8c12-fcb3-460e-80f8-2f02585b0cee" + "x-ms-request-id": "a94d72f4-2a47-44a4-84e2-b1729f72fee2", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221110T055751Z:a94d72f4-2a47-44a4-84e2-b1729f72fee2" }, "ResponseBody": { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest1/providers/Microsoft.Resources/tags/default", diff --git a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtManagementGroupScopeSample.ts b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtManagementGroupScopeSample.ts index 4f37f74a4337..11ae8b873957 100644 --- a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtManagementGroupScopeSample.ts +++ b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtManagementGroupScopeSample.ts @@ -26,11 +26,7 @@ async function predictTemplateChangesAtManagementGroupScope() { const deploymentName = "exampleDeploymentName"; const parameters: ScopedDeploymentWhatIf = { location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } + properties: { mode: "Incremental", parameters: {}, templateLink: {} } }; const credential = new DefaultAzureCredential(); const client = new ResourceManagementClient(credential, subscriptionId); diff --git a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtSubscriptionScopeSample.ts b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtSubscriptionScopeSample.ts index 22d6e8d2f3cc..7b4e19af94a4 100644 --- a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtSubscriptionScopeSample.ts +++ b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtSubscriptionScopeSample.ts @@ -25,11 +25,7 @@ async function predictTemplateChangesAtSubscriptionScope() { const deploymentName = "my-deployment"; const parameters: DeploymentWhatIf = { location: "westus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } + properties: { mode: "Incremental", parameters: {}, templateLink: {} } }; const credential = new DefaultAzureCredential(); const client = new ResourceManagementClient(credential, subscriptionId); diff --git a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtTenantScopeSample.ts index 5bb4d672f84c..e6dfcf7c6aab 100644 --- a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtTenantScopeSample.ts +++ b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfAtTenantScopeSample.ts @@ -25,11 +25,7 @@ async function predictTemplateChangesAtManagementGroupScope() { const deploymentName = "exampleDeploymentName"; const parameters: ScopedDeploymentWhatIf = { location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } + properties: { mode: "Incremental", parameters: {}, templateLink: {} } }; const credential = new DefaultAzureCredential(); const client = new ResourceManagementClient(credential, subscriptionId); diff --git a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfSample.ts b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfSample.ts index 0a5912a0f50a..65bfa94d74da 100644 --- a/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfSample.ts +++ b/sdk/resources/arm-resources/samples-dev/deploymentsWhatIfSample.ts @@ -25,11 +25,7 @@ async function predictTemplateChangesAtResourceGroupScope() { const resourceGroupName = "my-resource-group"; const deploymentName = "my-deployment"; const parameters: DeploymentWhatIf = { - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } + properties: { mode: "Incremental", parameters: {}, templateLink: {} } }; const credential = new DefaultAzureCredential(); const client = new ResourceManagementClient(credential, subscriptionId); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/README.md b/sdk/resources/arm-resources/samples/v5/javascript/README.md deleted file mode 100644 index ba83e0f22a73..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [deploymentsCalculateTemplateHashSample.js][deploymentscalculatetemplatehashsample] | Calculate the hash of the given template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json | -| [deploymentsCreateOrUpdateAtManagementGroupScopeSample.js][deploymentscreateorupdateatmanagementgroupscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json | -| [deploymentsCreateOrUpdateAtScopeSample.js][deploymentscreateorupdateatscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json | -| [deploymentsCreateOrUpdateAtSubscriptionScopeSample.js][deploymentscreateorupdateatsubscriptionscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json | -| [deploymentsCreateOrUpdateAtTenantScopeSample.js][deploymentscreateorupdateattenantscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json | -| [deploymentsCreateOrUpdateSample.js][deploymentscreateorupdatesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json | -| [deploymentsWhatIfAtManagementGroupScopeSample.js][deploymentswhatifatmanagementgroupscopesample] | Returns changes that will be made by the deployment if executed at the scope of the management group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json | -| [deploymentsWhatIfAtSubscriptionScopeSample.js][deploymentswhatifatsubscriptionscopesample] | Returns changes that will be made by the deployment if executed at the scope of the subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json | -| [deploymentsWhatIfAtTenantScopeSample.js][deploymentswhatifattenantscopesample] | Returns changes that will be made by the deployment if executed at the scope of the tenant group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json | -| [deploymentsWhatIfSample.js][deploymentswhatifsample] | Returns changes that will be made by the deployment if executed at the scope of the resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json | -| [providerResourceTypesListSample.js][providerresourcetypeslistsample] | List the resource types for a specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json | -| [providersGetAtTenantScopeSample.js][providersgetattenantscopesample] | Gets the specified resource provider at the tenant level. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json | -| [providersGetSample.js][providersgetsample] | Gets the specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json | -| [providersListSample.js][providerslistsample] | Gets all resource providers for a subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json | -| [providersProviderPermissionsSample.js][providersproviderpermissionssample] | Get the provider permissions. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json | -| [resourceGroupsCreateOrUpdateSample.js][resourcegroupscreateorupdatesample] | Creates or updates a resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json | -| [resourceGroupsDeleteSample.js][resourcegroupsdeletesample] | When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json | -| [resourceGroupsExportTemplateSample.js][resourcegroupsexporttemplatesample] | Captures the specified resource group as a template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json | -| [tagsCreateOrUpdateAtScopeSample.js][tagscreateorupdateatscopesample] | This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json | -| [tagsGetAtScopeSample.js][tagsgetatscopesample] | Gets the entire set of tags on a resource or subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node deploymentsCalculateTemplateHashSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node deploymentsCalculateTemplateHashSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[deploymentscalculatetemplatehashsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js -[deploymentscreateorupdateatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js -[deploymentscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js -[deploymentscreateorupdateatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js -[deploymentscreateorupdateattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js -[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js -[deploymentswhatifatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js -[deploymentswhatifatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js -[deploymentswhatifattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js -[deploymentswhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js -[providerresourcetypeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js -[providersgetattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js -[providersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js -[providerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js -[providersproviderpermissionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js -[resourcegroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js -[resourcegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js -[resourcegroupsexporttemplatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js -[tagscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js -[tagsgetatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources/README.md diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js deleted file mode 100644 index 85a819234b88..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Calculate the hash of the given template. - * - * @summary Calculate the hash of the given template. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json - */ -async function calculateTemplateHash() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const template = { - $schema: - "http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview", - contentVersion: "1.0.0.0", - outputs: { string: { type: "string", value: "myvalue" } }, - parameters: { string: { type: "string" } }, - resources: [], - variables: { - array: [1, 2, 3, 4], - bool: true, - int: 42, - object: { object: { location: "West US", vmSize: "Large" } }, - string: "string", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.calculateTemplateHash(template); - console.log(result); -} - -calculateTemplateHash().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js deleted file mode 100644 index c20ce8677c71..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json - */ -async function createDeploymentAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const groupId = "my-management-group-id"; - const deploymentName = "my-deployment"; - const parameters = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtManagementGroupScopeAndWait( - groupId, - deploymentName, - parameters - ); - console.log(result); -} - -createDeploymentAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js deleted file mode 100644 index cc4c06703491..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json - */ -async function createDeploymentAtAGivenScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = "providers/Microsoft.Management/managementGroups/my-management-group-id"; - const deploymentName = "my-deployment"; - const parameters = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtScopeAndWait( - scope, - deploymentName, - parameters - ); - console.log(result); -} - -createDeploymentAtAGivenScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js deleted file mode 100644 index e631da187b4c..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json - */ -async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const deploymentName = "my-deployment"; - const parameters = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { - id: "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtSubscriptionScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js deleted file mode 100644 index 379ee8a5553c..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json - */ -async function createDeploymentAtTenantScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const deploymentName = "tenant-dep01"; - const parameters = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtTenantScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -createDeploymentAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js deleted file mode 100644 index d9e19783fefb..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json - */ -async function createADeploymentThatWillDeployATemplateWithAUriAndQueryString() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters = { - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { - queryString: - "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d", - uri: "https://example.com/exampleTemplate.json", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillDeployATemplateWithAUriAndQueryString().catch(console.error); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json - */ -async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters = { - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { - id: "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch(console.error); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json - */ -async function createADeploymentThatWillRedeployAnotherDeploymentOnFailure() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters = { - properties: { - mode: "Complete", - onErrorDeployment: { - type: "SpecificDeployment", - deploymentName: "name-of-deployment-to-use", - }, - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillRedeployAnotherDeploymentOnFailure().catch(console.error); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json - */ -async function createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters = { - properties: { - mode: "Complete", - onErrorDeployment: { type: "LastSuccessful" }, - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js deleted file mode 100644 index 0b7d65e0a602..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the management group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json - */ -async function predictTemplateChangesAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const groupId = "myManagementGruop"; - const deploymentName = "exampleDeploymentName"; - const parameters = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAtManagementGroupScopeAndWait( - groupId, - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js deleted file mode 100644 index 6eefe73ba752..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json - */ -async function predictTemplateChangesAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const deploymentName = "my-deployment"; - const parameters = { - location: "westus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAtSubscriptionScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtSubscriptionScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js deleted file mode 100644 index b51fed2146af..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json - */ -async function predictTemplateChangesAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const deploymentName = "exampleDeploymentName"; - const parameters = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAtTenantScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js deleted file mode 100644 index 077f044ec3ba..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the resource group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json - */ -async function predictTemplateChangesAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters = { - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtResourceGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/package.json b/sdk/resources/arm-resources/samples/v5/javascript/package.json deleted file mode 100644 index 12f9056be514..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-resources-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=14.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/resources/arm-resources" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", - "dependencies": { - "@azure/arm-resources": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js deleted file mode 100644 index fb97a3cdcf2c..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to List the resource types for a specified resource provider. - * - * @summary List the resource types for a specified resource provider. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json - */ -async function getProviderResourceTypes() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceProviderNamespace = "Microsoft.TestRP"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providerResourceTypes.list(resourceProviderNamespace); - console.log(result); -} - -getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js deleted file mode 100644 index 445e2a249eba..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets the specified resource provider at the tenant level. - * - * @summary Gets the specified resource provider at the tenant level. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json - */ -async function getAResourceProviderAtTenantScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const expand = "resourceTypes/aliases"; - const resourceProviderNamespace = "Microsoft.Storage"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providers.getAtTenantScope(resourceProviderNamespace, options); - console.log(result); -} - -getAResourceProviderAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js deleted file mode 100644 index b6fe20b65918..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets the specified resource provider. - * - * @summary Gets the specified resource provider. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json - */ -async function getProvider() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceProviderNamespace = "Microsoft.TestRP1"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providers.get(resourceProviderNamespace); - console.log(result); -} - -getProvider().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js deleted file mode 100644 index ccc70914ee6e..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets all resource providers for a subscription. - * - * @summary Gets all resource providers for a subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json - */ -async function getProviders() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.providers.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getProviders().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js deleted file mode 100644 index 59829087b401..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the provider permissions. - * - * @summary Get the provider permissions. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json - */ -async function getProviderResourceTypes() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceProviderNamespace = "Microsoft.TestRP"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providers.providerPermissions(resourceProviderNamespace); - console.log(result); -} - -getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js deleted file mode 100644 index 92cd414ad069..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Creates or updates a resource group. - * - * @summary Creates or updates a resource group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json - */ -async function createOrUpdateAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const parameters = { location: "eastus" }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.createOrUpdate(resourceGroupName, parameters); - console.log(result); -} - -createOrUpdateAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js deleted file mode 100644 index e9bc48901916..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * - * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json - */ -async function forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const forceDeletionTypes = - "Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets"; - const options = { forceDeletionTypes }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginDeleteAndWait(resourceGroupName, options); - console.log(result); -} - -forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup().catch(console.error); - -/** - * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * - * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsInResourceGroup.json - */ -async function forceDeleteAllTheVirtualMachinesInAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const forceDeletionTypes = "Microsoft.Compute/virtualMachines"; - const options = { forceDeletionTypes }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginDeleteAndWait(resourceGroupName, options); - console.log(result); -} - -forceDeleteAllTheVirtualMachinesInAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js deleted file mode 100644 index 804fc2096199..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Captures the specified resource group as a template. - * - * @summary Captures the specified resource group as a template. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json - */ -async function exportAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const parameters = { - options: "IncludeParameterDefaultValue,IncludeComments", - resources: ["*"], - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginExportTemplateAndWait( - resourceGroupName, - parameters - ); - console.log(result); -} - -exportAResourceGroup().catch(console.error); - -/** - * This sample demonstrates how to Captures the specified resource group as a template. - * - * @summary Captures the specified resource group as a template. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroupWithFiltering.json - */ -async function exportAResourceGroupWithFiltering() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const parameters = { - options: "SkipResourceNameParameterization", - resources: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/My.RP/myResourceType/myFirstResource", - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginExportTemplateAndWait( - resourceGroupName, - parameters - ); - console.log(result); -} - -exportAResourceGroupWithFiltering().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/sample.env b/sdk/resources/arm-resources/samples/v5/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js deleted file mode 100644 index b870cdb54584..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * - * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json - */ -async function updateTagsOnAResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = - "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; - const parameters = { - properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.createOrUpdateAtScope(scope, parameters); - console.log(result); -} - -updateTagsOnAResource().catch(console.error); - -/** - * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * - * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsSubscription.json - */ -async function updateTagsOnASubscription() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; - const parameters = { - properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } }, - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.createOrUpdateAtScope(scope, parameters); - console.log(result); -} - -updateTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js deleted file mode 100644 index c878c2c92d51..000000000000 --- a/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. - * - * @summary Gets the entire set of tags on a resource or subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json - */ -async function getTagsOnAResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = - "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.getAtScope(scope); - console.log(result); -} - -getTagsOnAResource().catch(console.error); - -/** - * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. - * - * @summary Gets the entire set of tags on a resource or subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsSubscription.json - */ -async function getTagsOnASubscription() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.getAtScope(scope); - console.log(result); -} - -getTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/README.md b/sdk/resources/arm-resources/samples/v5/typescript/README.md deleted file mode 100644 index 9e633d641bf9..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/README.md +++ /dev/null @@ -1,101 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [deploymentsCalculateTemplateHashSample.ts][deploymentscalculatetemplatehashsample] | Calculate the hash of the given template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json | -| [deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts][deploymentscreateorupdateatmanagementgroupscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json | -| [deploymentsCreateOrUpdateAtScopeSample.ts][deploymentscreateorupdateatscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json | -| [deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts][deploymentscreateorupdateatsubscriptionscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json | -| [deploymentsCreateOrUpdateAtTenantScopeSample.ts][deploymentscreateorupdateattenantscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json | -| [deploymentsCreateOrUpdateSample.ts][deploymentscreateorupdatesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json | -| [deploymentsWhatIfAtManagementGroupScopeSample.ts][deploymentswhatifatmanagementgroupscopesample] | Returns changes that will be made by the deployment if executed at the scope of the management group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json | -| [deploymentsWhatIfAtSubscriptionScopeSample.ts][deploymentswhatifatsubscriptionscopesample] | Returns changes that will be made by the deployment if executed at the scope of the subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json | -| [deploymentsWhatIfAtTenantScopeSample.ts][deploymentswhatifattenantscopesample] | Returns changes that will be made by the deployment if executed at the scope of the tenant group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json | -| [deploymentsWhatIfSample.ts][deploymentswhatifsample] | Returns changes that will be made by the deployment if executed at the scope of the resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json | -| [providerResourceTypesListSample.ts][providerresourcetypeslistsample] | List the resource types for a specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json | -| [providersGetAtTenantScopeSample.ts][providersgetattenantscopesample] | Gets the specified resource provider at the tenant level. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json | -| [providersGetSample.ts][providersgetsample] | Gets the specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json | -| [providersListSample.ts][providerslistsample] | Gets all resource providers for a subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json | -| [providersProviderPermissionsSample.ts][providersproviderpermissionssample] | Get the provider permissions. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json | -| [resourceGroupsCreateOrUpdateSample.ts][resourcegroupscreateorupdatesample] | Creates or updates a resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json | -| [resourceGroupsDeleteSample.ts][resourcegroupsdeletesample] | When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json | -| [resourceGroupsExportTemplateSample.ts][resourcegroupsexporttemplatesample] | Captures the specified resource group as a template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json | -| [tagsCreateOrUpdateAtScopeSample.ts][tagscreateorupdateatscopesample] | This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json | -| [tagsGetAtScopeSample.ts][tagsgetatscopesample] | Gets the entire set of tags on a resource or subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/deploymentsCalculateTemplateHashSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node dist/deploymentsCalculateTemplateHashSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[deploymentscalculatetemplatehashsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts -[deploymentscreateorupdateatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts -[deploymentscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts -[deploymentscreateorupdateatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts -[deploymentscreateorupdateattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts -[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts -[deploymentswhatifatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts -[deploymentswhatifatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts -[deploymentswhatifattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts -[deploymentswhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts -[providerresourcetypeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts -[providersgetattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts -[providersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts -[providerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts -[providersproviderpermissionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts -[resourcegroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts -[resourcegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts -[resourcegroupsexporttemplatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts -[tagscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts -[tagsgetatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/resources/arm-resources/samples/v5/typescript/package.json b/sdk/resources/arm-resources/samples/v5/typescript/package.json deleted file mode 100644 index 051881c97e87..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-resources-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=14.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/resources/arm-resources" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", - "dependencies": { - "@azure/arm-resources": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^14.0.0", - "typescript": "~4.8.0", - "rimraf": "latest" - } -} diff --git a/sdk/resources/arm-resources/samples/v5/typescript/sample.env b/sdk/resources/arm-resources/samples/v5/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts deleted file mode 100644 index ef98d9c46a68..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Calculate the hash of the given template. - * - * @summary Calculate the hash of the given template. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json - */ -async function calculateTemplateHash() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const template: Record = { - $schema: - "http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview", - contentVersion: "1.0.0.0", - outputs: { string: { type: "string", value: "myvalue" } }, - parameters: { string: { type: "string" } }, - resources: [], - variables: { - array: [1, 2, 3, 4], - bool: true, - int: 42, - object: { object: { location: "West US", vmSize: "Large" } }, - string: "string" - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.calculateTemplateHash(template); - console.log(result); -} - -calculateTemplateHash().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts deleted file mode 100644 index 67139e55ae43..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ScopedDeployment, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json - */ -async function createDeploymentAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const groupId = "my-management-group-id"; - const deploymentName = "my-deployment"; - const parameters: ScopedDeployment = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtManagementGroupScopeAndWait( - groupId, - deploymentName, - parameters - ); - console.log(result); -} - -createDeploymentAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts deleted file mode 100644 index b0efcc3ad039..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Deployment, ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json - */ -async function createDeploymentAtAGivenScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = - "providers/Microsoft.Management/managementGroups/my-management-group-id"; - const deploymentName = "my-deployment"; - const parameters: Deployment = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - }, - tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtScopeAndWait( - scope, - deploymentName, - parameters - ); - console.log(result); -} - -createDeploymentAtAGivenScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts deleted file mode 100644 index 2c7ba97b349c..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Deployment, ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json - */ -async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const deploymentName = "my-deployment"; - const parameters: Deployment = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { - id: - "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1" - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtSubscriptionScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch( - console.error -); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts deleted file mode 100644 index 2a7a2b607b1b..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ScopedDeployment, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json - */ -async function createDeploymentAtTenantScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const deploymentName = "tenant-dep01"; - const parameters: ScopedDeployment = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - }, - tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAtTenantScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -createDeploymentAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts deleted file mode 100644 index fa6712c0b5cb..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Deployment, ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json - */ -async function createADeploymentThatWillDeployATemplateWithAUriAndQueryString() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters: Deployment = { - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { - queryString: - "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d", - uri: "https://example.com/exampleTemplate.json" - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillDeployATemplateWithAUriAndQueryString().catch( - console.error -); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json - */ -async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters: Deployment = { - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { - id: - "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1" - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch( - console.error -); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json - */ -async function createADeploymentThatWillRedeployAnotherDeploymentOnFailure() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters: Deployment = { - properties: { - mode: "Complete", - onErrorDeployment: { - type: "SpecificDeployment", - deploymentName: "name-of-deployment-to-use" - }, - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillRedeployAnotherDeploymentOnFailure().catch( - console.error -); - -/** - * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. - * - * @summary You can provide the template and parameters directly in the request or link to JSON files. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json - */ -async function createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters: Deployment = { - properties: { - mode: "Complete", - onErrorDeployment: { type: "LastSuccessful" }, - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure().catch( - console.error -); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts deleted file mode 100644 index 4f37f74a4337..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ScopedDeploymentWhatIf, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the management group. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the management group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json - */ -async function predictTemplateChangesAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const groupId = "myManagementGruop"; - const deploymentName = "exampleDeploymentName"; - const parameters: ScopedDeploymentWhatIf = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAtManagementGroupScopeAndWait( - groupId, - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts deleted file mode 100644 index 22d6e8d2f3cc..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DeploymentWhatIf, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the subscription. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json - */ -async function predictTemplateChangesAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const deploymentName = "my-deployment"; - const parameters: DeploymentWhatIf = { - location: "westus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAtSubscriptionScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtSubscriptionScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts deleted file mode 100644 index 5bb4d672f84c..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ScopedDeploymentWhatIf, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json - */ -async function predictTemplateChangesAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const deploymentName = "exampleDeploymentName"; - const parameters: ScopedDeploymentWhatIf = { - location: "eastus", - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAtTenantScopeAndWait( - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts deleted file mode 100644 index 0a5912a0f50a..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DeploymentWhatIf, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the resource group. - * - * @summary Returns changes that will be made by the deployment if executed at the scope of the resource group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json - */ -async function predictTemplateChangesAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000001"; - const resourceGroupName = "my-resource-group"; - const deploymentName = "my-deployment"; - const parameters: DeploymentWhatIf = { - properties: { - mode: "Incremental", - parameters: {}, - templateLink: { uri: "https://example.com/exampleTemplate.json" } - } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.deployments.beginWhatIfAndWait( - resourceGroupName, - deploymentName, - parameters - ); - console.log(result); -} - -predictTemplateChangesAtResourceGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts deleted file mode 100644 index b090f7f94330..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List the resource types for a specified resource provider. - * - * @summary List the resource types for a specified resource provider. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json - */ -async function getProviderResourceTypes() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceProviderNamespace = "Microsoft.TestRP"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providerResourceTypes.list( - resourceProviderNamespace - ); - console.log(result); -} - -getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts deleted file mode 100644 index e15e706b5352..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ProvidersGetAtTenantScopeOptionalParams, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the specified resource provider at the tenant level. - * - * @summary Gets the specified resource provider at the tenant level. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json - */ -async function getAResourceProviderAtTenantScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const expand = "resourceTypes/aliases"; - const resourceProviderNamespace = "Microsoft.Storage"; - const options: ProvidersGetAtTenantScopeOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providers.getAtTenantScope( - resourceProviderNamespace, - options - ); - console.log(result); -} - -getAResourceProviderAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts deleted file mode 100644 index bc749dab5de5..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the specified resource provider. - * - * @summary Gets the specified resource provider. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json - */ -async function getProvider() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceProviderNamespace = "Microsoft.TestRP1"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providers.get(resourceProviderNamespace); - console.log(result); -} - -getProvider().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts deleted file mode 100644 index bcd76e00734a..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets all resource providers for a subscription. - * - * @summary Gets all resource providers for a subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json - */ -async function getProviders() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.providers.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getProviders().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts deleted file mode 100644 index 819377488db7..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the provider permissions. - * - * @summary Get the provider permissions. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json - */ -async function getProviderResourceTypes() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceProviderNamespace = "Microsoft.TestRP"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.providers.providerPermissions( - resourceProviderNamespace - ); - console.log(result); -} - -getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts deleted file mode 100644 index 05d744c91c8a..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceGroup, ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates a resource group. - * - * @summary Creates or updates a resource group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json - */ -async function createOrUpdateAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const parameters: ResourceGroup = { location: "eastus" }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.createOrUpdate( - resourceGroupName, - parameters - ); - console.log(result); -} - -createOrUpdateAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts deleted file mode 100644 index b01fb3eebf0c..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ResourceGroupsDeleteOptionalParams, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * - * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json - */ -async function forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const forceDeletionTypes = - "Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets"; - const options: ResourceGroupsDeleteOptionalParams = { forceDeletionTypes }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginDeleteAndWait( - resourceGroupName, - options - ); - console.log(result); -} - -forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup().catch( - console.error -); - -/** - * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * - * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsInResourceGroup.json - */ -async function forceDeleteAllTheVirtualMachinesInAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const forceDeletionTypes = "Microsoft.Compute/virtualMachines"; - const options: ResourceGroupsDeleteOptionalParams = { forceDeletionTypes }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginDeleteAndWait( - resourceGroupName, - options - ); - console.log(result); -} - -forceDeleteAllTheVirtualMachinesInAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts deleted file mode 100644 index 9775c5733f95..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ExportTemplateRequest, - ResourceManagementClient -} from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Captures the specified resource group as a template. - * - * @summary Captures the specified resource group as a template. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json - */ -async function exportAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const parameters: ExportTemplateRequest = { - options: "IncludeParameterDefaultValue,IncludeComments", - resources: ["*"] - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginExportTemplateAndWait( - resourceGroupName, - parameters - ); - console.log(result); -} - -exportAResourceGroup().catch(console.error); - -/** - * This sample demonstrates how to Captures the specified resource group as a template. - * - * @summary Captures the specified resource group as a template. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroupWithFiltering.json - */ -async function exportAResourceGroupWithFiltering() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "my-resource-group"; - const parameters: ExportTemplateRequest = { - options: "SkipResourceNameParameterization", - resources: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/My.RP/myResourceType/myFirstResource" - ] - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.resourceGroups.beginExportTemplateAndWait( - resourceGroupName, - parameters - ); - console.log(result); -} - -exportAResourceGroupWithFiltering().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts deleted file mode 100644 index ad99eea1a194..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { TagsResource, ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * - * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json - */ -async function updateTagsOnAResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = - "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; - const parameters: TagsResource = { - properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.createOrUpdateAtScope( - scope, - parameters - ); - console.log(result); -} - -updateTagsOnAResource().catch(console.error); - -/** - * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * - * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsSubscription.json - */ -async function updateTagsOnASubscription() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; - const parameters: TagsResource = { - properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } } - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.createOrUpdateAtScope( - scope, - parameters - ); - console.log(result); -} - -updateTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts deleted file mode 100644 index d43b397344ee..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceManagementClient } from "@azure/arm-resources"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. - * - * @summary Gets the entire set of tags on a resource or subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json - */ -async function getTagsOnAResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = - "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.getAtScope(scope); - console.log(result); -} - -getTagsOnAResource().catch(console.error); - -/** - * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. - * - * @summary Gets the entire set of tags on a resource or subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsSubscription.json - */ -async function getTagsOnASubscription() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ResourceManagementClient(credential, subscriptionId); - const result = await client.tagsOperations.getAtScope(scope); - console.log(result); -} - -getTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json b/sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json deleted file mode 100644 index 416c2dd82e00..000000000000 --- a/sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2018", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/resources/arm-resources/src/models/index.ts b/sdk/resources/arm-resources/src/models/index.ts index 4a07f4157e22..8dc03bc08f1f 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -1994,7 +1994,7 @@ export interface ResourcesListOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the operation.

Filter comparison operators include `eq` (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, `plan/version`, and `plan/promotionCode`.

For example, to filter by a resource type, use `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`


`substringof(value, property)` can be used to filter for substrings of the following currently-supported properties: `name` and `resourceGroup`

For example, to get all resources with 'demo' anywhere in the resource name, use `$filter=substringof('demo', name)`

Multiple substring operations can also be combined using `and`/`or` operators.

Note that any truncated number of results queried via `$top` may also not be compatible when using a filter.


Resources can be filtered by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, the original tags for each resource will not be returned in the results. Any list of additional properties queried via `$expand` may also not be compatible when filtering by tag names/values.

For tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, `departureTime`, etc.)


Note that some properties can be combined when filtering resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. */ filter?: string; - /** The number of recommendations per page if a paged version of this API is being used. */ + /** The number of results to return. If null is passed, returns all resources. */ top?: number; /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ expand?: string; @@ -2120,7 +2120,7 @@ export interface ResourcesListNextOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the operation.

Filter comparison operators include `eq` (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, `plan/version`, and `plan/promotionCode`.

For example, to filter by a resource type, use `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`


`substringof(value, property)` can be used to filter for substrings of the following currently-supported properties: `name` and `resourceGroup`

For example, to get all resources with 'demo' anywhere in the resource name, use `$filter=substringof('demo', name)`

Multiple substring operations can also be combined using `and`/`or` operators.

Note that any truncated number of results queried via `$top` may also not be compatible when using a filter.


Resources can be filtered by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, the original tags for each resource will not be returned in the results. Any list of additional properties queried via `$expand` may also not be compatible when filtering by tag names/values.

For tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, `departureTime`, etc.)


Note that some properties can be combined when filtering resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. */ filter?: string; - /** The number of recommendations per page if a paged version of this API is being used. */ + /** The number of results to return. If null is passed, returns all resources. */ top?: number; /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ expand?: string; diff --git a/sdk/resources/arm-resources/src/operations/providers.ts b/sdk/resources/arm-resources/src/operations/providers.ts index 2b2f57d01cb4..1a34953ca117 100644 --- a/sdk/resources/arm-resources/src/operations/providers.ts +++ b/sdk/resources/arm-resources/src/operations/providers.ts @@ -173,10 +173,7 @@ export class ProvidersImpl implements Providers { } /** - * Registers a management group with a resource provider. Use this operation to register a resource - * provider with resource types that can be deployed at the management group scope. It does not - * recursively register subscriptions within the management group. Instead, you must register - * subscriptions individually. + * Registers a management group with a resource provider. * @param resourceProviderNamespace The namespace of the resource provider to register. * @param groupId The management group ID. * @param options The options parameters. diff --git a/sdk/resources/arm-resources/src/operations/resources.ts b/sdk/resources/arm-resources/src/operations/resources.ts index 239c148d1fdd..71d53c0776a9 100644 --- a/sdk/resources/arm-resources/src/operations/resources.ts +++ b/sdk/resources/arm-resources/src/operations/resources.ts @@ -821,9 +821,7 @@ export class ResourcesImpl implements Resources { } /** - * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource - * providers. In the event that a Resource provider does not implement this API, ARM will respond with - * a 405. The alternative then is to use the GET API to check for the existence of the resource. + * Checks by ID whether a resource exists. * @param resourceId The fully qualified ID of the resource, including the resource name and resource * type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts index 3b6c01bb2895..ee8f17fce3c8 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts @@ -51,10 +51,7 @@ export interface Providers { options?: ProvidersUnregisterOptionalParams ): Promise; /** - * Registers a management group with a resource provider. Use this operation to register a resource - * provider with resource types that can be deployed at the management group scope. It does not - * recursively register subscriptions within the management group. Instead, you must register - * subscriptions individually. + * Registers a management group with a resource provider. * @param resourceProviderNamespace The namespace of the resource provider to register. * @param groupId The management group ID. * @param options The options parameters. diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts index e4fba5652205..2e38346e4954 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts @@ -298,9 +298,7 @@ export interface Resources { options?: ResourcesGetOptionalParams ): Promise; /** - * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource - * providers. In the event that a Resource provider does not implement this API, ARM will respond with - * a 405. The alternative then is to use the GET API to check for the existence of the resource. + * Checks by ID whether a resource exists. * @param resourceId The fully qualified ID of the resource, including the resource name and resource * type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} From 1d54efa2d0688c21c67d14e0f0b4e20d6d039812 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Thu, 10 Nov 2022 14:00:40 +0800 Subject: [PATCH 5/5] update files --- .../samples/v5/javascript/README.md | 88 +++++++++++ .../deploymentsCalculateTemplateHashSample.js | 43 +++++ ...ateOrUpdateAtManagementGroupScopeSample.js | 42 +++++ .../deploymentsCreateOrUpdateAtScopeSample.js | 43 +++++ ...CreateOrUpdateAtSubscriptionScopeSample.js | 42 +++++ ...ymentsCreateOrUpdateAtTenantScopeSample.js | 41 +++++ .../deploymentsCreateOrUpdateSample.js | 139 ++++++++++++++++ ...mentsWhatIfAtManagementGroupScopeSample.js | 38 +++++ ...loymentsWhatIfAtSubscriptionScopeSample.js | 36 +++++ .../deploymentsWhatIfAtTenantScopeSample.js | 36 +++++ .../v5/javascript/deploymentsWhatIfSample.js | 37 +++++ .../samples/v5/javascript/package.json | 32 ++++ .../providerResourceTypesListSample.js | 29 ++++ .../providersGetAtTenantScopeSample.js | 31 ++++ .../v5/javascript/providersGetSample.js | 29 ++++ .../v5/javascript/providersListSample.js | 31 ++++ .../providersProviderPermissionsSample.js | 29 ++++ .../resourceGroupsCreateOrUpdateSample.js | 30 ++++ .../javascript/resourceGroupsDeleteSample.js | 51 ++++++ .../resourceGroupsExportTemplateSample.js | 62 ++++++++ .../samples/v5/javascript/sample.env | 4 + .../tagsCreateOrUpdateAtScopeSample.js | 53 +++++++ .../v5/javascript/tagsGetAtScopeSample.js | 47 ++++++ .../samples/v5/typescript/README.md | 101 ++++++++++++ .../samples/v5/typescript/package.json | 41 +++++ .../samples/v5/typescript/sample.env | 4 + .../deploymentsCalculateTemplateHashSample.ts | 43 +++++ ...ateOrUpdateAtManagementGroupScopeSample.ts | 45 ++++++ .../deploymentsCreateOrUpdateAtScopeSample.ts | 44 ++++++ ...CreateOrUpdateAtSubscriptionScopeSample.ts | 45 ++++++ ...ymentsCreateOrUpdateAtTenantScopeSample.ts | 44 ++++++ .../src/deploymentsCreateOrUpdateSample.ts | 148 ++++++++++++++++++ ...mentsWhatIfAtManagementGroupScopeSample.ts | 41 +++++ ...loymentsWhatIfAtSubscriptionScopeSample.ts | 39 +++++ .../deploymentsWhatIfAtTenantScopeSample.ts | 39 +++++ .../typescript/src/deploymentsWhatIfSample.ts | 40 +++++ .../src/providerResourceTypesListSample.ts | 31 ++++ .../src/providersGetAtTenantScopeSample.ts | 37 +++++ .../v5/typescript/src/providersGetSample.ts | 29 ++++ .../v5/typescript/src/providersListSample.ts | 31 ++++ .../src/providersProviderPermissionsSample.ts | 31 ++++ .../src/resourceGroupsCreateOrUpdateSample.ts | 33 ++++ .../src/resourceGroupsDeleteSample.ts | 62 ++++++++ .../src/resourceGroupsExportTemplateSample.ts | 65 ++++++++ .../src/tagsCreateOrUpdateAtScopeSample.ts | 59 +++++++ .../v5/typescript/src/tagsGetAtScopeSample.ts | 47 ++++++ .../samples/v5/typescript/tsconfig.json | 17 ++ 47 files changed, 2129 insertions(+) create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/README.md create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/package.json create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/sample.env create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/README.md create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/package.json create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/sample.env create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts create mode 100644 sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json diff --git a/sdk/resources/arm-resources/samples/v5/javascript/README.md b/sdk/resources/arm-resources/samples/v5/javascript/README.md new file mode 100644 index 000000000000..ba83e0f22a73 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/README.md @@ -0,0 +1,88 @@ +# client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [deploymentsCalculateTemplateHashSample.js][deploymentscalculatetemplatehashsample] | Calculate the hash of the given template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json | +| [deploymentsCreateOrUpdateAtManagementGroupScopeSample.js][deploymentscreateorupdateatmanagementgroupscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json | +| [deploymentsCreateOrUpdateAtScopeSample.js][deploymentscreateorupdateatscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json | +| [deploymentsCreateOrUpdateAtSubscriptionScopeSample.js][deploymentscreateorupdateatsubscriptionscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json | +| [deploymentsCreateOrUpdateAtTenantScopeSample.js][deploymentscreateorupdateattenantscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json | +| [deploymentsCreateOrUpdateSample.js][deploymentscreateorupdatesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json | +| [deploymentsWhatIfAtManagementGroupScopeSample.js][deploymentswhatifatmanagementgroupscopesample] | Returns changes that will be made by the deployment if executed at the scope of the management group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json | +| [deploymentsWhatIfAtSubscriptionScopeSample.js][deploymentswhatifatsubscriptionscopesample] | Returns changes that will be made by the deployment if executed at the scope of the subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json | +| [deploymentsWhatIfAtTenantScopeSample.js][deploymentswhatifattenantscopesample] | Returns changes that will be made by the deployment if executed at the scope of the tenant group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json | +| [deploymentsWhatIfSample.js][deploymentswhatifsample] | Returns changes that will be made by the deployment if executed at the scope of the resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json | +| [providerResourceTypesListSample.js][providerresourcetypeslistsample] | List the resource types for a specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json | +| [providersGetAtTenantScopeSample.js][providersgetattenantscopesample] | Gets the specified resource provider at the tenant level. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json | +| [providersGetSample.js][providersgetsample] | Gets the specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json | +| [providersListSample.js][providerslistsample] | Gets all resource providers for a subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json | +| [providersProviderPermissionsSample.js][providersproviderpermissionssample] | Get the provider permissions. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json | +| [resourceGroupsCreateOrUpdateSample.js][resourcegroupscreateorupdatesample] | Creates or updates a resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json | +| [resourceGroupsDeleteSample.js][resourcegroupsdeletesample] | When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json | +| [resourceGroupsExportTemplateSample.js][resourcegroupsexporttemplatesample] | Captures the specified resource group as a template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json | +| [tagsCreateOrUpdateAtScopeSample.js][tagscreateorupdateatscopesample] | This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json | +| [tagsGetAtScopeSample.js][tagsgetatscopesample] | Gets the entire set of tags on a resource or subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node deploymentsCalculateTemplateHashSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node deploymentsCalculateTemplateHashSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[deploymentscalculatetemplatehashsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js +[deploymentscreateorupdateatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js +[deploymentscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js +[deploymentscreateorupdateatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js +[deploymentscreateorupdateattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js +[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js +[deploymentswhatifatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js +[deploymentswhatifatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js +[deploymentswhatifattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js +[deploymentswhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js +[providerresourcetypeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js +[providersgetattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js +[providersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js +[providerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js +[providersproviderpermissionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js +[resourcegroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js +[resourcegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js +[resourcegroupsexporttemplatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js +[tagscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js +[tagsgetatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources/README.md diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js new file mode 100644 index 000000000000..85a819234b88 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCalculateTemplateHashSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Calculate the hash of the given template. + * + * @summary Calculate the hash of the given template. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json + */ +async function calculateTemplateHash() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const template = { + $schema: + "http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview", + contentVersion: "1.0.0.0", + outputs: { string: { type: "string", value: "myvalue" } }, + parameters: { string: { type: "string" } }, + resources: [], + variables: { + array: [1, 2, 3, 4], + bool: true, + int: 42, + object: { object: { location: "West US", vmSize: "Large" } }, + string: "string", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.calculateTemplateHash(template); + console.log(result); +} + +calculateTemplateHash().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js new file mode 100644 index 000000000000..c20ce8677c71 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtManagementGroupScopeSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json + */ +async function createDeploymentAtManagementGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const groupId = "my-management-group-id"; + const deploymentName = "my-deployment"; + const parameters = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtManagementGroupScopeAndWait( + groupId, + deploymentName, + parameters + ); + console.log(result); +} + +createDeploymentAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js new file mode 100644 index 000000000000..cc4c06703491 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtScopeSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json + */ +async function createDeploymentAtAGivenScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = "providers/Microsoft.Management/managementGroups/my-management-group-id"; + const deploymentName = "my-deployment"; + const parameters = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtScopeAndWait( + scope, + deploymentName, + parameters + ); + console.log(result); +} + +createDeploymentAtAGivenScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js new file mode 100644 index 000000000000..e631da187b4c --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtSubscriptionScopeSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json + */ +async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const deploymentName = "my-deployment"; + const parameters = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { + id: "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtSubscriptionScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js new file mode 100644 index 000000000000..379ee8a5553c --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateAtTenantScopeSample.js @@ -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. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json + */ +async function createDeploymentAtTenantScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const deploymentName = "tenant-dep01"; + const parameters = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtTenantScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +createDeploymentAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js new file mode 100644 index 000000000000..d9e19783fefb --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsCreateOrUpdateSample.js @@ -0,0 +1,139 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json + */ +async function createADeploymentThatWillDeployATemplateWithAUriAndQueryString() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters = { + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { + queryString: + "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d", + uri: "https://example.com/exampleTemplate.json", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillDeployATemplateWithAUriAndQueryString().catch(console.error); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json + */ +async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters = { + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { + id: "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch(console.error); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json + */ +async function createADeploymentThatWillRedeployAnotherDeploymentOnFailure() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters = { + properties: { + mode: "Complete", + onErrorDeployment: { + type: "SpecificDeployment", + deploymentName: "name-of-deployment-to-use", + }, + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillRedeployAnotherDeploymentOnFailure().catch(console.error); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json + */ +async function createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters = { + properties: { + mode: "Complete", + onErrorDeployment: { type: "LastSuccessful" }, + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js new file mode 100644 index 000000000000..3c34db0d3932 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtManagementGroupScopeSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the management group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json + */ +async function predictTemplateChangesAtManagementGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const groupId = "myManagementGruop"; + const deploymentName = "exampleDeploymentName"; + const parameters = { + location: "eastus", + properties: { mode: "Incremental", parameters: {}, templateLink: {} }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAtManagementGroupScopeAndWait( + groupId, + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js new file mode 100644 index 000000000000..2359c33b209b --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtSubscriptionScopeSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json + */ +async function predictTemplateChangesAtSubscriptionScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const deploymentName = "my-deployment"; + const parameters = { + location: "westus", + properties: { mode: "Incremental", parameters: {}, templateLink: {} }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAtSubscriptionScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtSubscriptionScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js new file mode 100644 index 000000000000..11d40683b268 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfAtTenantScopeSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json + */ +async function predictTemplateChangesAtManagementGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const deploymentName = "exampleDeploymentName"; + const parameters = { + location: "eastus", + properties: { mode: "Incremental", parameters: {}, templateLink: {} }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAtTenantScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js new file mode 100644 index 000000000000..e5f9473f19a3 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/deploymentsWhatIfSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the resource group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json + */ +async function predictTemplateChangesAtResourceGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters = { + properties: { mode: "Incremental", parameters: {}, templateLink: {} }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtResourceGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/package.json b/sdk/resources/arm-resources/samples/v5/javascript/package.json new file mode 100644 index 000000000000..12f9056be514 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "@azure-samples/arm-resources-js", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript", + "engines": { + "node": ">=14.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/resources/arm-resources" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", + "dependencies": { + "@azure/arm-resources": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js new file mode 100644 index 000000000000..fb97a3cdcf2c --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/providerResourceTypesListSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List the resource types for a specified resource provider. + * + * @summary List the resource types for a specified resource provider. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json + */ +async function getProviderResourceTypes() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceProviderNamespace = "Microsoft.TestRP"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providerResourceTypes.list(resourceProviderNamespace); + console.log(result); +} + +getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js new file mode 100644 index 000000000000..445e2a249eba --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/providersGetAtTenantScopeSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the specified resource provider at the tenant level. + * + * @summary Gets the specified resource provider at the tenant level. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json + */ +async function getAResourceProviderAtTenantScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const expand = "resourceTypes/aliases"; + const resourceProviderNamespace = "Microsoft.Storage"; + const options = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providers.getAtTenantScope(resourceProviderNamespace, options); + console.log(result); +} + +getAResourceProviderAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js new file mode 100644 index 000000000000..b6fe20b65918 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/providersGetSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the specified resource provider. + * + * @summary Gets the specified resource provider. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json + */ +async function getProvider() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceProviderNamespace = "Microsoft.TestRP1"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providers.get(resourceProviderNamespace); + console.log(result); +} + +getProvider().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js new file mode 100644 index 000000000000..ccc70914ee6e --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/providersListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets all resource providers for a subscription. + * + * @summary Gets all resource providers for a subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json + */ +async function getProviders() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.providers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getProviders().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js b/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js new file mode 100644 index 000000000000..59829087b401 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/providersProviderPermissionsSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the provider permissions. + * + * @summary Get the provider permissions. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json + */ +async function getProviderResourceTypes() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceProviderNamespace = "Microsoft.TestRP"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providers.providerPermissions(resourceProviderNamespace); + console.log(result); +} + +getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js new file mode 100644 index 000000000000..92cd414ad069 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsCreateOrUpdateSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates or updates a resource group. + * + * @summary Creates or updates a resource group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json + */ +async function createOrUpdateAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const parameters = { location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.createOrUpdate(resourceGroupName, parameters); + console.log(result); +} + +createOrUpdateAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js new file mode 100644 index 000000000000..e9bc48901916 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsDeleteSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * + * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json + */ +async function forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const forceDeletionTypes = + "Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets"; + const options = { forceDeletionTypes }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginDeleteAndWait(resourceGroupName, options); + console.log(result); +} + +forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup().catch(console.error); + +/** + * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * + * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsInResourceGroup.json + */ +async function forceDeleteAllTheVirtualMachinesInAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const forceDeletionTypes = "Microsoft.Compute/virtualMachines"; + const options = { forceDeletionTypes }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginDeleteAndWait(resourceGroupName, options); + console.log(result); +} + +forceDeleteAllTheVirtualMachinesInAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js new file mode 100644 index 000000000000..804fc2096199 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/resourceGroupsExportTemplateSample.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Captures the specified resource group as a template. + * + * @summary Captures the specified resource group as a template. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json + */ +async function exportAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const parameters = { + options: "IncludeParameterDefaultValue,IncludeComments", + resources: ["*"], + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginExportTemplateAndWait( + resourceGroupName, + parameters + ); + console.log(result); +} + +exportAResourceGroup().catch(console.error); + +/** + * This sample demonstrates how to Captures the specified resource group as a template. + * + * @summary Captures the specified resource group as a template. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroupWithFiltering.json + */ +async function exportAResourceGroupWithFiltering() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const parameters = { + options: "SkipResourceNameParameterization", + resources: [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/My.RP/myResourceType/myFirstResource", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginExportTemplateAndWait( + resourceGroupName, + parameters + ); + console.log(result); +} + +exportAResourceGroupWithFiltering().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/sample.env b/sdk/resources/arm-resources/samples/v5/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js new file mode 100644 index 000000000000..b870cdb54584 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/tagsCreateOrUpdateAtScopeSample.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * + * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json + */ +async function updateTagsOnAResource() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; + const parameters = { + properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.createOrUpdateAtScope(scope, parameters); + console.log(result); +} + +updateTagsOnAResource().catch(console.error); + +/** + * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * + * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsSubscription.json + */ +async function updateTagsOnASubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; + const parameters = { + properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } }, + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.createOrUpdateAtScope(scope, parameters); + console.log(result); +} + +updateTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js b/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js new file mode 100644 index 000000000000..c878c2c92d51 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/javascript/tagsGetAtScopeSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ResourceManagementClient } = require("@azure/arm-resources"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. + * + * @summary Gets the entire set of tags on a resource or subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json + */ +async function getTagsOnAResource() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.getAtScope(scope); + console.log(result); +} + +getTagsOnAResource().catch(console.error); + +/** + * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. + * + * @summary Gets the entire set of tags on a resource or subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsSubscription.json + */ +async function getTagsOnASubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.getAtScope(scope); + console.log(result); +} + +getTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/README.md b/sdk/resources/arm-resources/samples/v5/typescript/README.md new file mode 100644 index 000000000000..9e633d641bf9 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/README.md @@ -0,0 +1,101 @@ +# client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [deploymentsCalculateTemplateHashSample.ts][deploymentscalculatetemplatehashsample] | Calculate the hash of the given template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json | +| [deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts][deploymentscreateorupdateatmanagementgroupscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json | +| [deploymentsCreateOrUpdateAtScopeSample.ts][deploymentscreateorupdateatscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json | +| [deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts][deploymentscreateorupdateatsubscriptionscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json | +| [deploymentsCreateOrUpdateAtTenantScopeSample.ts][deploymentscreateorupdateattenantscopesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json | +| [deploymentsCreateOrUpdateSample.ts][deploymentscreateorupdatesample] | You can provide the template and parameters directly in the request or link to JSON files. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json | +| [deploymentsWhatIfAtManagementGroupScopeSample.ts][deploymentswhatifatmanagementgroupscopesample] | Returns changes that will be made by the deployment if executed at the scope of the management group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json | +| [deploymentsWhatIfAtSubscriptionScopeSample.ts][deploymentswhatifatsubscriptionscopesample] | Returns changes that will be made by the deployment if executed at the scope of the subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json | +| [deploymentsWhatIfAtTenantScopeSample.ts][deploymentswhatifattenantscopesample] | Returns changes that will be made by the deployment if executed at the scope of the tenant group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json | +| [deploymentsWhatIfSample.ts][deploymentswhatifsample] | Returns changes that will be made by the deployment if executed at the scope of the resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json | +| [providerResourceTypesListSample.ts][providerresourcetypeslistsample] | List the resource types for a specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json | +| [providersGetAtTenantScopeSample.ts][providersgetattenantscopesample] | Gets the specified resource provider at the tenant level. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json | +| [providersGetSample.ts][providersgetsample] | Gets the specified resource provider. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json | +| [providersListSample.ts][providerslistsample] | Gets all resource providers for a subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json | +| [providersProviderPermissionsSample.ts][providersproviderpermissionssample] | Get the provider permissions. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json | +| [resourceGroupsCreateOrUpdateSample.ts][resourcegroupscreateorupdatesample] | Creates or updates a resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json | +| [resourceGroupsDeleteSample.ts][resourcegroupsdeletesample] | When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json | +| [resourceGroupsExportTemplateSample.ts][resourcegroupsexporttemplatesample] | Captures the specified resource group as a template. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json | +| [tagsCreateOrUpdateAtScopeSample.ts][tagscreateorupdateatscopesample] | This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json | +| [tagsGetAtScopeSample.ts][tagsgetatscopesample] | Gets the entire set of tags on a resource or subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/deploymentsCalculateTemplateHashSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/deploymentsCalculateTemplateHashSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[deploymentscalculatetemplatehashsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts +[deploymentscreateorupdateatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts +[deploymentscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts +[deploymentscreateorupdateatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts +[deploymentscreateorupdateattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts +[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts +[deploymentswhatifatmanagementgroupscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts +[deploymentswhatifatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts +[deploymentswhatifattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts +[deploymentswhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts +[providerresourcetypeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts +[providersgetattenantscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts +[providersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts +[providerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts +[providersproviderpermissionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts +[resourcegroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts +[resourcegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts +[resourcegroupsexporttemplatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts +[tagscreateorupdateatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts +[tagsgetatscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/resources/arm-resources/samples/v5/typescript/package.json b/sdk/resources/arm-resources/samples/v5/typescript/package.json new file mode 100644 index 000000000000..051881c97e87 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure-samples/arm-resources-ts", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript", + "engines": { + "node": ">=14.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/resources/arm-resources" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", + "dependencies": { + "@azure/arm-resources": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^14.0.0", + "typescript": "~4.8.0", + "rimraf": "latest" + } +} diff --git a/sdk/resources/arm-resources/samples/v5/typescript/sample.env b/sdk/resources/arm-resources/samples/v5/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts new file mode 100644 index 000000000000..ef98d9c46a68 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCalculateTemplateHashSample.ts @@ -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 { ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Calculate the hash of the given template. + * + * @summary Calculate the hash of the given template. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json + */ +async function calculateTemplateHash() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const template: Record = { + $schema: + "http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview", + contentVersion: "1.0.0.0", + outputs: { string: { type: "string", value: "myvalue" } }, + parameters: { string: { type: "string" } }, + resources: [], + variables: { + array: [1, 2, 3, 4], + bool: true, + int: 42, + object: { object: { location: "West US", vmSize: "Large" } }, + string: "string" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.calculateTemplateHash(template); + console.log(result); +} + +calculateTemplateHash().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts new file mode 100644 index 000000000000..67139e55ae43 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtManagementGroupScopeSample.ts @@ -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 { + ScopedDeployment, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json + */ +async function createDeploymentAtManagementGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const groupId = "my-management-group-id"; + const deploymentName = "my-deployment"; + const parameters: ScopedDeployment = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtManagementGroupScopeAndWait( + groupId, + deploymentName, + parameters + ); + console.log(result); +} + +createDeploymentAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts new file mode 100644 index 000000000000..b0efcc3ad039 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtScopeSample.ts @@ -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 { Deployment, ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json + */ +async function createDeploymentAtAGivenScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = + "providers/Microsoft.Management/managementGroups/my-management-group-id"; + const deploymentName = "my-deployment"; + const parameters: Deployment = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + }, + tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtScopeAndWait( + scope, + deploymentName, + parameters + ); + console.log(result); +} + +createDeploymentAtAGivenScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts new file mode 100644 index 000000000000..2c7ba97b349c --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtSubscriptionScopeSample.ts @@ -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 { Deployment, ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json + */ +async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const deploymentName = "my-deployment"; + const parameters: Deployment = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { + id: + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtSubscriptionScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch( + console.error +); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts new file mode 100644 index 000000000000..2a7a2b607b1b --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateAtTenantScopeSample.ts @@ -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 { + ScopedDeployment, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json + */ +async function createDeploymentAtTenantScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const deploymentName = "tenant-dep01"; + const parameters: ScopedDeployment = { + location: "eastus", + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + }, + tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAtTenantScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +createDeploymentAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..fa6712c0b5cb --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsCreateOrUpdateSample.ts @@ -0,0 +1,148 @@ +/* + * 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 { Deployment, ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json + */ +async function createADeploymentThatWillDeployATemplateWithAUriAndQueryString() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters: Deployment = { + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { + queryString: + "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d", + uri: "https://example.com/exampleTemplate.json" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillDeployATemplateWithAUriAndQueryString().catch( + console.error +); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json + */ +async function createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters: Deployment = { + properties: { + mode: "Incremental", + parameters: {}, + templateLink: { + id: + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId().catch( + console.error +); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json + */ +async function createADeploymentThatWillRedeployAnotherDeploymentOnFailure() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters: Deployment = { + properties: { + mode: "Complete", + onErrorDeployment: { + type: "SpecificDeployment", + deploymentName: "name-of-deployment-to-use" + }, + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillRedeployAnotherDeploymentOnFailure().catch( + console.error +); + +/** + * This sample demonstrates how to You can provide the template and parameters directly in the request or link to JSON files. + * + * @summary You can provide the template and parameters directly in the request or link to JSON files. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json + */ +async function createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters: Deployment = { + properties: { + mode: "Complete", + onErrorDeployment: { type: "LastSuccessful" }, + parameters: {}, + templateLink: { uri: "https://example.com/exampleTemplate.json" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure().catch( + console.error +); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts new file mode 100644 index 000000000000..11ae8b873957 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtManagementGroupScopeSample.ts @@ -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 { + ScopedDeploymentWhatIf, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the management group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json + */ +async function predictTemplateChangesAtManagementGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const groupId = "myManagementGruop"; + const deploymentName = "exampleDeploymentName"; + const parameters: ScopedDeploymentWhatIf = { + location: "eastus", + properties: { mode: "Incremental", parameters: {}, templateLink: {} } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAtManagementGroupScopeAndWait( + groupId, + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts new file mode 100644 index 000000000000..7b4e19af94a4 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtSubscriptionScopeSample.ts @@ -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 { + DeploymentWhatIf, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json + */ +async function predictTemplateChangesAtSubscriptionScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const deploymentName = "my-deployment"; + const parameters: DeploymentWhatIf = { + location: "westus", + properties: { mode: "Incremental", parameters: {}, templateLink: {} } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAtSubscriptionScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtSubscriptionScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts new file mode 100644 index 000000000000..e6dfcf7c6aab --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfAtTenantScopeSample.ts @@ -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 { + ScopedDeploymentWhatIf, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json + */ +async function predictTemplateChangesAtManagementGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const deploymentName = "exampleDeploymentName"; + const parameters: ScopedDeploymentWhatIf = { + location: "eastus", + properties: { mode: "Incremental", parameters: {}, templateLink: {} } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAtTenantScopeAndWait( + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtManagementGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts new file mode 100644 index 000000000000..65bfa94d74da --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/deploymentsWhatIfSample.ts @@ -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 { + DeploymentWhatIf, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @summary Returns changes that will be made by the deployment if executed at the scope of the resource group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json + */ +async function predictTemplateChangesAtResourceGroupScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000001"; + const resourceGroupName = "my-resource-group"; + const deploymentName = "my-deployment"; + const parameters: DeploymentWhatIf = { + properties: { mode: "Incremental", parameters: {}, templateLink: {} } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.deployments.beginWhatIfAndWait( + resourceGroupName, + deploymentName, + parameters + ); + console.log(result); +} + +predictTemplateChangesAtResourceGroupScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts new file mode 100644 index 000000000000..b090f7f94330 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/providerResourceTypesListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List the resource types for a specified resource provider. + * + * @summary List the resource types for a specified resource provider. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json + */ +async function getProviderResourceTypes() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceProviderNamespace = "Microsoft.TestRP"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providerResourceTypes.list( + resourceProviderNamespace + ); + console.log(result); +} + +getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts new file mode 100644 index 000000000000..e15e706b5352 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetAtTenantScopeSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ProvidersGetAtTenantScopeOptionalParams, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified resource provider at the tenant level. + * + * @summary Gets the specified resource provider at the tenant level. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json + */ +async function getAResourceProviderAtTenantScope() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const expand = "resourceTypes/aliases"; + const resourceProviderNamespace = "Microsoft.Storage"; + const options: ProvidersGetAtTenantScopeOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providers.getAtTenantScope( + resourceProviderNamespace, + options + ); + console.log(result); +} + +getAResourceProviderAtTenantScope().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts new file mode 100644 index 000000000000..bc749dab5de5 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/providersGetSample.ts @@ -0,0 +1,29 @@ +/* + * 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 { ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified resource provider. + * + * @summary Gets the specified resource provider. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json + */ +async function getProvider() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceProviderNamespace = "Microsoft.TestRP1"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providers.get(resourceProviderNamespace); + console.log(result); +} + +getProvider().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts new file mode 100644 index 000000000000..bcd76e00734a --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/providersListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets all resource providers for a subscription. + * + * @summary Gets all resource providers for a subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json + */ +async function getProviders() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.providers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getProviders().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts new file mode 100644 index 000000000000..819377488db7 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/providersProviderPermissionsSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the provider permissions. + * + * @summary Get the provider permissions. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json + */ +async function getProviderResourceTypes() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceProviderNamespace = "Microsoft.TestRP"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.providers.providerPermissions( + resourceProviderNamespace + ); + console.log(result); +} + +getProviderResourceTypes().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..05d744c91c8a --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsCreateOrUpdateSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ResourceGroup, ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a resource group. + * + * @summary Creates or updates a resource group. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json + */ +async function createOrUpdateAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const parameters: ResourceGroup = { location: "eastus" }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.createOrUpdate( + resourceGroupName, + parameters + ); + console.log(result); +} + +createOrUpdateAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts new file mode 100644 index 000000000000..b01fb3eebf0c --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsDeleteSample.ts @@ -0,0 +1,62 @@ +/* + * 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 { + ResourceGroupsDeleteOptionalParams, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * + * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json + */ +async function forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const forceDeletionTypes = + "Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets"; + const options: ResourceGroupsDeleteOptionalParams = { forceDeletionTypes }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginDeleteAndWait( + resourceGroupName, + options + ); + console.log(result); +} + +forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup().catch( + console.error +); + +/** + * This sample demonstrates how to When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * + * @summary When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsInResourceGroup.json + */ +async function forceDeleteAllTheVirtualMachinesInAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const forceDeletionTypes = "Microsoft.Compute/virtualMachines"; + const options: ResourceGroupsDeleteOptionalParams = { forceDeletionTypes }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginDeleteAndWait( + resourceGroupName, + options + ); + console.log(result); +} + +forceDeleteAllTheVirtualMachinesInAResourceGroup().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts new file mode 100644 index 000000000000..9775c5733f95 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/resourceGroupsExportTemplateSample.ts @@ -0,0 +1,65 @@ +/* + * 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 { + ExportTemplateRequest, + ResourceManagementClient +} from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Captures the specified resource group as a template. + * + * @summary Captures the specified resource group as a template. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json + */ +async function exportAResourceGroup() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const parameters: ExportTemplateRequest = { + options: "IncludeParameterDefaultValue,IncludeComments", + resources: ["*"] + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginExportTemplateAndWait( + resourceGroupName, + parameters + ); + console.log(result); +} + +exportAResourceGroup().catch(console.error); + +/** + * This sample demonstrates how to Captures the specified resource group as a template. + * + * @summary Captures the specified resource group as a template. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroupWithFiltering.json + */ +async function exportAResourceGroupWithFiltering() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "my-resource-group"; + const parameters: ExportTemplateRequest = { + options: "SkipResourceNameParameterization", + resources: [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/My.RP/myResourceType/myFirstResource" + ] + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.resourceGroups.beginExportTemplateAndWait( + resourceGroupName, + parameters + ); + console.log(result); +} + +exportAResourceGroupWithFiltering().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts new file mode 100644 index 000000000000..ad99eea1a194 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/tagsCreateOrUpdateAtScopeSample.ts @@ -0,0 +1,59 @@ +/* + * 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 { TagsResource, ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * + * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json + */ +async function updateTagsOnAResource() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; + const parameters: TagsResource = { + properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.createOrUpdateAtScope( + scope, + parameters + ); + console.log(result); +} + +updateTagsOnAResource().catch(console.error); + +/** + * This sample demonstrates how to This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * + * @summary This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsSubscription.json + */ +async function updateTagsOnASubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; + const parameters: TagsResource = { + properties: { tags: { tagKey1: "tag-value-1", tagKey2: "tag-value-2" } } + }; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.createOrUpdateAtScope( + scope, + parameters + ); + console.log(result); +} + +updateTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts b/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts new file mode 100644 index 000000000000..d43b397344ee --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/src/tagsGetAtScopeSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ResourceManagementClient } from "@azure/arm-resources"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. + * + * @summary Gets the entire set of tags on a resource or subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json + */ +async function getTagsOnAResource() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.getAtScope(scope); + console.log(result); +} + +getTagsOnAResource().catch(console.error); + +/** + * This sample demonstrates how to Gets the entire set of tags on a resource or subscription. + * + * @summary Gets the entire set of tags on a resource or subscription. + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsSubscription.json + */ +async function getTagsOnASubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scope = "subscriptions/00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ResourceManagementClient(credential, subscriptionId); + const result = await client.tagsOperations.getAtScope(scope); + console.log(result); +} + +getTagsOnASubscription().catch(console.error); diff --git a/sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json b/sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/resources/arm-resources/samples/v5/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +}