diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 869a928380fa..05302643a252 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2990,7 +2990,7 @@ packages: dev: false /array-flatten/1.1.1: - resolution: {integrity: sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=} + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} dev: false /array-includes/3.1.5: @@ -3251,7 +3251,7 @@ packages: dev: false /buffer-equal-constant-time/1.0.1: - resolution: {integrity: sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=} + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} dev: false /buffer-from/1.1.2: @@ -3401,7 +3401,7 @@ packages: dev: false /charenc/0.0.2: - resolution: {integrity: sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=} + resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==} dev: false /check-error/1.0.2: @@ -3544,7 +3544,7 @@ packages: dev: false /concat-map/0.0.1: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: false /concurrently/6.5.1: @@ -3607,7 +3607,7 @@ packages: dev: false /cookie-signature/1.0.6: - resolution: {integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw=} + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} dev: false /cookie/0.4.2: @@ -3709,7 +3709,7 @@ packages: dev: false /crypt/0.0.2: - resolution: {integrity: sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=} + resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==} dev: false /csv-parse/5.3.0: @@ -3982,11 +3982,11 @@ packages: dev: false /edge-launcher/1.2.2: - resolution: {integrity: sha1-60Cq+9Bnpup27/+rBke81VCbN7I=} + resolution: {integrity: sha512-JcD5WBi3BHZXXVSSeEhl6sYO8g5cuynk/hifBzds2Bp4JdzCGLNMHgMCKu5DvrO1yatMgF0goFsxXRGus0yh1g==} dev: false /ee-first/1.1.1: - resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: false /electron-to-chromium/1.4.270: @@ -4871,7 +4871,7 @@ packages: dev: false /fresh/0.5.2: - resolution: {integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=} + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} engines: {node: '>= 0.6'} dev: false @@ -5011,7 +5011,7 @@ packages: dev: false /github-from-package/0.0.0: - resolution: {integrity: sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=} + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} dev: false /glob-parent/5.1.2: @@ -6441,7 +6441,7 @@ packages: dev: false /media-typer/0.3.0: - resolution: {integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=} + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} dev: false @@ -6451,7 +6451,7 @@ packages: dev: false /merge-descriptors/1.0.1: - resolution: {integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=} + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} dev: false /merge-source-map/1.1.0: @@ -6876,7 +6876,7 @@ packages: dev: false /noms/0.0.0: - resolution: {integrity: sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=} + resolution: {integrity: sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==} dependencies: inherits: 2.0.4 readable-stream: 1.0.34 @@ -9088,7 +9088,7 @@ packages: dev: false /utils-merge/1.0.1: - resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=} + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} dev: false @@ -13771,7 +13771,7 @@ packages: dev: false file:projects/arm-policyinsights.tgz: - resolution: {integrity: sha512-dByhV2Yd60m158bMSEktDcv2/O9EdnO8cfbP3vii8iuys8lOU6zAK8epOtWsV0n/40gProVOSCAiVnn1AeGG0A==, tarball: file:projects/arm-policyinsights.tgz} + resolution: {integrity: sha512-ru4lDBnj+5+U+Mj5VHYhYB8BT5R6V77lJPlVAkoSOMAPZ9/X7+rQnV2MrbeVGswJ9K0Y3YawS4A5EwOeA/MCag==, tarball: file:projects/arm-policyinsights.tgz} name: '@rush-temp/arm-policyinsights' version: 0.0.0 dependencies: @@ -13782,18 +13782,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.32 + 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_c164e18ebb1175294129df0cff345d2e tslib: 2.4.0 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.2 transitivePeerDependencies: - - '@types/node' - - encoding - supports-color dev: false @@ -15681,7 +15682,7 @@ packages: dev: false file:projects/communication-job-router.tgz: - resolution: {integrity: sha512-tq1y2fIgi1y040Xw8MtF5Ut5mAYz0UfmJrZksqCqxizgc5mzQdMcR233Fw9TgyEaofmbGdcMjVBncqmEHjbGQA==, tarball: file:projects/communication-job-router.tgz} + resolution: {integrity: sha512-UQIAjzokL3UPlFW+cKP3w0BnUIoku1Tix+cx0F0pxR6E7CS4u/fudugSdM7J+Ph6OGRAPLj/V1qHAhKw31vHGg==, tarball: file:projects/communication-job-router.tgz} name: '@rush-temp/communication-job-router' version: 0.0.0 dependencies: diff --git a/sdk/policyinsights/arm-policyinsights/CHANGELOG.md b/sdk/policyinsights/arm-policyinsights/CHANGELOG.md index 408c6472974c..95a3b8f87648 100644 --- a/sdk/policyinsights/arm-policyinsights/CHANGELOG.md +++ b/sdk/policyinsights/arm-policyinsights/CHANGELOG.md @@ -1,21 +1,13 @@ # Release History - -## 6.0.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 6.0.0-beta.1 (2022-03-31) + +## 6.0.0-beta.2 (2022-10-19) **Features** - Added operation PolicyRestrictions.checkAtManagementGroupScope + - Added Interface Attestation - Added Interface CheckManagementGroupRestrictionsRequest + - Added Interface PolicyMetadataProperties - Added Interface PolicyRestrictionsCheckAtManagementGroupScopeOptionalParams - Added Type Alias PolicyEventsResourceType - Added Type Alias PolicyRestrictionsCheckAtManagementGroupScopeResponse diff --git a/sdk/policyinsights/arm-policyinsights/_meta.json b/sdk/policyinsights/arm-policyinsights/_meta.json index 1aa6e25fc5f9..88c312c3c078 100644 --- a/sdk/policyinsights/arm-policyinsights/_meta.json +++ b/sdk/policyinsights/arm-policyinsights/_meta.json @@ -1,8 +1,8 @@ { - "commit": "3c1da29166fe1306071c939ac1344b092bafd0ce", + "commit": "54b27b92dc50b8f7361c6afb9872066ab14700b5", "readme": "specification/policyinsights/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\\policyinsights\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.18.20220329.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\\policyinsights\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.2.20221018.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.1", - "use": "@autorest/typescript@6.0.0-alpha.18.20220329.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", + "use": "@autorest/typescript@6.0.0-rc.2.20221018.1" } \ No newline at end of file diff --git a/sdk/policyinsights/arm-policyinsights/package.json b/sdk/policyinsights/arm-policyinsights/package.json index 6b60e6ad80dd..58637c163dfc 100644 --- a/sdk/policyinsights/arm-policyinsights/package.json +++ b/sdk/policyinsights/arm-policyinsights/package.json @@ -11,9 +11,9 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.0.0", + "@azure/core-client": "^1.5.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.1.0", + "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" }, "keywords": [ @@ -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/policyinsights/arm-policyinsights", "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-policyinsights?view=azure-node-preview" } -} +} \ No newline at end of file diff --git a/sdk/policyinsights/arm-policyinsights/recordings/node/my_test/recording_sample_test.js b/sdk/policyinsights/arm-policyinsights/recordings/node/my_test/recording_sample_test.js deleted file mode 100644 index 0f6ecb857acf..000000000000 --- a/sdk/policyinsights/arm-policyinsights/recordings/node/my_test/recording_sample_test.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/policyinsights/arm-policyinsights/recordings/node/policyinsights_test/recording_attestations_list_test.json b/sdk/policyinsights/arm-policyinsights/recordings/node/policyinsights_test/recording_attestations_list_test.json new file mode 100644 index 000000000000..013dc5d1aec4 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/recordings/node/policyinsights_test/recording_attestations_list_test.json @@ -0,0 +1,40 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.PolicyInsights/attestations?api-version=2022-09-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-policyinsights/6.0.0-beta.2 core-rest-pipeline/1.9.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "4fe4d5ee-e3be-4e0f-a578-17733d7f3b3b" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 19 Oct 2022 06:17:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "2f7e6393-00dc-4a7d-8943-f950e724b137", + "x-ms-ratelimit-remaining-policy-insights-requests": "149", + "x-ms-ratelimit-remaining-subscription-reads": "11999", + "x-ms-request-id": "2f7e6393-00dc-4a7d-8943-f950e724b137", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221019T061716Z:2f7e6393-00dc-4a7d-8943-f950e724b137" + }, + "ResponseBody": { + "value": [] + } + } + ], + "Variables": {} +} diff --git a/sdk/policyinsights/arm-policyinsights/review/arm-policyinsights.api.md b/sdk/policyinsights/arm-policyinsights/review/arm-policyinsights.api.md index a087a293df33..82fbb274adc1 100644 --- a/sdk/policyinsights/arm-policyinsights/review/arm-policyinsights.api.md +++ b/sdk/policyinsights/arm-policyinsights/review/arm-policyinsights.api.md @@ -11,18 +11,20 @@ import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; // @public -export type Attestation = Resource & { - readonly systemData?: SystemData; - policyAssignmentId: string; - policyDefinitionReferenceId?: string; +export interface Attestation extends Resource { + assessmentDate?: Date; + comments?: string; complianceState?: ComplianceState; + evidence?: AttestationEvidence[]; expiresOn?: Date; + readonly lastComplianceStateChangeAt?: Date; + metadata?: Record; owner?: string; - comments?: string; - evidence?: AttestationEvidence[]; + policyAssignmentId: string; + policyDefinitionReferenceId?: string; readonly provisioningState?: string; - readonly lastComplianceStateChangeAt?: Date; -}; + readonly systemData?: SystemData; +} // @public export interface AttestationEvidence { @@ -312,13 +314,9 @@ export enum KnownComplianceState { // @public export enum KnownCreatedByType { - // (undocumented) Application = "Application", - // (undocumented) Key = "Key", - // (undocumented) ManagedIdentity = "ManagedIdentity", - // (undocumented) User = "User" } @@ -331,27 +329,22 @@ export enum KnownFieldRestrictionResult { // @public export enum KnownPolicyEventsResourceType { - // (undocumented) Default = "default" } // @public export enum KnownPolicyStatesResource { - // (undocumented) Default = "default", - // (undocumented) Latest = "latest" } // @public export enum KnownPolicyStatesSummaryResourceType { - // (undocumented) Latest = "latest" } // @public export enum KnownPolicyTrackedResourcesResourceType { - // (undocumented) Default = "default" } @@ -715,10 +708,10 @@ export interface PolicyMetadataOperations { } // @public -export type PolicyMetadataProperties = PolicyMetadataSlimProperties & { +export interface PolicyMetadataProperties extends PolicyMetadataSlimProperties { readonly description?: string; readonly requirements?: string; -}; +} // @public export interface PolicyMetadataSlimProperties { diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsCreateOrUpdateAtResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsCreateOrUpdateAtResourceGroupSample.ts index 9e0c4c05e635..7e460e58fc2d 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsCreateOrUpdateAtResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsCreateOrUpdateAtResourceGroupSample.ts @@ -15,13 +15,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Creates or updates an attestation at resource group scope. * * @summary Creates or updates an attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceGroupScope.json */ async function createAttestationAtResourceGroupScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; const resourceGroupName = "myRg"; const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; const parameters: Attestation = { + assessmentDate: new Date("2021-06-10T00:00:00Z"), comments: "This subscription has passed a security audit.", complianceState: "Compliant", evidence: [ @@ -32,6 +33,7 @@ async function createAttestationAtResourceGroupScope() { } ], expiresOn: new Date("2021-06-15T00:00:00Z"), + metadata: { departmentId: "NYC-MARKETING-1" }, owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", policyAssignmentId: "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsCreateOrUpdateAtResourceSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsCreateOrUpdateAtResourceSample.ts index 986a2cf10905..19285ddc3807 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsCreateOrUpdateAtResourceSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsCreateOrUpdateAtResourceSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Creates or updates an attestation at resource scope. * * @summary Creates or updates an attestation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceScope.json */ async function createAttestationAtIndividualResourceScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; @@ -23,6 +23,7 @@ async function createAttestationAtIndividualResourceScope() { "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; const parameters: Attestation = { + assessmentDate: new Date("2021-06-10T00:00:00Z"), comments: "This subscription has passed a security audit.", complianceState: "Compliant", evidence: [ @@ -33,6 +34,7 @@ async function createAttestationAtIndividualResourceScope() { } ], expiresOn: new Date("2021-06-15T00:00:00Z"), + metadata: { departmentId: "NYC-MARKETING-1" }, owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", policyAssignmentId: "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsCreateOrUpdateAtSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsCreateOrUpdateAtSubscriptionSample.ts index 166c66d7ac39..55ae1a7c2b6f 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsCreateOrUpdateAtSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsCreateOrUpdateAtSubscriptionSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Creates or updates an attestation at subscription scope. * * @summary Creates or updates an attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateSubscriptionScope.json */ async function createAttestationAtSubscriptionScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; @@ -40,12 +40,13 @@ createAttestationAtSubscriptionScope().catch(console.error); * This sample demonstrates how to Creates or updates an attestation at subscription scope. * * @summary Creates or updates an attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json */ async function createAttestationAtSubscriptionScopeWithAllProperties() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; const parameters: Attestation = { + assessmentDate: new Date("2021-06-10T00:00:00Z"), comments: "This subscription has passed a security audit.", complianceState: "Compliant", evidence: [ @@ -56,6 +57,7 @@ async function createAttestationAtSubscriptionScopeWithAllProperties() { } ], expiresOn: new Date("2021-06-15T00:00:00Z"), + metadata: { departmentId: "NYC-MARKETING-1" }, owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", policyAssignmentId: "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsDeleteAtResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsDeleteAtResourceGroupSample.ts index f022282866d2..1424292c8c52 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsDeleteAtResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsDeleteAtResourceGroupSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Deletes an existing attestation at resource group scope. * * @summary Deletes an existing attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceGroupScope.json */ async function deleteAttestationAtResourceGroupScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsDeleteAtResourceSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsDeleteAtResourceSample.ts index c047a88f0dcd..71138952fcd4 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsDeleteAtResourceSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsDeleteAtResourceSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Deletes an existing attestation at individual resource scope. * * @summary Deletes an existing attestation at individual resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceScope.json */ async function deleteAttestationAtIndividualResourceScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsDeleteAtSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsDeleteAtSubscriptionSample.ts index 7c8b8a05dfc4..28ea15d08e77 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsDeleteAtSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsDeleteAtSubscriptionSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Deletes an existing attestation at subscription scope. * * @summary Deletes an existing attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteSubscriptionScope.json */ async function deleteAttestationAtSubscriptionScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsGetAtResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsGetAtResourceGroupSample.ts index 244939451bb6..6d471679b3c3 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsGetAtResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsGetAtResourceGroupSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets an existing attestation at resource group scope. * * @summary Gets an existing attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceGroupScope.json */ async function getAttestationAtResourceGroupScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsGetAtResourceSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsGetAtResourceSample.ts index cbd28a584822..1a0a36eeff20 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsGetAtResourceSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsGetAtResourceSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets an existing attestation at resource scope. * * @summary Gets an existing attestation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceScope.json */ async function getAttestationAtIndividualResourceScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsGetAtSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsGetAtSubscriptionSample.ts index 692307b8a8aa..4f2b8e65c467 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsGetAtSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsGetAtSubscriptionSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets an existing attestation at subscription scope. * * @summary Gets an existing attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetSubscriptionScope.json */ async function getAttestationAtSubscriptionScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsListForResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsListForResourceGroupSample.ts index d7166a4d6703..ef340c82fe0f 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsListForResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsListForResourceGroupSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets all attestations for the resource group. * * @summary Gets all attestations for the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceGroupScope.json */ async function listAttestationsAtResourceGroupScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; @@ -40,7 +40,7 @@ listAttestationsAtResourceGroupScope().catch(console.error); * This sample demonstrates how to Gets all attestations for the resource group. * * @summary Gets all attestations for the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceGroupScope_WithQuery.json */ async function listAttestationsAtResourceGroupScopeWithQueryParameters() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsListForResourceSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsListForResourceSample.ts index acb8df8415cf..5c8cd8b86f83 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsListForResourceSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsListForResourceSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets all attestations for a resource. * * @summary Gets all attestations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceScope.json */ async function listAttestationsAtIndividualResourceScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ listAttestationsAtIndividualResourceScope().catch(console.error); * This sample demonstrates how to Gets all attestations for a resource. * * @summary Gets all attestations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceScope_WithQuery.json */ async function listAttestationsAtIndividualResourceScopeWithQueryParameters() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsListForSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsListForSubscriptionSample.ts index d40b07167746..e126940d1f35 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsListForSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/attestationsListForSubscriptionSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets all attestations for the subscription. * * @summary Gets all attestations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListSubscriptionScope.json */ async function listAttestationsAtSubscriptionScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; @@ -37,7 +37,7 @@ listAttestationsAtSubscriptionScope().catch(console.error); * This sample demonstrates how to Gets all attestations for the subscription. * * @summary Gets all attestations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListSubscriptionScope_WithQuery.json */ async function listAttestationsAtSubscriptionScopeWithQueryParameters() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/cancelARemediationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/cancelARemediationAtIndividualResourceScope.ts deleted file mode 100644 index 29a33c4bf930..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/cancelARemediationAtIndividualResourceScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Cancel a remediation at resource scope. - * - * @summary Cancel a remediation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function cancelARemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.cancelAtResource( - resourceId, - remediationName - ); - console.log(result); -} - -cancelARemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/cancelARemediationAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/cancelARemediationAtManagementGroupScope.ts deleted file mode 100644 index 7ae993e98282..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/cancelARemediationAtManagementGroupScope.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. -/** - * This sample demonstrates how to Cancels a remediation at management group scope. - * - * @summary Cancels a remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function cancelARemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.cancelAtManagementGroup( - managementGroupId, - remediationName - ); - console.log(result); -} - -cancelARemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/cancelARemediationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/cancelARemediationAtResourceGroupScope.ts deleted file mode 100644 index b8d35abb0e22..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/cancelARemediationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Cancels a remediation at resource group scope. - * - * @summary Cancels a remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function cancelARemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.cancelAtResourceGroup( - resourceGroupName, - remediationName - ); - console.log(result); -} - -cancelARemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/cancelARemediationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/cancelARemediationAtSubscriptionScope.ts deleted file mode 100644 index 1deb903f9c07..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/cancelARemediationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Cancels a remediation at subscription scope. - * - * @summary Cancels a remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function cancelARemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.cancelAtSubscription( - remediationName - ); - console.log(result); -} - -cancelARemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/checkPolicyRestrictionsAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/checkPolicyRestrictionsAtResourceGroupScope.ts deleted file mode 100644 index 316e8a2683d7..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/checkPolicyRestrictionsAtResourceGroupScope.ts +++ /dev/null @@ -1,52 +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. -/** - * This sample demonstrates how to Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. - * - * @summary Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json - */ -import { - CheckRestrictionsRequest, - PolicyInsightsClient -} from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function checkPolicyRestrictionsAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "vmRg"; - const parameters: CheckRestrictionsRequest = { - pendingFields: [ - { field: "name", values: ["myVMName"] }, - { - field: "location", - values: ["eastus", "westus", "westus2", "westeurope"] - }, - { field: "tags" } - ], - resourceDetails: { - apiVersion: "2019-12-01", - resourceContent: { - type: "Microsoft.Compute/virtualMachines", - properties: { priority: "Spot" } - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyRestrictions.checkAtResourceGroupScope( - resourceGroupName, - parameters - ); - console.log(result); -} - -checkPolicyRestrictionsAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/checkPolicyRestrictionsAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/checkPolicyRestrictionsAtSubscriptionScope.ts deleted file mode 100644 index 5e3dc6909e82..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/checkPolicyRestrictionsAtSubscriptionScope.ts +++ /dev/null @@ -1,50 +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. -/** - * This sample demonstrates how to Checks what restrictions Azure Policy will place on a resource within a subscription. - * - * @summary Checks what restrictions Azure Policy will place on a resource within a subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json - */ -import { - CheckRestrictionsRequest, - PolicyInsightsClient -} from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function checkPolicyRestrictionsAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const parameters: CheckRestrictionsRequest = { - pendingFields: [ - { field: "name", values: ["myVMName"] }, - { - field: "location", - values: ["eastus", "westus", "westus2", "westeurope"] - }, - { field: "tags" } - ], - resourceDetails: { - apiVersion: "2019-12-01", - resourceContent: { - type: "Microsoft.Compute/virtualMachines", - properties: { priority: "Spot" } - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyRestrictions.checkAtSubscriptionScope( - parameters - ); - console.log(result); -} - -checkPolicyRestrictionsAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/createAttestationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/createAttestationAtIndividualResourceScope.ts deleted file mode 100644 index ee21a3ae6f86..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/createAttestationAtIndividualResourceScope.ts +++ /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. -/** - * This sample demonstrates how to Creates or updates an attestation at resource scope. - * - * @summary Creates or updates an attestation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceScope.json - */ -import { Attestation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createAttestationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const parameters: Attestation = { - comments: "This subscription has passed a security audit.", - complianceState: "Compliant", - evidence: [ - { - description: "The results of the security audit.", - sourceUri: - "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011" - } - ], - expiresOn: new Date("2021-06-15T00:00:00Z"), - owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - policyDefinitionReferenceId: "0b158b46-ff42-4799-8e39-08a5c23b4551" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.beginCreateOrUpdateAtResourceAndWait( - resourceId, - attestationName, - parameters - ); - console.log(result); -} - -createAttestationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/createAttestationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/createAttestationAtResourceGroupScope.ts deleted file mode 100644 index 4a2a85867819..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/createAttestationAtResourceGroupScope.ts +++ /dev/null @@ -1,50 +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. -/** - * This sample demonstrates how to Creates or updates an attestation at resource group scope. - * - * @summary Creates or updates an attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceGroupScope.json - */ -import { Attestation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createAttestationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const parameters: Attestation = { - comments: "This subscription has passed a security audit.", - complianceState: "Compliant", - evidence: [ - { - description: "The results of the security audit.", - sourceUri: - "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011" - } - ], - expiresOn: new Date("2021-06-15T00:00:00Z"), - owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - policyDefinitionReferenceId: "0b158b46-ff42-4799-8e39-08a5c23b4551" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.beginCreateOrUpdateAtResourceGroupAndWait( - resourceGroupName, - attestationName, - parameters - ); - console.log(result); -} - -createAttestationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/createAttestationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/createAttestationAtSubscriptionScope.ts deleted file mode 100644 index fdac1465e2a9..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/createAttestationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Creates or updates an attestation at subscription scope. - * - * @summary Creates or updates an attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope.json - */ -import { Attestation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createAttestationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const parameters: Attestation = { - complianceState: "Compliant", - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.beginCreateOrUpdateAtSubscriptionAndWait( - attestationName, - parameters - ); - console.log(result); -} - -createAttestationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/createAttestationAtSubscriptionScopeWithAllProperties.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/createAttestationAtSubscriptionScopeWithAllProperties.ts deleted file mode 100644 index 4ae675cad5fc..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/createAttestationAtSubscriptionScopeWithAllProperties.ts +++ /dev/null @@ -1,48 +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. -/** - * This sample demonstrates how to Creates or updates an attestation at subscription scope. - * - * @summary Creates or updates an attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json - */ -import { Attestation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createAttestationAtSubscriptionScopeWithAllProperties() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const parameters: Attestation = { - comments: "This subscription has passed a security audit.", - complianceState: "Compliant", - evidence: [ - { - description: "The results of the security audit.", - sourceUri: - "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011" - } - ], - expiresOn: new Date("2021-06-15T00:00:00Z"), - owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - policyDefinitionReferenceId: "0b158b46-ff42-4799-8e39-08a5c23b4551" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.beginCreateOrUpdateAtSubscriptionAndWait( - attestationName, - parameters - ); - console.log(result); -} - -createAttestationAtSubscriptionScopeWithAllProperties().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtIndividualResourceScope.ts deleted file mode 100644 index 04667769a054..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Creates or updates a remediation at resource scope. - * - * @summary Creates or updates a remediation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceScope.json - */ -import { Remediation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createRemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "storageRemediation"; - const parameters: Remediation = { - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtResource( - resourceId, - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtManagementGroupScope.ts deleted file mode 100644 index aad903ea5f50..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtManagementGroupScope.ts +++ /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. -/** - * This sample demonstrates how to Creates or updates a remediation at management group scope. - * - * @summary Creates or updates a remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateManagementGroupScope.json - */ -import { Remediation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createRemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "storageRemediation"; - const parameters: Remediation = { - policyAssignmentId: - "/providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtManagementGroup( - managementGroupId, - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtResourceGroupScope.ts deleted file mode 100644 index ef47b99bce24..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtResourceGroupScope.ts +++ /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. -/** - * This sample demonstrates how to Creates or updates a remediation at resource group scope. - * - * @summary Creates or updates a remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceGroupScope.json - */ -import { Remediation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createRemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "storageRemediation"; - const parameters: Remediation = { - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtResourceGroup( - resourceGroupName, - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtSubscriptionScope.ts deleted file mode 100644 index 7b6fbfc48163..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtSubscriptionScope.ts +++ /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. -/** - * This sample demonstrates how to Creates or updates a remediation at subscription scope. - * - * @summary Creates or updates a remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json - */ -import { Remediation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createRemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "storageRemediation"; - const parameters: Remediation = { - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtSubscription( - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtSubscriptionScopeWithAllProperties.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtSubscriptionScopeWithAllProperties.ts deleted file mode 100644 index 16f806a669bb..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/createRemediationAtSubscriptionScopeWithAllProperties.ts +++ /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. -/** - * This sample demonstrates how to Creates or updates a remediation at subscription scope. - * - * @summary Creates or updates a remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope_AllProperties.json - */ -import { Remediation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createRemediationAtSubscriptionScopeWithAllProperties() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "storageRemediation"; - const parameters: Remediation = { - failureThreshold: { percentage: 0.1 }, - filters: { locations: ["eastus", "westus"] }, - parallelDeployments: 6, - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - policyDefinitionReferenceId: "8c8fa9e4", - resourceCount: 42, - resourceDiscoveryMode: "ReEvaluateCompliance" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtSubscription( - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtSubscriptionScopeWithAllProperties().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteAttestationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/deleteAttestationAtIndividualResourceScope.ts deleted file mode 100644 index 41c45bb5ebec..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteAttestationAtIndividualResourceScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Deletes an existing attestation at individual resource scope. - * - * @summary Deletes an existing attestation at individual resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteAttestationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.deleteAtResource( - resourceId, - attestationName - ); - console.log(result); -} - -deleteAttestationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteAttestationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/deleteAttestationAtResourceGroupScope.ts deleted file mode 100644 index 6a89030746aa..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteAttestationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Deletes an existing attestation at resource group scope. - * - * @summary Deletes an existing attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteAttestationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.deleteAtResourceGroup( - resourceGroupName, - attestationName - ); - console.log(result); -} - -deleteAttestationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteAttestationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/deleteAttestationAtSubscriptionScope.ts deleted file mode 100644 index 9c9c155fad3f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteAttestationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Deletes an existing attestation at subscription scope. - * - * @summary Deletes an existing attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteAttestationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.deleteAtSubscription( - attestationName - ); - console.log(result); -} - -deleteAttestationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteRemediationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/deleteRemediationAtIndividualResourceScope.ts deleted file mode 100644 index 60f9d96a104f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteRemediationAtIndividualResourceScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Deletes an existing remediation at individual resource scope. - * - * @summary Deletes an existing remediation at individual resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteRemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.deleteAtResource( - resourceId, - remediationName - ); - console.log(result); -} - -deleteRemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteRemediationAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/deleteRemediationAtManagementGroupScope.ts deleted file mode 100644 index d9dd1ef7d912..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteRemediationAtManagementGroupScope.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. -/** - * This sample demonstrates how to Deletes an existing remediation at management group scope. - * - * @summary Deletes an existing remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteRemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.deleteAtManagementGroup( - managementGroupId, - remediationName - ); - console.log(result); -} - -deleteRemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteRemediationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/deleteRemediationAtResourceGroupScope.ts deleted file mode 100644 index aa3eaf378e24..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteRemediationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Deletes an existing remediation at resource group scope. - * - * @summary Deletes an existing remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteRemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.deleteAtResourceGroup( - resourceGroupName, - remediationName - ); - console.log(result); -} - -deleteRemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteRemediationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/deleteRemediationAtSubscriptionScope.ts deleted file mode 100644 index 3a356d08a4c4..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/deleteRemediationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Deletes an existing remediation at subscription scope. - * - * @summary Deletes an existing remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteRemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.deleteAtSubscription( - remediationName - ); - console.log(result); -} - -deleteRemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/filterAndAggregateOnly.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/filterAndAggregateOnly.ts deleted file mode 100644 index 5399e3b73a67..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/filterAndAggregateOnly.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndAggregateOnly.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function filterAndAggregateOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const from = new Date("2019-10-05T18:00:00Z"); - const filter = "PolicyDefinitionAction eq 'deny'"; - const apply = "aggregate($count as NumDenyStates)"; - const options = { from: from, filter: filter, apply: apply }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -filterAndAggregateOnly().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/filterAndGroupWithAggregate.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/filterAndGroupWithAggregate.ts deleted file mode 100644 index 6e11463ac34a..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/filterAndGroupWithAggregate.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndGroupByWithAggregate.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function filterAndGroupWithAggregate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 2; - const orderBy = "NumAuditDenyNonComplianceRecords desc"; - const from = new Date("2019-10-05T18:00:00Z"); - const filter = - "IsCompliant eq false and (PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny')"; - const apply = - "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumAuditDenyNonComplianceRecords))"; - const options = { - top: top, - orderBy: orderBy, - from: from, - filter: filter, - apply: apply - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -filterAndGroupWithAggregate().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/filterAndGroupWithoutAggregate.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/filterAndGroupWithoutAggregate.ts deleted file mode 100644 index 7bd7ac43f0dd..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/filterAndGroupWithoutAggregate.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndGroupByWithoutAggregate.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function filterAndGroupWithoutAggregate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 2; - const from = new Date("2019-10-05T18:00:00Z"); - const filter = - "IsCompliant eq false and (PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append')"; - const apply = - "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId))"; - const options = { top: top, from: from, filter: filter, apply: apply }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -filterAndGroupWithoutAggregate().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/filterAndMultipleGroups.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/filterAndMultipleGroups.ts deleted file mode 100644 index 270d5481b657..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/filterAndMultipleGroups.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndMultipleGroups.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function filterAndMultipleGroups() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 10; - const orderBy = "NumNonCompliantResources desc"; - const filter = "IsCompliant eq false"; - const apply = - "groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId, ResourceId))/groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId), aggregate($count as NumNonCompliantResources))"; - const options = { top: top, orderBy: orderBy, filter: filter, apply: apply }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -filterAndMultipleGroups().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/getASinglePolicyMetadataResource.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/getASinglePolicyMetadataResource.ts deleted file mode 100644 index 4c5ad8e1dedc..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/getASinglePolicyMetadataResource.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. -/** - * This sample demonstrates how to Get policy metadata resource. - * - * @summary Get policy metadata resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_GetResource.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getASinglePolicyMetadataResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceName = "NIST_SP_800-53_R4_AC-2"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyMetadataOperations.getResource( - resourceName - ); - console.log(result); -} - -getASinglePolicyMetadataResource().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/getAttestationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/getAttestationAtIndividualResourceScope.ts deleted file mode 100644 index 586611d2957e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/getAttestationAtIndividualResourceScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Gets an existing attestation at resource scope. - * - * @summary Gets an existing attestation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getAttestationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.getAtResource( - resourceId, - attestationName - ); - console.log(result); -} - -getAttestationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/getAttestationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/getAttestationAtResourceGroupScope.ts deleted file mode 100644 index 77db93e5f51f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/getAttestationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Gets an existing attestation at resource group scope. - * - * @summary Gets an existing attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getAttestationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.getAtResourceGroup( - resourceGroupName, - attestationName - ); - console.log(result); -} - -getAttestationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/getAttestationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/getAttestationAtSubscriptionScope.ts deleted file mode 100644 index dcc3b49b3170..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/getAttestationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Gets an existing attestation at subscription scope. - * - * @summary Gets an existing attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getAttestationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.getAtSubscription(attestationName); - console.log(result); -} - -getAttestationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/getCollectionOfPolicyMetadataResources.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/getCollectionOfPolicyMetadataResources.ts deleted file mode 100644 index 08e50b442230..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/getCollectionOfPolicyMetadataResources.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. -/** - * This sample demonstrates how to Get a list of the policy metadata resources. - * - * @summary Get a list of the policy metadata resources. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getCollectionOfPolicyMetadataResources() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyMetadataOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getCollectionOfPolicyMetadataResources().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.ts deleted file mode 100644 index a1a9a5efbaef..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.ts +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Get a list of the policy metadata resources. - * - * @summary Get a list of the policy metadata resources. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List_WithTop.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const top = 1; - const options = { top: top }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyMetadataOperations.list({ queryOptions: options })) { - resArray.push(item); - } - console.log(resArray); -} - -getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/getRemediationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/getRemediationAtIndividualResourceScope.ts deleted file mode 100644 index d5026672a5e8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/getRemediationAtIndividualResourceScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Gets an existing remediation at resource scope. - * - * @summary Gets an existing remediation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getRemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.getAtResource( - resourceId, - remediationName - ); - console.log(result); -} - -getRemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/getRemediationAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/getRemediationAtManagementGroupScope.ts deleted file mode 100644 index 59f3991a625c..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/getRemediationAtManagementGroupScope.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. -/** - * This sample demonstrates how to Gets an existing remediation at management group scope. - * - * @summary Gets an existing remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getRemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.getAtManagementGroup( - managementGroupId, - remediationName - ); - console.log(result); -} - -getRemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/getRemediationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/getRemediationAtResourceGroupScope.ts deleted file mode 100644 index 17fdf837fad8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/getRemediationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Gets an existing remediation at resource group scope. - * - * @summary Gets an existing remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getRemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.getAtResourceGroup( - resourceGroupName, - remediationName - ); - console.log(result); -} - -getRemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/getRemediationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/getRemediationAtSubscriptionScope.ts deleted file mode 100644 index d437b02fe38e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/getRemediationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Gets an existing remediation at subscription scope. - * - * @summary Gets an existing remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getRemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.getAtSubscription(remediationName); - console.log(result); -} - -getRemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtIndividualResourceScope.ts deleted file mode 100644 index d78b8e9c3f87..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Gets all attestations for a resource. - * - * @summary Gets all attestations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listAttestationsAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForResource(resourceId)) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtIndividualResourceScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtIndividualResourceScopeWithQueryParameters.ts deleted file mode 100644 index 72543a1f2842..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtIndividualResourceScopeWithQueryParameters.ts +++ /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. -/** - * This sample demonstrates how to Gets all attestations for a resource. - * - * @summary Gets all attestations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listAttestationsAtIndividualResourceScopeWithQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq '0b158b46-ff42-4799-8e39-08a5c23b4551'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForResource( - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtIndividualResourceScopeWithQueryParameters().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtResourceGroupScope.ts deleted file mode 100644 index 3a96ec905649..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtResourceGroupScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Gets all attestations for the resource group. - * - * @summary Gets all attestations for the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listAttestationsAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtResourceGroupScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtResourceGroupScopeWithQueryParameters.ts deleted file mode 100644 index 353616634e04..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtResourceGroupScopeWithQueryParameters.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. -/** - * This sample demonstrates how to Gets all attestations for the resource group. - * - * @summary Gets all attestations for the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listAttestationsAtResourceGroupScopeWithQueryParameters() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq '0b158b46-ff42-4799-8e39-08a5c23b4551'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForResourceGroup( - resourceGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtResourceGroupScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtSubscriptionScope.ts deleted file mode 100644 index 66079751c529..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtSubscriptionScope.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. -/** - * This sample demonstrates how to Gets all attestations for the subscription. - * - * @summary Gets all attestations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listAttestationsAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForSubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtSubscriptionScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtSubscriptionScopeWithQueryParameters.ts deleted file mode 100644 index 6fb4ce1c1339..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listAttestationsAtSubscriptionScopeWithQueryParameters.ts +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Gets all attestations for the subscription. - * - * @summary Gets all attestations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listAttestationsAtSubscriptionScopeWithQueryParameters() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq '0b158b46-ff42-4799-8e39-08a5c23b4551'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForSubscription({ queryOptions: options })) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtSubscriptionScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listDeploymentsForARemediationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listDeploymentsForARemediationAtIndividualResourceScope.ts deleted file mode 100644 index 7860080652c8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listDeploymentsForARemediationAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Gets all deployments for a remediation at resource scope. - * - * @summary Gets all deployments for a remediation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listDeploymentsForARemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listDeploymentsAtResource( - resourceId, - remediationName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDeploymentsForARemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listDeploymentsForARemediationAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listDeploymentsForARemediationAtManagementGroupScope.ts deleted file mode 100644 index 3a652ef7dc51..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listDeploymentsForARemediationAtManagementGroupScope.ts +++ /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. -/** - * This sample demonstrates how to Gets all deployments for a remediation at management group scope. - * - * @summary Gets all deployments for a remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listDeploymentsForARemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listDeploymentsAtManagementGroup( - managementGroupId, - remediationName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDeploymentsForARemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listDeploymentsForARemediationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listDeploymentsForARemediationAtResourceGroupScope.ts deleted file mode 100644 index 758d378d4ba8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listDeploymentsForARemediationAtResourceGroupScope.ts +++ /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. -/** - * This sample demonstrates how to Gets all deployments for a remediation at resource group scope. - * - * @summary Gets all deployments for a remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listDeploymentsForARemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listDeploymentsAtResourceGroup( - resourceGroupName, - remediationName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDeploymentsForARemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listDeploymentsForARemediationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listDeploymentsForARemediationAtSubscriptionScope.ts deleted file mode 100644 index 63ab42448336..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listDeploymentsForARemediationAtSubscriptionScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Gets all deployments for a remediation at subscription scope. - * - * @summary Gets all deployments for a remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listDeploymentsForARemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listDeploymentsAtSubscription( - remediationName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDeploymentsForARemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listOperations.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listOperations.ts deleted file mode 100644 index 2613ba685c23..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listOperations.ts +++ /dev/null @@ -1,28 +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. -/** - * This sample demonstrates how to Lists available operations. - * - * @summary Lists available operations. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_ListOperations.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listOperations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.operations.list(); - console.log(result); -} - -listOperations().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtIndividualResourceScope.ts deleted file mode 100644 index 6541b329cf12..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Gets all remediations for a resource. - * - * @summary Gets all remediations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForResource(resourceId)) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtIndividualResourceScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtIndividualResourceScopeWithQueryParameters.ts deleted file mode 100644 index 0c69d4c2d106..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtIndividualResourceScopeWithQueryParameters.ts +++ /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. -/** - * This sample demonstrates how to Gets all remediations for a resource. - * - * @summary Gets all remediations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtIndividualResourceScopeWithQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForResource( - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtIndividualResourceScopeWithQueryParameters().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtManagementGroupScope.ts deleted file mode 100644 index 026d32fd4923..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtManagementGroupScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Gets all remediations for the management group. - * - * @summary Gets all remediations for the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForManagementGroup( - managementGroupId - )) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtManagementGroupScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtManagementGroupScopeWithQueryParameters.ts deleted file mode 100644 index a31440011a1d..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtManagementGroupScopeWithQueryParameters.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. -/** - * This sample demonstrates how to Gets all remediations for the management group. - * - * @summary Gets all remediations for the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtManagementGroupScopeWithQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForManagementGroup( - managementGroupId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtManagementGroupScopeWithQueryParameters().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtResourceGroupScope.ts deleted file mode 100644 index 032128db933a..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtResourceGroupScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Gets all remediations for the subscription. - * - * @summary Gets all remediations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtResourceGroupScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtResourceGroupScopeWithQueryParameters.ts deleted file mode 100644 index be619c6c2656..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtResourceGroupScopeWithQueryParameters.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. -/** - * This sample demonstrates how to Gets all remediations for the subscription. - * - * @summary Gets all remediations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtResourceGroupScopeWithQueryParameters() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForResourceGroup( - resourceGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtResourceGroupScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtSubscriptionScope.ts deleted file mode 100644 index 6d77466e547f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtSubscriptionScope.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. -/** - * This sample demonstrates how to Gets all remediations for the subscription. - * - * @summary Gets all remediations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForSubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtSubscriptionScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtSubscriptionScopeWithQueryParameters.ts deleted file mode 100644 index 0f1598025ff4..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/listRemediationsAtSubscriptionScopeWithQueryParameters.ts +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Gets all remediations for the subscription. - * - * @summary Gets all remediations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtSubscriptionScopeWithQueryParameters() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq 'storageSkuDef'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForSubscription({ queryOptions: options })) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtSubscriptionScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForPolicyDefinitionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForPolicyDefinitionSample.ts index 7c0e83829745..b1b4db119cbd 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForPolicyDefinitionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForPolicyDefinitionSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryAtSubscriptionLevelPolicyDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForPolicyDefinition( policyEventsResource, - subscriptionId2, + subscriptionId, policyDefinitionName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryAtSubscriptionLevelPolicyDefinitionScope().catch(console.error); async function queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams = { diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForPolicySetDefinitionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForPolicySetDefinitionSample.ts index b9a284a7941c..e33403ece2ed 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForPolicySetDefinitionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForPolicySetDefinitionSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryAtSubscriptionLevelPolicySetDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForPolicySetDefinition( policyEventsResource, - subscriptionId2, + subscriptionId, policySetDefinitionName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryAtSubscriptionLevelPolicySetDefinitionScope().catch(console.error); async function queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams = { diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts index 205c4960932f..abac3d5491b9 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts @@ -23,7 +23,6 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryAtResourceGroupLevelPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "myPolicyAssignment"; const credential = new DefaultAzureCredential(); @@ -31,7 +30,7 @@ async function queryAtResourceGroupLevelPolicyAssignmentScope() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment( policyEventsResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName )) { @@ -51,7 +50,6 @@ queryAtResourceGroupLevelPolicyAssignmentScope().catch(console.error); async function queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "myPolicyAssignment"; const skipToken = "WpmWfBSvPhkAK6QD"; @@ -63,7 +61,7 @@ async function queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment( policyEventsResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName, options diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForResourceGroupSample.ts index 1fd66a185308..5d7405a97f61 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForResourceGroupSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryAtResourceGroupScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForResourceGroup( policyEventsResource, - subscriptionId2, + subscriptionId, resourceGroupName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryAtResourceGroupScope().catch(console.error); async function queryAtResourceGroupScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyEventsListQueryResultsForResourceGroupOptionalParams = { @@ -60,7 +58,7 @@ async function queryAtResourceGroupScopeWithNextLink() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForResourceGroup( policyEventsResource, - subscriptionId2, + subscriptionId, resourceGroupName, options )) { diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts index ccc4a91064ec..c5275a7034ec 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryAtSubscriptionLevelPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment( policyEventsResource, - subscriptionId2, + subscriptionId, policyAssignmentName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryAtSubscriptionLevelPolicyAssignmentScope().catch(console.error); async function queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams = { @@ -60,7 +58,7 @@ async function queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment( policyEventsResource, - subscriptionId2, + subscriptionId, policyAssignmentName, options )) { diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForSubscriptionSample.ts index 4765d4313f4a..a990922e5f64 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyEventsListQueryResultsForSubscriptionSample.ts @@ -13,7 +13,6 @@ import { PolicyInsightsClient } from "@azure/arm-policyinsights"; import { DefaultAzureCredential } from "@azure/identity"; -import { to } from "../src/models/parameters"; /** * This sample demonstrates how to Queries policy events for the resources under the subscription. @@ -24,7 +23,6 @@ import { to } from "../src/models/parameters"; async function filterAndAggregateOnly() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const fromParam = new Date("2018-02-05T18:00:00Z"); const filter = "PolicyDefinitionAction eq 'deny'"; const apply = "aggregate($count as NumDenyEvents)"; @@ -36,7 +34,7 @@ async function filterAndAggregateOnly() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -55,7 +53,6 @@ filterAndAggregateOnly().catch(console.error); async function filterAndGroupWithAggregate() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const fromParam = new Date("2018-02-05T18:00:00Z"); const filter = @@ -70,7 +67,7 @@ async function filterAndGroupWithAggregate() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -89,7 +86,6 @@ filterAndGroupWithAggregate().catch(console.error); async function filterAndGroupWithoutAggregate() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const fromParam = new Date("2018-01-05T18:00:00Z"); const filter = @@ -104,7 +100,7 @@ async function filterAndGroupWithoutAggregate() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -123,7 +119,6 @@ filterAndGroupWithoutAggregate().catch(console.error); async function filterAndMultipleGroups() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 10; const orderBy = "NumDeniedResources desc"; const fromParam = new Date("2018-01-01T00:00:00Z"); @@ -138,7 +133,7 @@ async function filterAndMultipleGroups() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -157,13 +152,12 @@ filterAndMultipleGroups().catch(console.error); async function queryAtSubscriptionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2 + subscriptionId )) { resArray.push(item); } @@ -181,7 +175,6 @@ queryAtSubscriptionScope().catch(console.error); async function queryAtSubscriptionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyEventsListQueryResultsForSubscriptionOptionalParams = { queryOptions: { skipToken: skipToken } @@ -191,7 +184,7 @@ async function queryAtSubscriptionScopeWithNextLink() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -210,7 +203,6 @@ queryAtSubscriptionScopeWithNextLink().catch(console.error); async function timeRangeSortSelectAndLimit() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const orderBy = "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId"; diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForPolicyDefinitionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForPolicyDefinitionSample.ts index f682c027b5e1..1b78610db260 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForPolicyDefinitionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForPolicyDefinitionSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryLatestAtSubscriptionLevelPolicyDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForPolicyDefinition( policyStatesResource, - subscriptionId2, + subscriptionId, policyDefinitionName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryLatestAtSubscriptionLevelPolicyDefinitionScope().catch(console.error); async function queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams = { diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForPolicySetDefinitionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForPolicySetDefinitionSample.ts index fd7a082ac820..87d34a03e3c0 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForPolicySetDefinitionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForPolicySetDefinitionSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryLatestAtSubscriptionLevelPolicySetDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForPolicySetDefinition( policyStatesResource, - subscriptionId2, + subscriptionId, policySetDefinitionName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryLatestAtSubscriptionLevelPolicySetDefinitionScope().catch(console.error); async function queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams = { @@ -60,7 +58,7 @@ async function queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLin const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForPolicySetDefinition( policyStatesResource, - subscriptionId2, + subscriptionId, policySetDefinitionName, options )) { diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts index b17274bc95d3..ab5d68ebb561 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts @@ -23,7 +23,6 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryLatestAtResourceGroupLevelPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "myPolicyAssignment"; const credential = new DefaultAzureCredential(); @@ -31,7 +30,7 @@ async function queryLatestAtResourceGroupLevelPolicyAssignmentScope() { const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForResourceGroupLevelPolicyAssignment( policyStatesResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName )) { @@ -51,7 +50,6 @@ queryLatestAtResourceGroupLevelPolicyAssignmentScope().catch(console.error); async function queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "myPolicyAssignment"; const skipToken = "WpmWfBSvPhkAK6QD"; @@ -63,7 +61,7 @@ async function queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink( const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForResourceGroupLevelPolicyAssignment( policyStatesResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName, options diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForResourceGroupSample.ts index b57e34c56255..e6061c2d102b 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForResourceGroupSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryLatestAtResourceGroupScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForResourceGroup( policyStatesResource, - subscriptionId2, + subscriptionId, resourceGroupName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryLatestAtResourceGroupScope().catch(console.error); async function queryLatestAtResourceGroupScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyStatesListQueryResultsForResourceGroupOptionalParams = { diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts index 30ee88491652..35a99dfe58c9 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryLatestAtSubscriptionLevelPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscriptionLevelPolicyAssignment( policyStatesResource, - subscriptionId2, + subscriptionId, policyAssignmentName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryLatestAtSubscriptionLevelPolicyAssignmentScope().catch(console.error); async function queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams = { diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForSubscriptionSample.ts index e23e28f686cc..f13f0ae7c2ea 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesListQueryResultsForSubscriptionSample.ts @@ -23,7 +23,6 @@ import { DefaultAzureCredential } from "@azure/identity"; async function filterAndAggregateOnly() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const fromParam = new Date("2019-10-05T18:00:00Z"); const filter = "PolicyDefinitionAction eq 'deny'"; const apply = "aggregate($count as NumDenyStates)"; @@ -35,7 +34,7 @@ async function filterAndAggregateOnly() { const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscription( policyStatesResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -54,7 +53,6 @@ filterAndAggregateOnly().catch(console.error); async function filterAndGroupWithAggregate() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const orderBy = "NumAuditDenyNonComplianceRecords desc"; const fromParam = new Date("2019-10-05T18:00:00Z"); @@ -89,7 +87,6 @@ filterAndGroupWithAggregate().catch(console.error); async function filterAndGroupWithoutAggregate() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const fromParam = new Date("2019-10-05T18:00:00Z"); const filter = @@ -104,7 +101,7 @@ async function filterAndGroupWithoutAggregate() { const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscription( policyStatesResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -123,7 +120,6 @@ filterAndGroupWithoutAggregate().catch(console.error); async function filterAndMultipleGroups() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 10; const orderBy = "NumNonCompliantResources desc"; const filter = "IsCompliant eq false"; @@ -137,7 +133,7 @@ async function filterAndMultipleGroups() { const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscription( policyStatesResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -156,13 +152,12 @@ filterAndMultipleGroups().catch(console.error); async function queryLatestAtSubscriptionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscription( policyStatesResource, - subscriptionId2 + subscriptionId )) { resArray.push(item); } @@ -180,7 +175,6 @@ queryLatestAtSubscriptionScope().catch(console.error); async function queryLatestAtSubscriptionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyStatesListQueryResultsForSubscriptionOptionalParams = { queryOptions: { skipToken: skipToken } @@ -209,7 +203,6 @@ queryLatestAtSubscriptionScopeWithNextLink().catch(console.error); async function timeRangeSortSelectAndLimit() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const orderBy = "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId"; diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForPolicyDefinitionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForPolicyDefinitionSample.ts index 3ec21d154cc9..a5f52aaf6045 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForPolicyDefinitionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForPolicyDefinitionSample.ts @@ -20,13 +20,12 @@ import { DefaultAzureCredential } from "@azure/identity"; async function summarizeAtPolicyDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForPolicyDefinition( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, policyDefinitionName ); console.log(result); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForPolicySetDefinitionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForPolicySetDefinitionSample.ts index 82a5f6beba42..a7744067282e 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForPolicySetDefinitionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForPolicySetDefinitionSample.ts @@ -23,7 +23,6 @@ import { DefaultAzureCredential } from "@azure/identity"; async function summarizeAtPolicySetDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const top = 1; const fromParam = new Date("2019-10-05T18:00:00Z"); @@ -36,7 +35,7 @@ async function summarizeAtPolicySetDefinitionScope() { const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForPolicySetDefinition( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, policySetDefinitionName, options ); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.ts index 80d1e8c921b5..0c8812bbc3d5 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.ts @@ -20,14 +20,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function summarizeAtPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "b7a1ca2596524e3ab19597f2"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForResourceGroupLevelPolicyAssignment( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName ); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForResourceGroupSample.ts index 5e3d3c56301c..d1ed5b78e31d 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForResourceGroupSample.ts @@ -20,13 +20,12 @@ import { DefaultAzureCredential } from "@azure/identity"; async function summarizeAtResourceGroupScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForResourceGroup( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, resourceGroupName ); console.log(result); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.ts index d54879e27720..ac09f8d550c2 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.ts @@ -20,13 +20,12 @@ import { DefaultAzureCredential } from "@azure/identity"; async function summarizeAtPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForSubscriptionLevelPolicyAssignment( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, policyAssignmentName ); console.log(result); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForSubscriptionSample.ts index 794b4763db9c..3cf75a8a970e 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesSummarizeForSubscriptionSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function summarizeAtSubscriptionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 5; const options: PolicyStatesSummarizeForSubscriptionOptionalParams = { queryOptions: { top: top } }; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForSubscription( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, options ); console.log(result); @@ -47,7 +46,6 @@ summarizeAtSubscriptionScope().catch(console.error); async function summarizeAtSubscriptionScopeForAPolicyDefinitionGroup() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 1; const filter = "'group1' IN PolicyDefinitionGroupNames"; const options: PolicyStatesSummarizeForSubscriptionOptionalParams = { diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesTriggerResourceGroupEvaluationSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesTriggerResourceGroupEvaluationSample.ts index 2664fdddcaf3..3466124927ba 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesTriggerResourceGroupEvaluationSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesTriggerResourceGroupEvaluationSample.ts @@ -19,12 +19,11 @@ import { DefaultAzureCredential } from "@azure/identity"; */ async function triggerEvaluationsForAllResourcesInAResourceGroup() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.beginTriggerResourceGroupEvaluationAndWait( - subscriptionId2, + subscriptionId, resourceGroupName ); console.log(result); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesTriggerSubscriptionEvaluationSample.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesTriggerSubscriptionEvaluationSample.ts index 802c30dc79fc..32c9ff36eb13 100644 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesTriggerSubscriptionEvaluationSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples-dev/policyStatesTriggerSubscriptionEvaluationSample.ts @@ -19,11 +19,10 @@ import { DefaultAzureCredential } from "@azure/identity"; */ async function triggerEvaluationsForAllResourcesInASubscription() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.beginTriggerSubscriptionEvaluationAndWait( - subscriptionId2 + subscriptionId ); console.log(result); } diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtNestedResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtNestedResourceScope.ts deleted file mode 100644 index fe6529dedfec..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtNestedResourceScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryNestedResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAllPolicyStatesAtNestedResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtNestedResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtResourceScope.ts deleted file mode 100644 index 8d98c610843a..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtResourceScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAllPolicyStatesAtResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.ts deleted file mode 100644 index e0d636ad9723..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const expand = "PolicyEvaluationDetails"; - const options = { expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtResourceScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtResourceScopeWithNextLink.ts deleted file mode 100644 index a734e12fbcd8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtResourceScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAllPolicyStatesAtResourceScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtResourceScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.ts deleted file mode 100644 index 10f17691b8ba..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelNestedResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtSubscriptionLevelResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtSubscriptionLevelResourceScope.ts deleted file mode 100644 index fb7bc751025d..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAllPolicyStatesAtSubscriptionLevelResourceScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAllPolicyStatesAtSubscriptionLevelResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtSubscriptionLevelResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtManagementGroupScope.ts deleted file mode 100644 index 1a83d090048e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtManagementGroupScope.ts +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Queries policy events for the resources under the management group. - * - * @summary Queries policy events for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupName = "myManagementGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForManagementGroup( - "default", - managementGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtManagementGroupScopeUsingQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtManagementGroupScopeUsingQueryParameters.ts deleted file mode 100644 index 1a5a3be1bccc..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtManagementGroupScopeUsingQueryParameters.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. -/** - * This sample demonstrates how to Queries policy tracked resources under the management group. - * - * @summary Queries policy tracked resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryManagementGroupScopeWithFilterAndTop.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtManagementGroupScopeUsingQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupName = "myManagementGroup"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyTrackedResources.listQueryResultsForManagementGroup( - managementGroupName, - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtManagementGroupScopeUsingQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtManagementGroupScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtManagementGroupScopeWithNextLink.ts deleted file mode 100644 index e080f8bd199f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtManagementGroupScopeWithNextLink.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resources under the management group. - * - * @summary Queries policy events for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtManagementGroupScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupName = "myManagementGroup"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForManagementGroup( - managementGroupName, - "", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtManagementGroupScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtNestedResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtNestedResourceScope.ts deleted file mode 100644 index 2a9adc4acca9..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtNestedResourceScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryNestedResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtNestedResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - "default", - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtNestedResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupLevelPolicyAssignmentScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupLevelPolicyAssignmentScope.ts deleted file mode 100644 index 533dd9682d22..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupLevelPolicyAssignmentScope.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. -/** - * This sample demonstrates how to Queries policy events for the resource group level policy assignment. - * - * @summary Queries policy events for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceGroupLevelPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "myPolicyAssignment"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment( - "default", - subscriptionId2, - resourceGroupName, - policyAssignmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupLevelPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.ts deleted file mode 100644 index e5352b9dfe89..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the resource group level policy assignment. - * - * @summary Queries policy events for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "myPolicyAssignment"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment( - "default", - subscriptionId2, - resourceGroupName, - policyAssignmentName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupScope.ts deleted file mode 100644 index a15b84f40393..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupScope.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. -/** - * This sample demonstrates how to Queries policy events for the resources under the resource group. - * - * @summary Queries policy events for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResourceGroup( - "default", - subscriptionId2, - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupScopeUsingQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupScopeUsingQueryParameters.ts deleted file mode 100644 index ca4b21a2be29..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupScopeUsingQueryParameters.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. -/** - * This sample demonstrates how to Queries policy tracked resources under the resource group. - * - * @summary Queries policy tracked resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceGroupScopeWithFilterAndTop.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceGroupScopeUsingQueryParameters() { - const subscriptionId = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource/nestedResourceType/TrackedResource1'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyTrackedResources.listQueryResultsForResourceGroup( - resourceGroupName, - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupScopeUsingQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupScopeWithNextLink.ts deleted file mode 100644 index 87fa418b4658..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceGroupScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the resources under the resource group. - * - * @summary Queries policy events for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceGroupScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResourceGroup( - "default", - subscriptionId2, - resourceGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceScope.ts deleted file mode 100644 index a67bc347c8c8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - "default", - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceScopeUsingQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceScopeUsingQueryParameters.ts deleted file mode 100644 index 2df6a37510be..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceScopeUsingQueryParameters.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. -/** - * This sample demonstrates how to Queries policy tracked resources under the resource. - * - * @summary Queries policy tracked resources under the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceScopeWithFilterAndTop.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceScopeUsingQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource/nestedResourceType/TrackedResource1'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyTrackedResources.listQueryResultsForResource( - resourceId, - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceScopeUsingQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceScopeWithNextLink.ts deleted file mode 100644 index b673111c3a5f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtResourceScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - resourceId, - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelNestedResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelNestedResourceScope.ts deleted file mode 100644 index 49468aaafafa..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelNestedResourceScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelNestedResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelNestedResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - resourceId, - "default" - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelNestedResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicyAssignmentScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicyAssignmentScope.ts deleted file mode 100644 index 5cc13e36792e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicyAssignmentScope.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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy assignment. - * - * @summary Queries policy events for the subscription level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment( - "default", - subscriptionId2, - policyAssignmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts deleted file mode 100644 index 1e58b8e55f37..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy assignment. - * - * @summary Queries policy events for the subscription level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment( - "default", - subscriptionId2, - policyAssignmentName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicyDefinitionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicyDefinitionScope.ts deleted file mode 100644 index d10e59b5d09f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicyDefinitionScope.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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy definition. - * - * @summary Queries policy events for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelPolicyDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForPolicyDefinition( - "default", - subscriptionId2, - policyDefinitionName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicyDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts deleted file mode 100644 index 3db9bf5bdd4b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy definition. - * - * @summary Queries policy events for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForPolicyDefinition( - "default", - subscriptionId2, - policyDefinitionName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicySetDefinitionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicySetDefinitionScope.ts deleted file mode 100644 index 9a062f33ed1b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicySetDefinitionScope.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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy set definition. - * - * @summary Queries policy events for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelPolicySetDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForPolicySetDefinition( - "deault", - subscriptionId2, - policySetDefinitionName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicySetDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts deleted file mode 100644 index 8a3c9ae01bfe..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy set definition. - * - * @summary Queries policy events for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForPolicySetDefinition( - "default", - subscriptionId2, - policySetDefinitionName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelResourceScope.ts deleted file mode 100644 index 6dbb71638a6d..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionLevelResourceScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - "default", - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionScope.ts deleted file mode 100644 index 6d297117954e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionScope.ts +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Queries policy events for the resources under the subscription. - * - * @summary Queries policy events for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForSubscription( - "default", - subscriptionId2 - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionScopeUsingQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionScopeUsingQueryParameters.ts deleted file mode 100644 index 776296ffe4ac..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionScopeUsingQueryParameters.ts +++ /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. -/** - * This sample demonstrates how to Queries policy tracked resources under the subscription. - * - * @summary Queries policy tracked resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QuerySubscriptionScopeWithFilterAndTop.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionScopeUsingQueryParameters() { - const subscriptionId = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyTrackedResources.listQueryResultsForSubscription( - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionScopeUsingQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionScopeWithNextLink.ts deleted file mode 100644 index dcb68937a383..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryAtSubscriptionScopeWithNextLink.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resources under the subscription. - * - * @summary Queries policy events for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForSubscription( - "default", - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.ts deleted file mode 100644 index 7f8810489826..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandComponents.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const resourceId = - "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName"; - const filter = - "policyAssignmentId eq '/subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/providers/microsoft.authorization/policyassignments/560050f83dbb4a24974323f8'"; - const expand = - "components($filter=ComplianceState eq 'NonCompliant' or ComplianceState eq 'Compliant')"; - const options = { filter: filter, expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.ts deleted file mode 100644 index 66f7c8bb883e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandComponentsGroupByWithAggregate.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const resourceId = - "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName"; - const filter = - "policyAssignmentId eq '/subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/providers/microsoft.authorization/policyassignments/560050f83dbb4a24974323f8'"; - const expand = - "components($filter=ComplianceState eq 'NonCompliant' or ComplianceState eq 'Compliant';$apply=groupby((complianceState),aggregate($count as count)))"; - const options = { filter: filter, expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.ts deleted file mode 100644 index 4fcc723e5157..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeExpandComponentsGroupByWithAggregate.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName"; - const filter = - "policyAssignmentId eq '/subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/providers/microsoft.authorization/policyassignments/560050f83dbb4a24974323f8'"; - const expand = - "components($apply=groupby((tenantId, principalOid, policyDefinitionAction), aggregate($count as totalActions)))"; - const options = { filter: filter, expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - "default", - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.ts deleted file mode 100644 index 377a332d02aa..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeExpandComponents.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName"; - const filter = - "policyAssignmentId eq '/subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/providers/microsoft.authorization/policyassignments/560050f83dbb4a24974323f8'"; - const expand = "components"; - const options = { filter: filter, expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - "default", - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtManagementGroupScope.ts deleted file mode 100644 index dc3f3fd58016..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtManagementGroupScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the management group. - * - * @summary Queries policy states for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const managementGroupName = "myManagementGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForManagementGroup( - policyStatesResource, - managementGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtManagementGroupScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtManagementGroupScopeWithNextLink.ts deleted file mode 100644 index 39e5a7fb02c0..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtManagementGroupScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the management group. - * - * @summary Queries policy states for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtManagementGroupScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const managementGroupName = "myManagementGroup"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForManagementGroup( - policyStatesResource, - managementGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtManagementGroupScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtResourceGroupLevelPolicyAssignmentScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtResourceGroupLevelPolicyAssignmentScope.ts deleted file mode 100644 index 9c9797f41c8d..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtResourceGroupLevelPolicyAssignmentScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource group level policy assignment. - * - * @summary Queries policy states for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtResourceGroupLevelPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "myPolicyAssignment"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResourceGroupLevelPolicyAssignment( - policyStatesResource, - subscriptionId2, - resourceGroupName, - policyAssignmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtResourceGroupLevelPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.ts deleted file mode 100644 index 62c366ff9ad7..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resource group level policy assignment. - * - * @summary Queries policy states for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "myPolicyAssignment"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResourceGroupLevelPolicyAssignment( - policyStatesResource, - subscriptionId2, - resourceGroupName, - policyAssignmentName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtResourceGroupScope.ts deleted file mode 100644 index 982e75daef28..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtResourceGroupScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the resource group. - * - * @summary Queries policy states for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResourceGroup( - policyStatesResource, - subscriptionId2, - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtResourceGroupScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtResourceGroupScopeWithNextLink.ts deleted file mode 100644 index 914aae70fd22..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtResourceGroupScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the resource group. - * - * @summary Queries policy states for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtResourceGroupScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResourceGroup( - policyStatesResource, - subscriptionId2, - resourceGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtResourceGroupScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicyAssignmentScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicyAssignmentScope.ts deleted file mode 100644 index ee13862c528a..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicyAssignmentScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy assignment. - * - * @summary Queries policy states for the subscription level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionLevelPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscriptionLevelPolicyAssignment( - policyStatesResource, - subscriptionId2, - policyAssignmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts deleted file mode 100644 index adfa49a6b320..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy assignment. - * - * @summary Queries policy states for the subscription level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscriptionLevelPolicyAssignment( - policyStatesResource, - subscriptionId2, - policyAssignmentName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicyDefinitionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicyDefinitionScope.ts deleted file mode 100644 index f43fb95a0cbc..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicyDefinitionScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy definition. - * - * @summary Queries policy states for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionLevelPolicyDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForPolicyDefinition( - policyStatesResource, - subscriptionId2, - policyDefinitionName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicyDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts deleted file mode 100644 index 6af824a7ddd8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy definition. - * - * @summary Queries policy states for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForPolicyDefinition( - policyStatesResource, - subscriptionId2, - policyDefinitionName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicySetDefinitionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicySetDefinitionScope.ts deleted file mode 100644 index e2a442c1ac30..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicySetDefinitionScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy set definition. - * - * @summary Queries policy states for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionLevelPolicySetDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForPolicySetDefinition( - policyStatesResource, - subscriptionId2, - policySetDefinitionName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicySetDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts deleted file mode 100644 index 4c30aa2af3d6..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy set definition. - * - * @summary Queries policy states for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForPolicySetDefinition( - policyStatesResource, - subscriptionId2, - policySetDefinitionName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionScope.ts deleted file mode 100644 index 691bea19bc0b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2 - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionScopeWithNextLink.ts deleted file mode 100644 index 54869fae4927..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/queryLatestAtSubscriptionScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtManagementGroupScope.ts deleted file mode 100644 index 34c8dfc67d86..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtManagementGroupScope.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. -/** - * This sample demonstrates how to Summarizes policy states for the resources under the management group. - * - * @summary Summarizes policy states for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupName = "myManagementGroup"; - const top = 0; - const from = new Date("2019-10-05T18:00:00Z"); - const to = new Date("2019-10-06T18:00:00Z"); - const filter = - "PolicyDefinitionAction eq 'deny' or PolicyDefinitionAction eq 'audit'"; - const options = { top: top, from: from, to: to, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForManagementGroup( - "latest", - managementGroupName, - { queryOptions: options } - ); - console.log(result); -} - -summarizeAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtPolicyAssignmentScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtPolicyAssignmentScope.ts deleted file mode 100644 index 719ef2098d62..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtPolicyAssignmentScope.ts +++ /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. -/** - * This sample demonstrates how to Summarizes policy states for the resource group level policy assignment. - * - * @summary Summarizes policy states for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "b7a1ca2596524e3ab19597f2"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForResourceGroupLevelPolicyAssignment( - "latest", - subscriptionId, - resourceGroupName, - policyAssignmentName - ); - console.log(result); -} - -summarizeAtPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtPolicyDefinitionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtPolicyDefinitionScope.ts deleted file mode 100644 index d5dc2d3c7136..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtPolicyDefinitionScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Summarizes policy states for the subscription level policy definition. - * - * @summary Summarizes policy states for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtPolicyDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForPolicyDefinition( - "", - subscriptionId2, - policyDefinitionName - ); - console.log(result); -} - -summarizeAtPolicyDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtPolicySetDefinitionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtPolicySetDefinitionScope.ts deleted file mode 100644 index 50a67f1da647..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtPolicySetDefinitionScope.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. -/** - * This sample demonstrates how to Summarizes policy states for the subscription level policy set definition. - * - * @summary Summarizes policy states for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtPolicySetDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const top = 1; - const from = new Date("2019-10-05T18:00:00Z"); - const to = new Date("2019-10-06T18:00:00Z"); - const filter = "PolicyDefinitionAction eq 'deny'"; - const options = { top: top, from: from, to: to, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForPolicySetDefinition( - "latest", - subscriptionId2, - policySetDefinitionName, - { queryOptions: options } - ); - console.log(result); -} - -summarizeAtPolicySetDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtResourceGroupScope.ts deleted file mode 100644 index aa18a664a94f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtResourceGroupScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Summarizes policy states for the resources under the resource group. - * - * @summary Summarizes policy states for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForResourceGroup( - "latest", - subscriptionId2, - resourceGroupName - ); - console.log(result); -} - -summarizeAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtResourceScope.ts deleted file mode 100644 index 94d1bb91a589..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtResourceScope.ts +++ /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. -/** - * This sample demonstrates how to Summarizes policy states for the resource. - * - * @summary Summarizes policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault"; - const top = 2; - const options = { top: top }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForResource( - "latest", - resourceId, - { queryOptions: options } - ); - console.log(result); -} - -summarizeAtResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtSubscriptionScope.ts deleted file mode 100644 index d6c4a2510269..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtSubscriptionScope.ts +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Summarizes policy states for the resources under the subscription. - * - * @summary Summarizes policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 5; - const options = { top: top }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForSubscription( - "latest", - subscriptionId2, - { queryOptions: options } - ); - console.log(result); -} - -summarizeAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.ts deleted file mode 100644 index 6c94dc57cfe9..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.ts +++ /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. -/** - * This sample demonstrates how to Summarizes policy states for the resources under the subscription. - * - * @summary Summarizes policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScopeForPolicyGroup.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtSubscriptionScopeForAPolicyDefinitionGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 1; - const filter = "'group1' IN PolicyDefinitionGroupNames"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForSubscription( - "latest", - subscriptionId2, - { queryOptions: options } - ); - console.log(result); -} - -summarizeAtSubscriptionScopeForAPolicyDefinitionGroup().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/timeRangeSortSelectAndLimit.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/timeRangeSortSelectAndLimit.ts deleted file mode 100644 index b9b33450cc7f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/timeRangeSortSelectAndLimit.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TimeRangeSortSelectTop.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function timeRangeSortSelectAndLimit() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 2; - const orderBy = - "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId"; - const select = - "Timestamp, PolicyAssignmentId, PolicyDefinitionId, SubscriptionId, ResourceGroup, ResourceId, policyDefinitionGroupNames"; - const from = new Date("2019-10-05T18:00:00Z"); - const to = new Date("2019-10-06T18:00:00Z"); - const options = { - top: top, - orderBy: orderBy, - select: select, - from: from, - to: to - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -timeRangeSortSelectAndLimit().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/triggerEvaluationsForAllResourcesInAResourceGroup.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/triggerEvaluationsForAllResourcesInAResourceGroup.ts deleted file mode 100644 index 88a35dfdbf59..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/triggerEvaluationsForAllResourcesInAResourceGroup.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. -/** - * This sample demonstrates how to Triggers a policy evaluation scan for all the resources under the resource group. - * - * @summary Triggers a policy evaluation scan for all the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function triggerEvaluationsForAllResourcesInAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.beginTriggerResourceGroupEvaluationAndWait( - subscriptionId2, - resourceGroupName - ); - console.log(result); -} - -triggerEvaluationsForAllResourcesInAResourceGroup().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples-dev/triggerEvaluationsForAllResourcesInASubscription.ts b/sdk/policyinsights/arm-policyinsights/samples-dev/triggerEvaluationsForAllResourcesInASubscription.ts deleted file mode 100644 index 42f97f1298ac..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples-dev/triggerEvaluationsForAllResourcesInASubscription.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. -/** - * This sample demonstrates how to Triggers a policy evaluation scan for all the resources under the subscription - * - * @summary Triggers a policy evaluation scan for all the resources under the subscription - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function triggerEvaluationsForAllResourcesInASubscription() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.beginTriggerSubscriptionEvaluationAndWait( - subscriptionId2 - ); - console.log(result); -} - -triggerEvaluationsForAllResourcesInASubscription().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/README.md b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/README.md index 199862b90570..8bc247c77ff1 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/README.md +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/README.md @@ -2,193 +2,80 @@ These sample programs show how to use the JavaScript client libraries for in some common scenarios. -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [attestationsCreateOrUpdateAtResourceGroupSample.js][attestationscreateorupdateatresourcegroupsample] | Creates or updates an attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceGroupScope.json | -| [attestationsCreateOrUpdateAtResourceSample.js][attestationscreateorupdateatresourcesample] | Creates or updates an attestation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceScope.json | -| [attestationsCreateOrUpdateAtSubscriptionSample.js][attestationscreateorupdateatsubscriptionsample] | Creates or updates an attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope.json | -| [attestationsDeleteAtResourceGroupSample.js][attestationsdeleteatresourcegroupsample] | Deletes an existing attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceGroupScope.json | -| [attestationsDeleteAtResourceSample.js][attestationsdeleteatresourcesample] | Deletes an existing attestation at individual resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceScope.json | -| [attestationsDeleteAtSubscriptionSample.js][attestationsdeleteatsubscriptionsample] | Deletes an existing attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteSubscriptionScope.json | -| [attestationsGetAtResourceGroupSample.js][attestationsgetatresourcegroupsample] | Gets an existing attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceGroupScope.json | -| [attestationsGetAtResourceSample.js][attestationsgetatresourcesample] | Gets an existing attestation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceScope.json | -| [attestationsGetAtSubscriptionSample.js][attestationsgetatsubscriptionsample] | Gets an existing attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetSubscriptionScope.json | -| [attestationsListForResourceGroupSample.js][attestationslistforresourcegroupsample] | Gets all attestations for the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope.json | -| [attestationsListForResourceSample.js][attestationslistforresourcesample] | Gets all attestations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope.json | -| [attestationsListForSubscriptionSample.js][attestationslistforsubscriptionsample] | Gets all attestations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope.json | -| [cancelARemediationAtIndividualResourceScope.js][cancelaremediationatindividualresourcescope] | Cancel a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceScope.json | -| [cancelARemediationAtManagementGroupScope.js][cancelaremediationatmanagementgroupscope] | Cancels a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelManagementGroupScope.json | -| [cancelARemediationAtResourceGroupScope.js][cancelaremediationatresourcegroupscope] | Cancels a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceGroupScope.json | -| [cancelARemediationAtSubscriptionScope.js][cancelaremediationatsubscriptionscope] | Cancels a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelSubscriptionScope.json | -| [checkPolicyRestrictionsAtResourceGroupScope.js][checkpolicyrestrictionsatresourcegroupscope] | Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json | -| [checkPolicyRestrictionsAtSubscriptionScope.js][checkpolicyrestrictionsatsubscriptionscope] | Checks what restrictions Azure Policy will place on a resource within a subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json | -| [createAttestationAtIndividualResourceScope.js][createattestationatindividualresourcescope] | Creates or updates an attestation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceScope.json | -| [createAttestationAtResourceGroupScope.js][createattestationatresourcegroupscope] | Creates or updates an attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceGroupScope.json | -| [createAttestationAtSubscriptionScope.js][createattestationatsubscriptionscope] | Creates or updates an attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope.json | -| [createAttestationAtSubscriptionScopeWithAllProperties.js][createattestationatsubscriptionscopewithallproperties] | Creates or updates an attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json | -| [createRemediationAtIndividualResourceScope.js][createremediationatindividualresourcescope] | Creates or updates a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceScope.json | -| [createRemediationAtManagementGroupScope.js][createremediationatmanagementgroupscope] | Creates or updates a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateManagementGroupScope.json | -| [createRemediationAtResourceGroupScope.js][createremediationatresourcegroupscope] | Creates or updates a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceGroupScope.json | -| [createRemediationAtSubscriptionScope.js][createremediationatsubscriptionscope] | Creates or updates a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json | -| [createRemediationAtSubscriptionScopeWithAllProperties.js][createremediationatsubscriptionscopewithallproperties] | Creates or updates a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope_AllProperties.json | -| [deleteAttestationAtIndividualResourceScope.js][deleteattestationatindividualresourcescope] | Deletes an existing attestation at individual resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceScope.json | -| [deleteAttestationAtResourceGroupScope.js][deleteattestationatresourcegroupscope] | Deletes an existing attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceGroupScope.json | -| [deleteAttestationAtSubscriptionScope.js][deleteattestationatsubscriptionscope] | Deletes an existing attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteSubscriptionScope.json | -| [deleteRemediationAtIndividualResourceScope.js][deleteremediationatindividualresourcescope] | Deletes an existing remediation at individual resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceScope.json | -| [deleteRemediationAtManagementGroupScope.js][deleteremediationatmanagementgroupscope] | Deletes an existing remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteManagementGroupScope.json | -| [deleteRemediationAtResourceGroupScope.js][deleteremediationatresourcegroupscope] | Deletes an existing remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceGroupScope.json | -| [deleteRemediationAtSubscriptionScope.js][deleteremediationatsubscriptionscope] | Deletes an existing remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteSubscriptionScope.json | -| [filterAndAggregateOnly.js][filterandaggregateonly] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndAggregateOnly.json | -| [filterAndGroupWithAggregate.js][filterandgroupwithaggregate] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndGroupByWithAggregate.json | -| [filterAndGroupWithoutAggregate.js][filterandgroupwithoutaggregate] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndGroupByWithoutAggregate.json | -| [filterAndMultipleGroups.js][filterandmultiplegroups] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndMultipleGroups.json | -| [getASinglePolicyMetadataResource.js][getasinglepolicymetadataresource] | Get policy metadata resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_GetResource.json | -| [getAttestationAtIndividualResourceScope.js][getattestationatindividualresourcescope] | Gets an existing attestation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceScope.json | -| [getAttestationAtResourceGroupScope.js][getattestationatresourcegroupscope] | Gets an existing attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceGroupScope.json | -| [getAttestationAtSubscriptionScope.js][getattestationatsubscriptionscope] | Gets an existing attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetSubscriptionScope.json | -| [getCollectionOfPolicyMetadataResources.js][getcollectionofpolicymetadataresources] | Get a list of the policy metadata resources. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List.json | -| [getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.js][getcollectionofpolicymetadataresourcesusingtopqueryparameter] | Get a list of the policy metadata resources. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List_WithTop.json | -| [getRemediationAtIndividualResourceScope.js][getremediationatindividualresourcescope] | Gets an existing remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceScope.json | -| [getRemediationAtManagementGroupScope.js][getremediationatmanagementgroupscope] | Gets an existing remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetManagementGroupScope.json | -| [getRemediationAtResourceGroupScope.js][getremediationatresourcegroupscope] | Gets an existing remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceGroupScope.json | -| [getRemediationAtSubscriptionScope.js][getremediationatsubscriptionscope] | Gets an existing remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetSubscriptionScope.json | -| [listAttestationsAtIndividualResourceScope.js][listattestationsatindividualresourcescope] | Gets all attestations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope.json | -| [listAttestationsAtIndividualResourceScopeWithQueryParameters.js][listattestationsatindividualresourcescopewithqueryparameters] | Gets all attestations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope_WithQuery.json | -| [listAttestationsAtResourceGroupScope.js][listattestationsatresourcegroupscope] | Gets all attestations for the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope.json | -| [listAttestationsAtResourceGroupScopeWithQueryParameters.js][listattestationsatresourcegroupscopewithqueryparameters] | Gets all attestations for the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope_WithQuery.json | -| [listAttestationsAtSubscriptionScope.js][listattestationsatsubscriptionscope] | Gets all attestations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope.json | -| [listAttestationsAtSubscriptionScopeWithQueryParameters.js][listattestationsatsubscriptionscopewithqueryparameters] | Gets all attestations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope_WithQuery.json | -| [listDeploymentsForARemediationAtIndividualResourceScope.js][listdeploymentsforaremediationatindividualresourcescope] | Gets all deployments for a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceScope.json | -| [listDeploymentsForARemediationAtManagementGroupScope.js][listdeploymentsforaremediationatmanagementgroupscope] | Gets all deployments for a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsManagementGroupScope.json | -| [listDeploymentsForARemediationAtResourceGroupScope.js][listdeploymentsforaremediationatresourcegroupscope] | Gets all deployments for a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json | -| [listDeploymentsForARemediationAtSubscriptionScope.js][listdeploymentsforaremediationatsubscriptionscope] | Gets all deployments for a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsSubscriptionScope.json | -| [listOperations.js][listoperations] | Lists available operations. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_ListOperations.json | -| [listRemediationsAtIndividualResourceScope.js][listremediationsatindividualresourcescope] | Gets all remediations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope.json | -| [listRemediationsAtIndividualResourceScopeWithQueryParameters.js][listremediationsatindividualresourcescopewithqueryparameters] | Gets all remediations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope_WithQuery.json | -| [listRemediationsAtManagementGroupScope.js][listremediationsatmanagementgroupscope] | Gets all remediations for the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope.json | -| [listRemediationsAtManagementGroupScopeWithQueryParameters.js][listremediationsatmanagementgroupscopewithqueryparameters] | Gets all remediations for the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope_WithQuery.json | -| [listRemediationsAtResourceGroupScope.js][listremediationsatresourcegroupscope] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope.json | -| [listRemediationsAtResourceGroupScopeWithQueryParameters.js][listremediationsatresourcegroupscopewithqueryparameters] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope_WithQuery.json | -| [listRemediationsAtSubscriptionScope.js][listremediationsatsubscriptionscope] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope.json | -| [listRemediationsAtSubscriptionScopeWithQueryParameters.js][listremediationsatsubscriptionscopewithqueryparameters] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope_WithQuery.json | -| [operationsListSample.js][operationslistsample] | Lists available operations. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_ListOperations.json | -| [policyEventsListQueryResultsForManagementGroupSample.js][policyeventslistqueryresultsformanagementgroupsample] | Queries policy events for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScope.json | -| [policyEventsListQueryResultsForPolicyDefinitionSample.js][policyeventslistqueryresultsforpolicydefinitionsample] | Queries policy events for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScope.json | -| [policyEventsListQueryResultsForPolicySetDefinitionSample.js][policyeventslistqueryresultsforpolicysetdefinitionsample] | Queries policy events for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScope.json | -| [policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.js][policyeventslistqueryresultsforresourcegrouplevelpolicyassignmentsample] | Queries policy events for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScope.json | -| [policyEventsListQueryResultsForResourceGroupSample.js][policyeventslistqueryresultsforresourcegroupsample] | Queries policy events for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScope.json | -| [policyEventsListQueryResultsForResourceSample.js][policyeventslistqueryresultsforresourcesample] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryNestedResourceScope.json | -| [policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.js][policyeventslistqueryresultsforsubscriptionlevelpolicyassignmentsample] | Queries policy events for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScope.json | -| [policyEventsListQueryResultsForSubscriptionSample.js][policyeventslistqueryresultsforsubscriptionsample] | Queries policy events for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_FilterAndAggregateOnly.json | -| [policyMetadataGetResourceSample.js][policymetadatagetresourcesample] | Get policy metadata resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_GetResource.json | -| [policyMetadataListSample.js][policymetadatalistsample] | Get a list of the policy metadata resources. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List.json | -| [policyRestrictionsCheckAtManagementGroupScopeSample.js][policyrestrictionscheckatmanagementgroupscopesample] | Checks what restrictions Azure Policy will place on resources within a management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtManagementGroupScope.json | -| [policyRestrictionsCheckAtResourceGroupScopeSample.js][policyrestrictionscheckatresourcegroupscopesample] | Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json | -| [policyRestrictionsCheckAtSubscriptionScopeSample.js][policyrestrictionscheckatsubscriptionscopesample] | Checks what restrictions Azure Policy will place on a resource within a subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json | -| [policyStatesListQueryResultsForManagementGroupSample.js][policystateslistqueryresultsformanagementgroupsample] | Queries policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScope.json | -| [policyStatesListQueryResultsForPolicyDefinitionSample.js][policystateslistqueryresultsforpolicydefinitionsample] | Queries policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json | -| [policyStatesListQueryResultsForPolicySetDefinitionSample.js][policystateslistqueryresultsforpolicysetdefinitionsample] | Queries policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json | -| [policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.js][policystateslistqueryresultsforresourcegrouplevelpolicyassignmentsample] | Queries policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json | -| [policyStatesListQueryResultsForResourceGroupSample.js][policystateslistqueryresultsforresourcegroupsample] | Queries policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScope.json | -| [policyStatesListQueryResultsForResourceSample.js][policystateslistqueryresultsforresourcesample] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryNestedResourceScope.json | -| [policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.js][policystateslistqueryresultsforsubscriptionlevelpolicyassignmentsample] | Queries policy states for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json | -| [policyStatesListQueryResultsForSubscriptionSample.js][policystateslistqueryresultsforsubscriptionsample] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndAggregateOnly.json | -| [policyStatesSummarizeForManagementGroupSample.js][policystatessummarizeformanagementgroupsample] | Summarizes policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeManagementGroupScope.json | -| [policyStatesSummarizeForPolicyDefinitionSample.js][policystatessummarizeforpolicydefinitionsample] | Summarizes policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json | -| [policyStatesSummarizeForPolicySetDefinitionSample.js][policystatessummarizeforpolicysetdefinitionsample] | Summarizes policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json | -| [policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.js][policystatessummarizeforresourcegrouplevelpolicyassignmentsample] | Summarizes policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json | -| [policyStatesSummarizeForResourceGroupSample.js][policystatessummarizeforresourcegroupsample] | Summarizes policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupScope.json | -| [policyStatesSummarizeForResourceSample.js][policystatessummarizeforresourcesample] | Summarizes policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceScope.json | -| [policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.js][policystatessummarizeforsubscriptionlevelpolicyassignmentsample] | Summarizes policy states for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyAssignmentScope.json | -| [policyStatesSummarizeForSubscriptionSample.js][policystatessummarizeforsubscriptionsample] | Summarizes policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScope.json | -| [policyStatesTriggerResourceGroupEvaluationSample.js][policystatestriggerresourcegroupevaluationsample] | Triggers a policy evaluation scan for all the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json | -| [policyStatesTriggerSubscriptionEvaluationSample.js][policystatestriggersubscriptionevaluationsample] | Triggers a policy evaluation scan for all the resources under the subscription x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json | -| [policyTrackedResourcesListQueryResultsForManagementGroupSample.js][policytrackedresourceslistqueryresultsformanagementgroupsample] | Queries policy tracked resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryManagementGroupScope.json | -| [policyTrackedResourcesListQueryResultsForResourceGroupSample.js][policytrackedresourceslistqueryresultsforresourcegroupsample] | Queries policy tracked resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceGroupScope.json | -| [policyTrackedResourcesListQueryResultsForResourceSample.js][policytrackedresourceslistqueryresultsforresourcesample] | Queries policy tracked resources under the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceScope.json | -| [policyTrackedResourcesListQueryResultsForSubscriptionSample.js][policytrackedresourceslistqueryresultsforsubscriptionsample] | Queries policy tracked resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QuerySubscriptionScope.json | -| [queryAllPolicyStatesAtNestedResourceScope.js][queryallpolicystatesatnestedresourcescope] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryNestedResourceScope.json | -| [queryAllPolicyStatesAtResourceScope.js][queryallpolicystatesatresourcescope] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScope.json | -| [queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.js][queryallpolicystatesatresourcescopeandexpandpolicyevaluationdetails] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json | -| [queryAllPolicyStatesAtResourceScopeWithNextLink.js][queryallpolicystatesatresourcescopewithnextlink] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeNextLink.json | -| [queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.js][queryallpolicystatesatsubscriptionlevelnestedresourcescope] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelNestedResourceScope.json | -| [queryAllPolicyStatesAtSubscriptionLevelResourceScope.js][queryallpolicystatesatsubscriptionlevelresourcescope] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelResourceScope.json | -| [queryAtManagementGroupScope.js][queryatmanagementgroupscope] | Queries policy events for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScope.json | -| [queryAtManagementGroupScopeUsingQueryParameters.js][queryatmanagementgroupscopeusingqueryparameters] | Queries policy tracked resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryManagementGroupScopeWithFilterAndTop.json | -| [queryAtManagementGroupScopeWithNextLink.js][queryatmanagementgroupscopewithnextlink] | Queries policy events for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScopeNextLink.json | -| [queryAtNestedResourceScope.js][queryatnestedresourcescope] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryNestedResourceScope.json | -| [queryAtResourceGroupLevelPolicyAssignmentScope.js][queryatresourcegrouplevelpolicyassignmentscope] | Queries policy events for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScope.json | -| [queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.js][queryatresourcegrouplevelpolicyassignmentscopewithnextlink] | Queries policy events for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.json | -| [queryAtResourceGroupScope.js][queryatresourcegroupscope] | Queries policy events for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScope.json | -| [queryAtResourceGroupScopeUsingQueryParameters.js][queryatresourcegroupscopeusingqueryparameters] | Queries policy tracked resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceGroupScopeWithFilterAndTop.json | -| [queryAtResourceGroupScopeWithNextLink.js][queryatresourcegroupscopewithnextlink] | Queries policy events for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScopeNextLink.json | -| [queryAtResourceScope.js][queryatresourcescope] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScope.json | -| [queryAtResourceScopeUsingQueryParameters.js][queryatresourcescopeusingqueryparameters] | Queries policy tracked resources under the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceScopeWithFilterAndTop.json | -| [queryAtResourceScopeWithNextLink.js][queryatresourcescopewithnextlink] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeNextLink.json | -| [queryAtSubscriptionLevelNestedResourceScope.js][queryatsubscriptionlevelnestedresourcescope] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelNestedResourceScope.json | -| [queryAtSubscriptionLevelPolicyAssignmentScope.js][queryatsubscriptionlevelpolicyassignmentscope] | Queries policy events for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScope.json | -| [queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.js][queryatsubscriptionlevelpolicyassignmentscopewithnextlink] | Queries policy events for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.json | -| [queryAtSubscriptionLevelPolicyDefinitionScope.js][queryatsubscriptionlevelpolicydefinitionscope] | Queries policy events for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScope.json | -| [queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.js][queryatsubscriptionlevelpolicydefinitionscopewithnextlink] | Queries policy events for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.json | -| [queryAtSubscriptionLevelPolicySetDefinitionScope.js][queryatsubscriptionlevelpolicysetdefinitionscope] | Queries policy events for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScope.json | -| [queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.js][queryatsubscriptionlevelpolicysetdefinitionscopewithnextlink] | Queries policy events for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.json | -| [queryAtSubscriptionLevelResourceScope.js][queryatsubscriptionlevelresourcescope] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelResourceScope.json | -| [queryAtSubscriptionScope.js][queryatsubscriptionscope] | Queries policy events for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionScope.json | -| [queryAtSubscriptionScopeUsingQueryParameters.js][queryatsubscriptionscopeusingqueryparameters] | Queries policy tracked resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QuerySubscriptionScopeWithFilterAndTop.json | -| [queryAtSubscriptionScopeWithNextLink.js][queryatsubscriptionscopewithnextlink] | Queries policy events for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionScopeNextLink.json | -| [queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.js][querycomponentpolicycompliancestateatresourcescopefilteredbygivenassignment] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandComponents.json | -| [queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.js][querycomponentpolicycompliancestatecountgroupedbystatetypeatresourcescopefilteredbygivenassignment] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandComponentsGroupByWithAggregate.json | -| [queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.js][querycomponentspolicyeventscountgroupedbyuserandactiontypeforresourcescopefilteredbygivenassignment] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeExpandComponentsGroupByWithAggregate.json | -| [queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.js][querycomponentspolicyeventsforresourcescopefilteredbygivenassignment] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeExpandComponents.json | -| [queryLatestAtManagementGroupScope.js][querylatestatmanagementgroupscope] | Queries policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScope.json | -| [queryLatestAtManagementGroupScopeWithNextLink.js][querylatestatmanagementgroupscopewithnextlink] | Queries policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScopeNextLink.json | -| [queryLatestAtResourceGroupLevelPolicyAssignmentScope.js][querylatestatresourcegrouplevelpolicyassignmentscope] | Queries policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json | -| [queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.js][querylatestatresourcegrouplevelpolicyassignmentscopewithnextlink] | Queries policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.json | -| [queryLatestAtResourceGroupScope.js][querylatestatresourcegroupscope] | Queries policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScope.json | -| [queryLatestAtResourceGroupScopeWithNextLink.js][querylatestatresourcegroupscopewithnextlink] | Queries policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScopeNextLink.json | -| [queryLatestAtSubscriptionLevelPolicyAssignmentScope.js][querylatestatsubscriptionlevelpolicyassignmentscope] | Queries policy states for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json | -| [queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.js][querylatestatsubscriptionlevelpolicyassignmentscopewithnextlink] | Queries policy states for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.json | -| [queryLatestAtSubscriptionLevelPolicyDefinitionScope.js][querylatestatsubscriptionlevelpolicydefinitionscope] | Queries policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json | -| [queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.js][querylatestatsubscriptionlevelpolicydefinitionscopewithnextlink] | Queries policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.json | -| [queryLatestAtSubscriptionLevelPolicySetDefinitionScope.js][querylatestatsubscriptionlevelpolicysetdefinitionscope] | Queries policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json | -| [queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.js][querylatestatsubscriptionlevelpolicysetdefinitionscopewithnextlink] | Queries policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.json | -| [queryLatestAtSubscriptionScope.js][querylatestatsubscriptionscope] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionScope.json | -| [queryLatestAtSubscriptionScopeWithNextLink.js][querylatestatsubscriptionscopewithnextlink] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionScopeNextLink.json | -| [remediationsCancelAtManagementGroupSample.js][remediationscancelatmanagementgroupsample] | Cancels a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelManagementGroupScope.json | -| [remediationsCancelAtResourceGroupSample.js][remediationscancelatresourcegroupsample] | Cancels a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceGroupScope.json | -| [remediationsCancelAtResourceSample.js][remediationscancelatresourcesample] | Cancel a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceScope.json | -| [remediationsCancelAtSubscriptionSample.js][remediationscancelatsubscriptionsample] | Cancels a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelSubscriptionScope.json | -| [remediationsCreateOrUpdateAtManagementGroupSample.js][remediationscreateorupdateatmanagementgroupsample] | Creates or updates a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateManagementGroupScope.json | -| [remediationsCreateOrUpdateAtResourceGroupSample.js][remediationscreateorupdateatresourcegroupsample] | Creates or updates a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceGroupScope.json | -| [remediationsCreateOrUpdateAtResourceSample.js][remediationscreateorupdateatresourcesample] | Creates or updates a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceScope.json | -| [remediationsCreateOrUpdateAtSubscriptionSample.js][remediationscreateorupdateatsubscriptionsample] | Creates or updates a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json | -| [remediationsDeleteAtManagementGroupSample.js][remediationsdeleteatmanagementgroupsample] | Deletes an existing remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteManagementGroupScope.json | -| [remediationsDeleteAtResourceGroupSample.js][remediationsdeleteatresourcegroupsample] | Deletes an existing remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceGroupScope.json | -| [remediationsDeleteAtResourceSample.js][remediationsdeleteatresourcesample] | Deletes an existing remediation at individual resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceScope.json | -| [remediationsDeleteAtSubscriptionSample.js][remediationsdeleteatsubscriptionsample] | Deletes an existing remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteSubscriptionScope.json | -| [remediationsGetAtManagementGroupSample.js][remediationsgetatmanagementgroupsample] | Gets an existing remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetManagementGroupScope.json | -| [remediationsGetAtResourceGroupSample.js][remediationsgetatresourcegroupsample] | Gets an existing remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceGroupScope.json | -| [remediationsGetAtResourceSample.js][remediationsgetatresourcesample] | Gets an existing remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceScope.json | -| [remediationsGetAtSubscriptionSample.js][remediationsgetatsubscriptionsample] | Gets an existing remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetSubscriptionScope.json | -| [remediationsListDeploymentsAtManagementGroupSample.js][remediationslistdeploymentsatmanagementgroupsample] | Gets all deployments for a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsManagementGroupScope.json | -| [remediationsListDeploymentsAtResourceGroupSample.js][remediationslistdeploymentsatresourcegroupsample] | Gets all deployments for a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json | -| [remediationsListDeploymentsAtResourceSample.js][remediationslistdeploymentsatresourcesample] | Gets all deployments for a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceScope.json | -| [remediationsListDeploymentsAtSubscriptionSample.js][remediationslistdeploymentsatsubscriptionsample] | Gets all deployments for a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsSubscriptionScope.json | -| [remediationsListForManagementGroupSample.js][remediationslistformanagementgroupsample] | Gets all remediations for the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope.json | -| [remediationsListForResourceGroupSample.js][remediationslistforresourcegroupsample] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope.json | -| [remediationsListForResourceSample.js][remediationslistforresourcesample] | Gets all remediations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope.json | -| [remediationsListForSubscriptionSample.js][remediationslistforsubscriptionsample] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope.json | -| [summarizeAtManagementGroupScope.js][summarizeatmanagementgroupscope] | Summarizes policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeManagementGroupScope.json | -| [summarizeAtPolicyAssignmentScope.js][summarizeatpolicyassignmentscope] | Summarizes policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json | -| [summarizeAtPolicyDefinitionScope.js][summarizeatpolicydefinitionscope] | Summarizes policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json | -| [summarizeAtPolicySetDefinitionScope.js][summarizeatpolicysetdefinitionscope] | Summarizes policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json | -| [summarizeAtResourceGroupScope.js][summarizeatresourcegroupscope] | Summarizes policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupScope.json | -| [summarizeAtResourceScope.js][summarizeatresourcescope] | Summarizes policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceScope.json | -| [summarizeAtSubscriptionScope.js][summarizeatsubscriptionscope] | Summarizes policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScope.json | -| [summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.js][summarizeatsubscriptionscopeforapolicydefinitiongroup] | Summarizes policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScopeForPolicyGroup.json | -| [timeRangeSortSelectAndLimit.js][timerangesortselectandlimit] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TimeRangeSortSelectTop.json | -| [triggerEvaluationsForAllResourcesInAResourceGroup.js][triggerevaluationsforallresourcesinaresourcegroup] | Triggers a policy evaluation scan for all the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json | -| [triggerEvaluationsForAllResourcesInASubscription.js][triggerevaluationsforallresourcesinasubscription] | Triggers a policy evaluation scan for all the resources under the subscription x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json | +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [attestationsCreateOrUpdateAtResourceGroupSample.js][attestationscreateorupdateatresourcegroupsample] | Creates or updates an attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceGroupScope.json | +| [attestationsCreateOrUpdateAtResourceSample.js][attestationscreateorupdateatresourcesample] | Creates or updates an attestation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceScope.json | +| [attestationsCreateOrUpdateAtSubscriptionSample.js][attestationscreateorupdateatsubscriptionsample] | Creates or updates an attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateSubscriptionScope.json | +| [attestationsDeleteAtResourceGroupSample.js][attestationsdeleteatresourcegroupsample] | Deletes an existing attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceGroupScope.json | +| [attestationsDeleteAtResourceSample.js][attestationsdeleteatresourcesample] | Deletes an existing attestation at individual resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceScope.json | +| [attestationsDeleteAtSubscriptionSample.js][attestationsdeleteatsubscriptionsample] | Deletes an existing attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteSubscriptionScope.json | +| [attestationsGetAtResourceGroupSample.js][attestationsgetatresourcegroupsample] | Gets an existing attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceGroupScope.json | +| [attestationsGetAtResourceSample.js][attestationsgetatresourcesample] | Gets an existing attestation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceScope.json | +| [attestationsGetAtSubscriptionSample.js][attestationsgetatsubscriptionsample] | Gets an existing attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetSubscriptionScope.json | +| [attestationsListForResourceGroupSample.js][attestationslistforresourcegroupsample] | Gets all attestations for the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceGroupScope.json | +| [attestationsListForResourceSample.js][attestationslistforresourcesample] | Gets all attestations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceScope.json | +| [attestationsListForSubscriptionSample.js][attestationslistforsubscriptionsample] | Gets all attestations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListSubscriptionScope.json | +| [operationsListSample.js][operationslistsample] | Lists available operations. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_ListOperations.json | +| [policyEventsListQueryResultsForManagementGroupSample.js][policyeventslistqueryresultsformanagementgroupsample] | Queries policy events for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScope.json | +| [policyEventsListQueryResultsForPolicyDefinitionSample.js][policyeventslistqueryresultsforpolicydefinitionsample] | Queries policy events for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScope.json | +| [policyEventsListQueryResultsForPolicySetDefinitionSample.js][policyeventslistqueryresultsforpolicysetdefinitionsample] | Queries policy events for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScope.json | +| [policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.js][policyeventslistqueryresultsforresourcegrouplevelpolicyassignmentsample] | Queries policy events for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScope.json | +| [policyEventsListQueryResultsForResourceGroupSample.js][policyeventslistqueryresultsforresourcegroupsample] | Queries policy events for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScope.json | +| [policyEventsListQueryResultsForResourceSample.js][policyeventslistqueryresultsforresourcesample] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryNestedResourceScope.json | +| [policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.js][policyeventslistqueryresultsforsubscriptionlevelpolicyassignmentsample] | Queries policy events for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScope.json | +| [policyEventsListQueryResultsForSubscriptionSample.js][policyeventslistqueryresultsforsubscriptionsample] | Queries policy events for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_FilterAndAggregateOnly.json | +| [policyMetadataGetResourceSample.js][policymetadatagetresourcesample] | Get policy metadata resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_GetResource.json | +| [policyMetadataListSample.js][policymetadatalistsample] | Get a list of the policy metadata resources. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List.json | +| [policyRestrictionsCheckAtManagementGroupScopeSample.js][policyrestrictionscheckatmanagementgroupscopesample] | Checks what restrictions Azure Policy will place on resources within a management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtManagementGroupScope.json | +| [policyRestrictionsCheckAtResourceGroupScopeSample.js][policyrestrictionscheckatresourcegroupscopesample] | Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json | +| [policyRestrictionsCheckAtSubscriptionScopeSample.js][policyrestrictionscheckatsubscriptionscopesample] | Checks what restrictions Azure Policy will place on a resource within a subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json | +| [policyStatesListQueryResultsForManagementGroupSample.js][policystateslistqueryresultsformanagementgroupsample] | Queries policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScope.json | +| [policyStatesListQueryResultsForPolicyDefinitionSample.js][policystateslistqueryresultsforpolicydefinitionsample] | Queries policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json | +| [policyStatesListQueryResultsForPolicySetDefinitionSample.js][policystateslistqueryresultsforpolicysetdefinitionsample] | Queries policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json | +| [policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.js][policystateslistqueryresultsforresourcegrouplevelpolicyassignmentsample] | Queries policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json | +| [policyStatesListQueryResultsForResourceGroupSample.js][policystateslistqueryresultsforresourcegroupsample] | Queries policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScope.json | +| [policyStatesListQueryResultsForResourceSample.js][policystateslistqueryresultsforresourcesample] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryNestedResourceScope.json | +| [policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.js][policystateslistqueryresultsforsubscriptionlevelpolicyassignmentsample] | Queries policy states for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json | +| [policyStatesListQueryResultsForSubscriptionSample.js][policystateslistqueryresultsforsubscriptionsample] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndAggregateOnly.json | +| [policyStatesSummarizeForManagementGroupSample.js][policystatessummarizeformanagementgroupsample] | Summarizes policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeManagementGroupScope.json | +| [policyStatesSummarizeForPolicyDefinitionSample.js][policystatessummarizeforpolicydefinitionsample] | Summarizes policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json | +| [policyStatesSummarizeForPolicySetDefinitionSample.js][policystatessummarizeforpolicysetdefinitionsample] | Summarizes policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json | +| [policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.js][policystatessummarizeforresourcegrouplevelpolicyassignmentsample] | Summarizes policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json | +| [policyStatesSummarizeForResourceGroupSample.js][policystatessummarizeforresourcegroupsample] | Summarizes policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupScope.json | +| [policyStatesSummarizeForResourceSample.js][policystatessummarizeforresourcesample] | Summarizes policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceScope.json | +| [policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.js][policystatessummarizeforsubscriptionlevelpolicyassignmentsample] | Summarizes policy states for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyAssignmentScope.json | +| [policyStatesSummarizeForSubscriptionSample.js][policystatessummarizeforsubscriptionsample] | Summarizes policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScope.json | +| [policyStatesTriggerResourceGroupEvaluationSample.js][policystatestriggerresourcegroupevaluationsample] | Triggers a policy evaluation scan for all the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json | +| [policyStatesTriggerSubscriptionEvaluationSample.js][policystatestriggersubscriptionevaluationsample] | Triggers a policy evaluation scan for all the resources under the subscription x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json | +| [policyTrackedResourcesListQueryResultsForManagementGroupSample.js][policytrackedresourceslistqueryresultsformanagementgroupsample] | Queries policy tracked resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryManagementGroupScope.json | +| [policyTrackedResourcesListQueryResultsForResourceGroupSample.js][policytrackedresourceslistqueryresultsforresourcegroupsample] | Queries policy tracked resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceGroupScope.json | +| [policyTrackedResourcesListQueryResultsForResourceSample.js][policytrackedresourceslistqueryresultsforresourcesample] | Queries policy tracked resources under the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceScope.json | +| [policyTrackedResourcesListQueryResultsForSubscriptionSample.js][policytrackedresourceslistqueryresultsforsubscriptionsample] | Queries policy tracked resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QuerySubscriptionScope.json | +| [remediationsCancelAtManagementGroupSample.js][remediationscancelatmanagementgroupsample] | Cancels a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelManagementGroupScope.json | +| [remediationsCancelAtResourceGroupSample.js][remediationscancelatresourcegroupsample] | Cancels a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceGroupScope.json | +| [remediationsCancelAtResourceSample.js][remediationscancelatresourcesample] | Cancel a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceScope.json | +| [remediationsCancelAtSubscriptionSample.js][remediationscancelatsubscriptionsample] | Cancels a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelSubscriptionScope.json | +| [remediationsCreateOrUpdateAtManagementGroupSample.js][remediationscreateorupdateatmanagementgroupsample] | Creates or updates a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateManagementGroupScope.json | +| [remediationsCreateOrUpdateAtResourceGroupSample.js][remediationscreateorupdateatresourcegroupsample] | Creates or updates a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceGroupScope.json | +| [remediationsCreateOrUpdateAtResourceSample.js][remediationscreateorupdateatresourcesample] | Creates or updates a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceScope.json | +| [remediationsCreateOrUpdateAtSubscriptionSample.js][remediationscreateorupdateatsubscriptionsample] | Creates or updates a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json | +| [remediationsDeleteAtManagementGroupSample.js][remediationsdeleteatmanagementgroupsample] | Deletes an existing remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteManagementGroupScope.json | +| [remediationsDeleteAtResourceGroupSample.js][remediationsdeleteatresourcegroupsample] | Deletes an existing remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceGroupScope.json | +| [remediationsDeleteAtResourceSample.js][remediationsdeleteatresourcesample] | Deletes an existing remediation at individual resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceScope.json | +| [remediationsDeleteAtSubscriptionSample.js][remediationsdeleteatsubscriptionsample] | Deletes an existing remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteSubscriptionScope.json | +| [remediationsGetAtManagementGroupSample.js][remediationsgetatmanagementgroupsample] | Gets an existing remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetManagementGroupScope.json | +| [remediationsGetAtResourceGroupSample.js][remediationsgetatresourcegroupsample] | Gets an existing remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceGroupScope.json | +| [remediationsGetAtResourceSample.js][remediationsgetatresourcesample] | Gets an existing remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceScope.json | +| [remediationsGetAtSubscriptionSample.js][remediationsgetatsubscriptionsample] | Gets an existing remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetSubscriptionScope.json | +| [remediationsListDeploymentsAtManagementGroupSample.js][remediationslistdeploymentsatmanagementgroupsample] | Gets all deployments for a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsManagementGroupScope.json | +| [remediationsListDeploymentsAtResourceGroupSample.js][remediationslistdeploymentsatresourcegroupsample] | Gets all deployments for a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json | +| [remediationsListDeploymentsAtResourceSample.js][remediationslistdeploymentsatresourcesample] | Gets all deployments for a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceScope.json | +| [remediationsListDeploymentsAtSubscriptionSample.js][remediationslistdeploymentsatsubscriptionsample] | Gets all deployments for a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsSubscriptionScope.json | +| [remediationsListForManagementGroupSample.js][remediationslistformanagementgroupsample] | Gets all remediations for the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope.json | +| [remediationsListForResourceGroupSample.js][remediationslistforresourcegroupsample] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope.json | +| [remediationsListForResourceSample.js][remediationslistforresourcesample] | Gets all remediations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope.json | +| [remediationsListForSubscriptionSample.js][remediationslistforsubscriptionsample] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope.json | ## Prerequisites @@ -240,61 +127,6 @@ Take a look at our [API Documentation][apiref] for more information about the AP [attestationslistforresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForResourceGroupSample.js [attestationslistforresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForResourceSample.js [attestationslistforsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForSubscriptionSample.js -[cancelaremediationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtIndividualResourceScope.js -[cancelaremediationatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtManagementGroupScope.js -[cancelaremediationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtResourceGroupScope.js -[cancelaremediationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtSubscriptionScope.js -[checkpolicyrestrictionsatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/checkPolicyRestrictionsAtResourceGroupScope.js -[checkpolicyrestrictionsatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/checkPolicyRestrictionsAtSubscriptionScope.js -[createattestationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtIndividualResourceScope.js -[createattestationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtResourceGroupScope.js -[createattestationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtSubscriptionScope.js -[createattestationatsubscriptionscopewithallproperties]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtSubscriptionScopeWithAllProperties.js -[createremediationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtIndividualResourceScope.js -[createremediationatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtManagementGroupScope.js -[createremediationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtResourceGroupScope.js -[createremediationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtSubscriptionScope.js -[createremediationatsubscriptionscopewithallproperties]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtSubscriptionScopeWithAllProperties.js -[deleteattestationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteAttestationAtIndividualResourceScope.js -[deleteattestationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteAttestationAtResourceGroupScope.js -[deleteattestationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteAttestationAtSubscriptionScope.js -[deleteremediationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtIndividualResourceScope.js -[deleteremediationatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtManagementGroupScope.js -[deleteremediationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtResourceGroupScope.js -[deleteremediationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtSubscriptionScope.js -[filterandaggregateonly]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndAggregateOnly.js -[filterandgroupwithaggregate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndGroupWithAggregate.js -[filterandgroupwithoutaggregate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndGroupWithoutAggregate.js -[filterandmultiplegroups]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndMultipleGroups.js -[getasinglepolicymetadataresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getASinglePolicyMetadataResource.js -[getattestationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getAttestationAtIndividualResourceScope.js -[getattestationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getAttestationAtResourceGroupScope.js -[getattestationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getAttestationAtSubscriptionScope.js -[getcollectionofpolicymetadataresources]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getCollectionOfPolicyMetadataResources.js -[getcollectionofpolicymetadataresourcesusingtopqueryparameter]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.js -[getremediationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtIndividualResourceScope.js -[getremediationatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtManagementGroupScope.js -[getremediationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtResourceGroupScope.js -[getremediationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtSubscriptionScope.js -[listattestationsatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtIndividualResourceScope.js -[listattestationsatindividualresourcescopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtIndividualResourceScopeWithQueryParameters.js -[listattestationsatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtResourceGroupScope.js -[listattestationsatresourcegroupscopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtResourceGroupScopeWithQueryParameters.js -[listattestationsatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtSubscriptionScope.js -[listattestationsatsubscriptionscopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtSubscriptionScopeWithQueryParameters.js -[listdeploymentsforaremediationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtIndividualResourceScope.js -[listdeploymentsforaremediationatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtManagementGroupScope.js -[listdeploymentsforaremediationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtResourceGroupScope.js -[listdeploymentsforaremediationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtSubscriptionScope.js -[listoperations]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listOperations.js -[listremediationsatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtIndividualResourceScope.js -[listremediationsatindividualresourcescopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtIndividualResourceScopeWithQueryParameters.js -[listremediationsatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtManagementGroupScope.js -[listremediationsatmanagementgroupscopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtManagementGroupScopeWithQueryParameters.js -[listremediationsatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtResourceGroupScope.js -[listremediationsatresourcegroupscopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtResourceGroupScopeWithQueryParameters.js -[listremediationsatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtSubscriptionScope.js -[listremediationsatsubscriptionscopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtSubscriptionScopeWithQueryParameters.js [operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/operationsListSample.js [policyeventslistqueryresultsformanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForManagementGroupSample.js [policyeventslistqueryresultsforpolicydefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForPolicyDefinitionSample.js @@ -331,53 +163,6 @@ Take a look at our [API Documentation][apiref] for more information about the AP [policytrackedresourceslistqueryresultsforresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyTrackedResourcesListQueryResultsForResourceGroupSample.js [policytrackedresourceslistqueryresultsforresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyTrackedResourcesListQueryResultsForResourceSample.js [policytrackedresourceslistqueryresultsforsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyTrackedResourcesListQueryResultsForSubscriptionSample.js -[queryallpolicystatesatnestedresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtNestedResourceScope.js -[queryallpolicystatesatresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtResourceScope.js -[queryallpolicystatesatresourcescopeandexpandpolicyevaluationdetails]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.js -[queryallpolicystatesatresourcescopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtResourceScopeWithNextLink.js -[queryallpolicystatesatsubscriptionlevelnestedresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.js -[queryallpolicystatesatsubscriptionlevelresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtSubscriptionLevelResourceScope.js -[queryatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtManagementGroupScope.js -[queryatmanagementgroupscopeusingqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtManagementGroupScopeUsingQueryParameters.js -[queryatmanagementgroupscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtManagementGroupScopeWithNextLink.js -[queryatnestedresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtNestedResourceScope.js -[queryatresourcegrouplevelpolicyassignmentscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupLevelPolicyAssignmentScope.js -[queryatresourcegrouplevelpolicyassignmentscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.js -[queryatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupScope.js -[queryatresourcegroupscopeusingqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupScopeUsingQueryParameters.js -[queryatresourcegroupscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupScopeWithNextLink.js -[queryatresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceScope.js -[queryatresourcescopeusingqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceScopeUsingQueryParameters.js -[queryatresourcescopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceScopeWithNextLink.js -[queryatsubscriptionlevelnestedresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelNestedResourceScope.js -[queryatsubscriptionlevelpolicyassignmentscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyAssignmentScope.js -[queryatsubscriptionlevelpolicyassignmentscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.js -[queryatsubscriptionlevelpolicydefinitionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyDefinitionScope.js -[queryatsubscriptionlevelpolicydefinitionscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.js -[queryatsubscriptionlevelpolicysetdefinitionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicySetDefinitionScope.js -[queryatsubscriptionlevelpolicysetdefinitionscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.js -[queryatsubscriptionlevelresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelResourceScope.js -[queryatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionScope.js -[queryatsubscriptionscopeusingqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionScopeUsingQueryParameters.js -[queryatsubscriptionscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionScopeWithNextLink.js -[querycomponentpolicycompliancestateatresourcescopefilteredbygivenassignment]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.js -[querycomponentpolicycompliancestatecountgroupedbystatetypeatresourcescopefilteredbygivenassignment]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.js -[querycomponentspolicyeventscountgroupedbyuserandactiontypeforresourcescopefilteredbygivenassignment]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.js -[querycomponentspolicyeventsforresourcescopefilteredbygivenassignment]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.js -[querylatestatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtManagementGroupScope.js -[querylatestatmanagementgroupscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtManagementGroupScopeWithNextLink.js -[querylatestatresourcegrouplevelpolicyassignmentscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupLevelPolicyAssignmentScope.js -[querylatestatresourcegrouplevelpolicyassignmentscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.js -[querylatestatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupScope.js -[querylatestatresourcegroupscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupScopeWithNextLink.js -[querylatestatsubscriptionlevelpolicyassignmentscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyAssignmentScope.js -[querylatestatsubscriptionlevelpolicyassignmentscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.js -[querylatestatsubscriptionlevelpolicydefinitionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyDefinitionScope.js -[querylatestatsubscriptionlevelpolicydefinitionscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.js -[querylatestatsubscriptionlevelpolicysetdefinitionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicySetDefinitionScope.js -[querylatestatsubscriptionlevelpolicysetdefinitionscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.js -[querylatestatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionScope.js -[querylatestatsubscriptionscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionScopeWithNextLink.js [remediationscancelatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/remediationsCancelAtManagementGroupSample.js [remediationscancelatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/remediationsCancelAtResourceGroupSample.js [remediationscancelatresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/remediationsCancelAtResourceSample.js @@ -402,17 +187,6 @@ Take a look at our [API Documentation][apiref] for more information about the AP [remediationslistforresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/remediationsListForResourceGroupSample.js [remediationslistforresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/remediationsListForResourceSample.js [remediationslistforsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/remediationsListForSubscriptionSample.js -[summarizeatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtManagementGroupScope.js -[summarizeatpolicyassignmentscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtPolicyAssignmentScope.js -[summarizeatpolicydefinitionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtPolicyDefinitionScope.js -[summarizeatpolicysetdefinitionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtPolicySetDefinitionScope.js -[summarizeatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtResourceGroupScope.js -[summarizeatresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtResourceScope.js -[summarizeatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtSubscriptionScope.js -[summarizeatsubscriptionscopeforapolicydefinitiongroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.js -[timerangesortselectandlimit]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/timeRangeSortSelectAndLimit.js -[triggerevaluationsforallresourcesinaresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/triggerEvaluationsForAllResourcesInAResourceGroup.js -[triggerevaluationsforallresourcesinasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/triggerEvaluationsForAllResourcesInASubscription.js [apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-policyinsights?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policyinsights/arm-policyinsights/README.md diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsCreateOrUpdateAtResourceGroupSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsCreateOrUpdateAtResourceGroupSample.js index 96a53b6c0b5b..6b1091f05949 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsCreateOrUpdateAtResourceGroupSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsCreateOrUpdateAtResourceGroupSample.js @@ -15,13 +15,14 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to Creates or updates an attestation at resource group scope. * * @summary Creates or updates an attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceGroupScope.json */ async function createAttestationAtResourceGroupScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; const resourceGroupName = "myRg"; const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; const parameters = { + assessmentDate: new Date("2021-06-10T00:00:00Z"), comments: "This subscription has passed a security audit.", complianceState: "Compliant", evidence: [ @@ -31,6 +32,7 @@ async function createAttestationAtResourceGroupScope() { }, ], expiresOn: new Date("2021-06-15T00:00:00Z"), + metadata: { departmentId: "NYC-MARKETING-1" }, owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", policyAssignmentId: "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsCreateOrUpdateAtResourceSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsCreateOrUpdateAtResourceSample.js index b2eacb89406b..ec2d6bc4c475 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsCreateOrUpdateAtResourceSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsCreateOrUpdateAtResourceSample.js @@ -15,7 +15,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to Creates or updates an attestation at resource scope. * * @summary Creates or updates an attestation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceScope.json */ async function createAttestationAtIndividualResourceScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; @@ -23,6 +23,7 @@ async function createAttestationAtIndividualResourceScope() { "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; const parameters = { + assessmentDate: new Date("2021-06-10T00:00:00Z"), comments: "This subscription has passed a security audit.", complianceState: "Compliant", evidence: [ @@ -32,6 +33,7 @@ async function createAttestationAtIndividualResourceScope() { }, ], expiresOn: new Date("2021-06-15T00:00:00Z"), + metadata: { departmentId: "NYC-MARKETING-1" }, owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", policyAssignmentId: "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsCreateOrUpdateAtSubscriptionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsCreateOrUpdateAtSubscriptionSample.js index 3327bd15db9f..285defb21e2d 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsCreateOrUpdateAtSubscriptionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsCreateOrUpdateAtSubscriptionSample.js @@ -15,7 +15,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to Creates or updates an attestation at subscription scope. * * @summary Creates or updates an attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateSubscriptionScope.json */ async function createAttestationAtSubscriptionScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; @@ -40,12 +40,13 @@ createAttestationAtSubscriptionScope().catch(console.error); * This sample demonstrates how to Creates or updates an attestation at subscription scope. * * @summary Creates or updates an attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json */ async function createAttestationAtSubscriptionScopeWithAllProperties() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; const parameters = { + assessmentDate: new Date("2021-06-10T00:00:00Z"), comments: "This subscription has passed a security audit.", complianceState: "Compliant", evidence: [ @@ -55,6 +56,7 @@ async function createAttestationAtSubscriptionScopeWithAllProperties() { }, ], expiresOn: new Date("2021-06-15T00:00:00Z"), + metadata: { departmentId: "NYC-MARKETING-1" }, owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", policyAssignmentId: "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsDeleteAtResourceGroupSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsDeleteAtResourceGroupSample.js index 27ebced7542e..fe8812c48d9c 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsDeleteAtResourceGroupSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsDeleteAtResourceGroupSample.js @@ -15,7 +15,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to Deletes an existing attestation at resource group scope. * * @summary Deletes an existing attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceGroupScope.json */ async function deleteAttestationAtResourceGroupScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsDeleteAtResourceSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsDeleteAtResourceSample.js index fc2aecc6b93b..d1e9c8364cca 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsDeleteAtResourceSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsDeleteAtResourceSample.js @@ -15,7 +15,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to Deletes an existing attestation at individual resource scope. * * @summary Deletes an existing attestation at individual resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceScope.json */ async function deleteAttestationAtIndividualResourceScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsDeleteAtSubscriptionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsDeleteAtSubscriptionSample.js index 7a10f818ea2c..f8daf0bad4c4 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsDeleteAtSubscriptionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsDeleteAtSubscriptionSample.js @@ -15,7 +15,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to Deletes an existing attestation at subscription scope. * * @summary Deletes an existing attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteSubscriptionScope.json */ async function deleteAttestationAtSubscriptionScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsGetAtResourceGroupSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsGetAtResourceGroupSample.js index e30bcfbc4439..c36fcd48b864 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsGetAtResourceGroupSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsGetAtResourceGroupSample.js @@ -15,7 +15,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to Gets an existing attestation at resource group scope. * * @summary Gets an existing attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceGroupScope.json */ async function getAttestationAtResourceGroupScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsGetAtResourceSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsGetAtResourceSample.js index e20d0fd5377b..ba20f6da67da 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsGetAtResourceSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsGetAtResourceSample.js @@ -15,7 +15,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to Gets an existing attestation at resource scope. * * @summary Gets an existing attestation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceScope.json */ async function getAttestationAtIndividualResourceScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsGetAtSubscriptionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsGetAtSubscriptionSample.js index 75685f02502d..6c7c914dc44c 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsGetAtSubscriptionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsGetAtSubscriptionSample.js @@ -15,7 +15,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to Gets an existing attestation at subscription scope. * * @summary Gets an existing attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetSubscriptionScope.json */ async function getAttestationAtSubscriptionScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForResourceGroupSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForResourceGroupSample.js index bc140405c1bd..ce9f066a9726 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForResourceGroupSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForResourceGroupSample.js @@ -15,7 +15,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to Gets all attestations for the resource group. * * @summary Gets all attestations for the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceGroupScope.json */ async function listAttestationsAtResourceGroupScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; @@ -35,7 +35,7 @@ listAttestationsAtResourceGroupScope().catch(console.error); * This sample demonstrates how to Gets all attestations for the resource group. * * @summary Gets all attestations for the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceGroupScope_WithQuery.json */ async function listAttestationsAtResourceGroupScopeWithQueryParameters() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForResourceSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForResourceSample.js index 75e27b26cd7d..d763d3f88e63 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForResourceSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForResourceSample.js @@ -15,7 +15,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to Gets all attestations for a resource. * * @summary Gets all attestations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceScope.json */ async function listAttestationsAtIndividualResourceScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; @@ -36,7 +36,7 @@ listAttestationsAtIndividualResourceScope().catch(console.error); * This sample demonstrates how to Gets all attestations for a resource. * * @summary Gets all attestations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceScope_WithQuery.json */ async function listAttestationsAtIndividualResourceScopeWithQueryParameters() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForSubscriptionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForSubscriptionSample.js index 7f287cba008d..ef6061aa2492 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForSubscriptionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/attestationsListForSubscriptionSample.js @@ -15,7 +15,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to Gets all attestations for the subscription. * * @summary Gets all attestations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListSubscriptionScope.json */ async function listAttestationsAtSubscriptionScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; @@ -34,7 +34,7 @@ listAttestationsAtSubscriptionScope().catch(console.error); * This sample demonstrates how to Gets all attestations for the subscription. * * @summary Gets all attestations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListSubscriptionScope_WithQuery.json */ async function listAttestationsAtSubscriptionScopeWithQueryParameters() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtIndividualResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtIndividualResourceScope.js deleted file mode 100644 index 9f6bfd5da169..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Cancel a remediation at resource scope. - * - * @summary Cancel a remediation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function cancelARemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.cancelAtResource(resourceId, remediationName); - console.log(result); -} - -cancelARemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtManagementGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtManagementGroupScope.js deleted file mode 100644 index 068202fe23fa..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtManagementGroupScope.js +++ /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. -/** - * This sample demonstrates how to Cancels a remediation at management group scope. - * - * @summary Cancels a remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelManagementGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function cancelARemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.cancelAtManagementGroup( - managementGroupId, - remediationName - ); - console.log(result); -} - -cancelARemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtResourceGroupScope.js deleted file mode 100644 index a7dfadb98ee7..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtResourceGroupScope.js +++ /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. -/** - * This sample demonstrates how to Cancels a remediation at resource group scope. - * - * @summary Cancels a remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function cancelARemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.cancelAtResourceGroup( - resourceGroupName, - remediationName - ); - console.log(result); -} - -cancelARemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtSubscriptionScope.js deleted file mode 100644 index a12cdf097cc8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/cancelARemediationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Cancels a remediation at subscription scope. - * - * @summary Cancels a remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelSubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function cancelARemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.cancelAtSubscription(remediationName); - console.log(result); -} - -cancelARemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/checkPolicyRestrictionsAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/checkPolicyRestrictionsAtResourceGroupScope.js deleted file mode 100644 index ba1d842a56aa..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/checkPolicyRestrictionsAtResourceGroupScope.js +++ /dev/null @@ -1,49 +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. -/** - * This sample demonstrates how to Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. - * - * @summary Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function checkPolicyRestrictionsAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "vmRg"; - const parameters = { - pendingFields: [ - { field: "name", values: ["myVMName"] }, - { - field: "location", - values: ["eastus", "westus", "westus2", "westeurope"], - }, - { field: "tags" }, - ], - resourceDetails: { - apiVersion: "2019-12-01", - resourceContent: { - type: "Microsoft.Compute/virtualMachines", - properties: { priority: "Spot" }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyRestrictions.checkAtResourceGroupScope( - resourceGroupName, - parameters - ); - console.log(result); -} - -checkPolicyRestrictionsAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/checkPolicyRestrictionsAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/checkPolicyRestrictionsAtSubscriptionScope.js deleted file mode 100644 index 69eeec75a986..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/checkPolicyRestrictionsAtSubscriptionScope.js +++ /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. -/** - * This sample demonstrates how to Checks what restrictions Azure Policy will place on a resource within a subscription. - * - * @summary Checks what restrictions Azure Policy will place on a resource within a subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function checkPolicyRestrictionsAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const parameters = { - pendingFields: [ - { field: "name", values: ["myVMName"] }, - { - field: "location", - values: ["eastus", "westus", "westus2", "westeurope"], - }, - { field: "tags" }, - ], - resourceDetails: { - apiVersion: "2019-12-01", - resourceContent: { - type: "Microsoft.Compute/virtualMachines", - properties: { priority: "Spot" }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyRestrictions.checkAtSubscriptionScope(parameters); - console.log(result); -} - -checkPolicyRestrictionsAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtIndividualResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtIndividualResourceScope.js deleted file mode 100644 index 91cf982a74f5..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtIndividualResourceScope.js +++ /dev/null @@ -1,50 +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. -/** - * This sample demonstrates how to Creates or updates an attestation at resource scope. - * - * @summary Creates or updates an attestation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function createAttestationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const parameters = { - comments: "This subscription has passed a security audit.", - complianceState: "Compliant", - evidence: [ - { - description: "The results of the security audit.", - sourceUri: "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011", - }, - ], - expiresOn: new Date("2021-06-15T00:00:00Z"), - owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - policyDefinitionReferenceId: "0b158b46-ff42-4799-8e39-08a5c23b4551", - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.beginCreateOrUpdateAtResourceAndWait( - resourceId, - attestationName, - parameters - ); - console.log(result); -} - -createAttestationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtResourceGroupScope.js deleted file mode 100644 index 357a4b925118..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtResourceGroupScope.js +++ /dev/null @@ -1,49 +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. -/** - * This sample demonstrates how to Creates or updates an attestation at resource group scope. - * - * @summary Creates or updates an attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function createAttestationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const parameters = { - comments: "This subscription has passed a security audit.", - complianceState: "Compliant", - evidence: [ - { - description: "The results of the security audit.", - sourceUri: "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011", - }, - ], - expiresOn: new Date("2021-06-15T00:00:00Z"), - owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - policyDefinitionReferenceId: "0b158b46-ff42-4799-8e39-08a5c23b4551", - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.beginCreateOrUpdateAtResourceGroupAndWait( - resourceGroupName, - attestationName, - parameters - ); - console.log(result); -} - -createAttestationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtSubscriptionScope.js deleted file mode 100644 index 9671f09766af..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Creates or updates an attestation at subscription scope. - * - * @summary Creates or updates an attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function createAttestationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const parameters = { - complianceState: "Compliant", - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.beginCreateOrUpdateAtSubscriptionAndWait( - attestationName, - parameters - ); - console.log(result); -} - -createAttestationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtSubscriptionScopeWithAllProperties.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtSubscriptionScopeWithAllProperties.js deleted file mode 100644 index 8e3e0cf40bdd..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createAttestationAtSubscriptionScopeWithAllProperties.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. -/** - * This sample demonstrates how to Creates or updates an attestation at subscription scope. - * - * @summary Creates or updates an attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function createAttestationAtSubscriptionScopeWithAllProperties() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const parameters = { - comments: "This subscription has passed a security audit.", - complianceState: "Compliant", - evidence: [ - { - description: "The results of the security audit.", - sourceUri: "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011", - }, - ], - expiresOn: new Date("2021-06-15T00:00:00Z"), - owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - policyDefinitionReferenceId: "0b158b46-ff42-4799-8e39-08a5c23b4551", - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.beginCreateOrUpdateAtSubscriptionAndWait( - attestationName, - parameters - ); - console.log(result); -} - -createAttestationAtSubscriptionScopeWithAllProperties().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtIndividualResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtIndividualResourceScope.js deleted file mode 100644 index fe2b3c2f5945..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtIndividualResourceScope.js +++ /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. -/** - * This sample demonstrates how to Creates or updates a remediation at resource scope. - * - * @summary Creates or updates a remediation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function createRemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "storageRemediation"; - const parameters = { - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtResource( - resourceId, - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtManagementGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtManagementGroupScope.js deleted file mode 100644 index bacd6d354bf9..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtManagementGroupScope.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. -/** - * This sample demonstrates how to Creates or updates a remediation at management group scope. - * - * @summary Creates or updates a remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateManagementGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function createRemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "storageRemediation"; - const parameters = { - policyAssignmentId: - "/providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtManagementGroup( - managementGroupId, - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtResourceGroupScope.js deleted file mode 100644 index c00a41e1b66b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Creates or updates a remediation at resource group scope. - * - * @summary Creates or updates a remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function createRemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "storageRemediation"; - const parameters = { - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtResourceGroup( - resourceGroupName, - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtSubscriptionScope.js deleted file mode 100644 index e4b92e970ea6..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Creates or updates a remediation at subscription scope. - * - * @summary Creates or updates a remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function createRemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "storageRemediation"; - const parameters = { - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtSubscription( - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtSubscriptionScopeWithAllProperties.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtSubscriptionScopeWithAllProperties.js deleted file mode 100644 index 8e3d0b2c4d07..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/createRemediationAtSubscriptionScopeWithAllProperties.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. -/** - * This sample demonstrates how to Creates or updates a remediation at subscription scope. - * - * @summary Creates or updates a remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope_AllProperties.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function createRemediationAtSubscriptionScopeWithAllProperties() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "storageRemediation"; - const parameters = { - failureThreshold: { percentage: 0.1 }, - filters: { locations: ["eastus", "westus"] }, - parallelDeployments: 6, - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - policyDefinitionReferenceId: "8c8fa9e4", - resourceCount: 42, - resourceDiscoveryMode: "ReEvaluateCompliance", - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtSubscription( - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtSubscriptionScopeWithAllProperties().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteAttestationAtIndividualResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteAttestationAtIndividualResourceScope.js deleted file mode 100644 index 831f1033356e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteAttestationAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Deletes an existing attestation at individual resource scope. - * - * @summary Deletes an existing attestation at individual resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function deleteAttestationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.deleteAtResource(resourceId, attestationName); - console.log(result); -} - -deleteAttestationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteAttestationAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteAttestationAtResourceGroupScope.js deleted file mode 100644 index 52b76c164d61..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteAttestationAtResourceGroupScope.js +++ /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. -/** - * This sample demonstrates how to Deletes an existing attestation at resource group scope. - * - * @summary Deletes an existing attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function deleteAttestationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.deleteAtResourceGroup( - resourceGroupName, - attestationName - ); - console.log(result); -} - -deleteAttestationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteAttestationAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteAttestationAtSubscriptionScope.js deleted file mode 100644 index 706001185d3c..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteAttestationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Deletes an existing attestation at subscription scope. - * - * @summary Deletes an existing attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteSubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function deleteAttestationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.deleteAtSubscription(attestationName); - console.log(result); -} - -deleteAttestationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtIndividualResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtIndividualResourceScope.js deleted file mode 100644 index 17daeded1016..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Deletes an existing remediation at individual resource scope. - * - * @summary Deletes an existing remediation at individual resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function deleteRemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.deleteAtResource(resourceId, remediationName); - console.log(result); -} - -deleteRemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtManagementGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtManagementGroupScope.js deleted file mode 100644 index 81df6fcbffbd..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtManagementGroupScope.js +++ /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. -/** - * This sample demonstrates how to Deletes an existing remediation at management group scope. - * - * @summary Deletes an existing remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteManagementGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function deleteRemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.deleteAtManagementGroup( - managementGroupId, - remediationName - ); - console.log(result); -} - -deleteRemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtResourceGroupScope.js deleted file mode 100644 index 6f60573fa090..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtResourceGroupScope.js +++ /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. -/** - * This sample demonstrates how to Deletes an existing remediation at resource group scope. - * - * @summary Deletes an existing remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function deleteRemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.deleteAtResourceGroup( - resourceGroupName, - remediationName - ); - console.log(result); -} - -deleteRemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtSubscriptionScope.js deleted file mode 100644 index 01a9bcb6ad79..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/deleteRemediationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Deletes an existing remediation at subscription scope. - * - * @summary Deletes an existing remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteSubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function deleteRemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.deleteAtSubscription(remediationName); - console.log(result); -} - -deleteRemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndAggregateOnly.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndAggregateOnly.js deleted file mode 100644 index 0e9e03dc3ac7..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndAggregateOnly.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndAggregateOnly.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function filterAndAggregateOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const from = new Date("2019-10-05T18:00:00Z"); - const filter = "PolicyDefinitionAction eq 'deny'"; - const apply = "aggregate($count as NumDenyStates)"; - const options = { from: from, filter: filter, apply: apply }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -filterAndAggregateOnly().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndGroupWithAggregate.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndGroupWithAggregate.js deleted file mode 100644 index 921334f3011d..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndGroupWithAggregate.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndGroupByWithAggregate.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function filterAndGroupWithAggregate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 2; - const orderBy = "NumAuditDenyNonComplianceRecords desc"; - const from = new Date("2019-10-05T18:00:00Z"); - const filter = - "IsCompliant eq false and (PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny')"; - const apply = - "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumAuditDenyNonComplianceRecords))"; - const options = { - top: top, - orderBy: orderBy, - from: from, - filter: filter, - apply: apply, - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -filterAndGroupWithAggregate().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndGroupWithoutAggregate.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndGroupWithoutAggregate.js deleted file mode 100644 index 2af0d7cd82bb..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndGroupWithoutAggregate.js +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndGroupByWithoutAggregate.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function filterAndGroupWithoutAggregate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 2; - const from = new Date("2019-10-05T18:00:00Z"); - const filter = - "IsCompliant eq false and (PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append')"; - const apply = - "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId))"; - const options = { top: top, from: from, filter: filter, apply: apply }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -filterAndGroupWithoutAggregate().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndMultipleGroups.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndMultipleGroups.js deleted file mode 100644 index 461fc945fd95..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/filterAndMultipleGroups.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndMultipleGroups.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function filterAndMultipleGroups() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 10; - const orderBy = "NumNonCompliantResources desc"; - const filter = "IsCompliant eq false"; - const apply = - "groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId, ResourceId))/groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId), aggregate($count as NumNonCompliantResources))"; - const options = { top: top, orderBy: orderBy, filter: filter, apply: apply }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -filterAndMultipleGroups().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getASinglePolicyMetadataResource.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getASinglePolicyMetadataResource.js deleted file mode 100644 index c912cf0bfe55..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getASinglePolicyMetadataResource.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. -/** - * This sample demonstrates how to Get policy metadata resource. - * - * @summary Get policy metadata resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_GetResource.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function getASinglePolicyMetadataResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceName = "NIST_SP_800-53_R4_AC-2"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyMetadataOperations.getResource(resourceName); - console.log(result); -} - -getASinglePolicyMetadataResource().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getAttestationAtIndividualResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getAttestationAtIndividualResourceScope.js deleted file mode 100644 index 166307db521a..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getAttestationAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Gets an existing attestation at resource scope. - * - * @summary Gets an existing attestation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function getAttestationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.getAtResource(resourceId, attestationName); - console.log(result); -} - -getAttestationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getAttestationAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getAttestationAtResourceGroupScope.js deleted file mode 100644 index 65327a84b018..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getAttestationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Gets an existing attestation at resource group scope. - * - * @summary Gets an existing attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function getAttestationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.getAtResourceGroup(resourceGroupName, attestationName); - console.log(result); -} - -getAttestationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getAttestationAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getAttestationAtSubscriptionScope.js deleted file mode 100644 index b58d7b4857db..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getAttestationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Gets an existing attestation at subscription scope. - * - * @summary Gets an existing attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetSubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function getAttestationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.getAtSubscription(attestationName); - console.log(result); -} - -getAttestationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getCollectionOfPolicyMetadataResources.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getCollectionOfPolicyMetadataResources.js deleted file mode 100644 index f818917c4688..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getCollectionOfPolicyMetadataResources.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. -/** - * This sample demonstrates how to Get a list of the policy metadata resources. - * - * @summary Get a list of the policy metadata resources. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function getCollectionOfPolicyMetadataResources() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyMetadataOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getCollectionOfPolicyMetadataResources().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.js deleted file mode 100644 index 7a82d493b321..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.js +++ /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. -/** - * This sample demonstrates how to Get a list of the policy metadata resources. - * - * @summary Get a list of the policy metadata resources. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List_WithTop.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const top = 1; - const options = { top: top }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyMetadataOperations.list({ queryOptions: options })) { - resArray.push(item); - } - console.log(resArray); -} - -getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtIndividualResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtIndividualResourceScope.js deleted file mode 100644 index 4f2c98cce181..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Gets an existing remediation at resource scope. - * - * @summary Gets an existing remediation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function getRemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.getAtResource(resourceId, remediationName); - console.log(result); -} - -getRemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtManagementGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtManagementGroupScope.js deleted file mode 100644 index 2902037d2465..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtManagementGroupScope.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. -/** - * This sample demonstrates how to Gets an existing remediation at management group scope. - * - * @summary Gets an existing remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetManagementGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function getRemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.getAtManagementGroup(managementGroupId, remediationName); - console.log(result); -} - -getRemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtResourceGroupScope.js deleted file mode 100644 index 6b0bf5a8b277..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Gets an existing remediation at resource group scope. - * - * @summary Gets an existing remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function getRemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.getAtResourceGroup(resourceGroupName, remediationName); - console.log(result); -} - -getRemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtSubscriptionScope.js deleted file mode 100644 index 5e9df6a7bc95..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/getRemediationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Gets an existing remediation at subscription scope. - * - * @summary Gets an existing remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetSubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function getRemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.getAtSubscription(remediationName); - console.log(result); -} - -getRemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtIndividualResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtIndividualResourceScope.js deleted file mode 100644 index f0462d790bdb..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtIndividualResourceScope.js +++ /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. -/** - * This sample demonstrates how to Gets all attestations for a resource. - * - * @summary Gets all attestations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listAttestationsAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForResource(resourceId)) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtIndividualResourceScopeWithQueryParameters.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtIndividualResourceScopeWithQueryParameters.js deleted file mode 100644 index 6b3f6d393a87..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtIndividualResourceScopeWithQueryParameters.js +++ /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. -/** - * This sample demonstrates how to Gets all attestations for a resource. - * - * @summary Gets all attestations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope_WithQuery.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listAttestationsAtIndividualResourceScopeWithQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq '0b158b46-ff42-4799-8e39-08a5c23b4551'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForResource(resourceId, { - queryOptions: options, - })) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtIndividualResourceScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtResourceGroupScope.js deleted file mode 100644 index 1b9794307644..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtResourceGroupScope.js +++ /dev/null @@ -1,32 +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. -/** - * This sample demonstrates how to Gets all attestations for the resource group. - * - * @summary Gets all attestations for the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listAttestationsAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtResourceGroupScopeWithQueryParameters.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtResourceGroupScopeWithQueryParameters.js deleted file mode 100644 index 06a9347af80b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtResourceGroupScopeWithQueryParameters.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. -/** - * This sample demonstrates how to Gets all attestations for the resource group. - * - * @summary Gets all attestations for the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope_WithQuery.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listAttestationsAtResourceGroupScopeWithQueryParameters() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq '0b158b46-ff42-4799-8e39-08a5c23b4551'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForResourceGroup(resourceGroupName, { - queryOptions: options, - })) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtResourceGroupScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtSubscriptionScope.js deleted file mode 100644 index 7d91c6e5e209..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtSubscriptionScope.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. -/** - * This sample demonstrates how to Gets all attestations for the subscription. - * - * @summary Gets all attestations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listAttestationsAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForSubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtSubscriptionScopeWithQueryParameters.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtSubscriptionScopeWithQueryParameters.js deleted file mode 100644 index cfe80fffbd16..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listAttestationsAtSubscriptionScopeWithQueryParameters.js +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Gets all attestations for the subscription. - * - * @summary Gets all attestations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope_WithQuery.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listAttestationsAtSubscriptionScopeWithQueryParameters() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq '0b158b46-ff42-4799-8e39-08a5c23b4551'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForSubscription({ queryOptions: options })) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtSubscriptionScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtIndividualResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtIndividualResourceScope.js deleted file mode 100644 index a56689f0aa95..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Gets all deployments for a remediation at resource scope. - * - * @summary Gets all deployments for a remediation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listDeploymentsForARemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listDeploymentsAtResource( - resourceId, - remediationName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDeploymentsForARemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtManagementGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtManagementGroupScope.js deleted file mode 100644 index 231eee537011..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtManagementGroupScope.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. -/** - * This sample demonstrates how to Gets all deployments for a remediation at management group scope. - * - * @summary Gets all deployments for a remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsManagementGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listDeploymentsForARemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listDeploymentsAtManagementGroup( - managementGroupId, - remediationName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDeploymentsForARemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtResourceGroupScope.js deleted file mode 100644 index 801852244530..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Gets all deployments for a remediation at resource group scope. - * - * @summary Gets all deployments for a remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listDeploymentsForARemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listDeploymentsAtResourceGroup( - resourceGroupName, - remediationName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDeploymentsForARemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtSubscriptionScope.js deleted file mode 100644 index 8e8d5e511bae..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listDeploymentsForARemediationAtSubscriptionScope.js +++ /dev/null @@ -1,32 +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. -/** - * This sample demonstrates how to Gets all deployments for a remediation at subscription scope. - * - * @summary Gets all deployments for a remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsSubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listDeploymentsForARemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listDeploymentsAtSubscription(remediationName)) { - resArray.push(item); - } - console.log(resArray); -} - -listDeploymentsForARemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listOperations.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listOperations.js deleted file mode 100644 index b570c33eb1d4..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listOperations.js +++ /dev/null @@ -1,28 +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. -/** - * This sample demonstrates how to Lists available operations. - * - * @summary Lists available operations. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_ListOperations.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listOperations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.operations.list(); - console.log(result); -} - -listOperations().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtIndividualResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtIndividualResourceScope.js deleted file mode 100644 index 9d0a50c063a9..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtIndividualResourceScope.js +++ /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. -/** - * This sample demonstrates how to Gets all remediations for a resource. - * - * @summary Gets all remediations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listRemediationsAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForResource(resourceId)) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtIndividualResourceScopeWithQueryParameters.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtIndividualResourceScopeWithQueryParameters.js deleted file mode 100644 index 229322a2c76b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtIndividualResourceScopeWithQueryParameters.js +++ /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. -/** - * This sample demonstrates how to Gets all remediations for a resource. - * - * @summary Gets all remediations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope_WithQuery.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listRemediationsAtIndividualResourceScopeWithQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForResource(resourceId, { - queryOptions: options, - })) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtIndividualResourceScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtManagementGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtManagementGroupScope.js deleted file mode 100644 index 04d50bff4ba1..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtManagementGroupScope.js +++ /dev/null @@ -1,32 +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. -/** - * This sample demonstrates how to Gets all remediations for the management group. - * - * @summary Gets all remediations for the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listRemediationsAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForManagementGroup(managementGroupId)) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtManagementGroupScopeWithQueryParameters.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtManagementGroupScopeWithQueryParameters.js deleted file mode 100644 index d9873fa83335..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtManagementGroupScopeWithQueryParameters.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. -/** - * This sample demonstrates how to Gets all remediations for the management group. - * - * @summary Gets all remediations for the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope_WithQuery.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listRemediationsAtManagementGroupScopeWithQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForManagementGroup(managementGroupId, { - queryOptions: options, - })) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtManagementGroupScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtResourceGroupScope.js deleted file mode 100644 index 0fdb7858f48f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtResourceGroupScope.js +++ /dev/null @@ -1,32 +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. -/** - * This sample demonstrates how to Gets all remediations for the subscription. - * - * @summary Gets all remediations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listRemediationsAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtResourceGroupScopeWithQueryParameters.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtResourceGroupScopeWithQueryParameters.js deleted file mode 100644 index 7c327d07640f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtResourceGroupScopeWithQueryParameters.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. -/** - * This sample demonstrates how to Gets all remediations for the subscription. - * - * @summary Gets all remediations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope_WithQuery.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listRemediationsAtResourceGroupScopeWithQueryParameters() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForResourceGroup(resourceGroupName, { - queryOptions: options, - })) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtResourceGroupScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtSubscriptionScope.js deleted file mode 100644 index 0fd1b78f09a3..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtSubscriptionScope.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. -/** - * This sample demonstrates how to Gets all remediations for the subscription. - * - * @summary Gets all remediations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listRemediationsAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForSubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtSubscriptionScopeWithQueryParameters.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtSubscriptionScopeWithQueryParameters.js deleted file mode 100644 index 512ec592ac38..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/listRemediationsAtSubscriptionScopeWithQueryParameters.js +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Gets all remediations for the subscription. - * - * @summary Gets all remediations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope_WithQuery.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listRemediationsAtSubscriptionScopeWithQueryParameters() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq 'storageSkuDef'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForSubscription({ queryOptions: options })) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtSubscriptionScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForPolicyDefinitionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForPolicyDefinitionSample.js index d08130438397..3a7b62010407 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForPolicyDefinitionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForPolicyDefinitionSample.js @@ -20,14 +20,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function queryAtSubscriptionLevelPolicyDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForPolicyDefinition( policyEventsResource, - subscriptionId2, + subscriptionId, policyDefinitionName )) { resArray.push(item); @@ -46,7 +45,6 @@ queryAtSubscriptionLevelPolicyDefinitionScope().catch(console.error); async function queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const skipToken = "WpmWfBSvPhkAK6QD"; const options = { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForPolicySetDefinitionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForPolicySetDefinitionSample.js index 7710c68ce107..5b263252f41a 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForPolicySetDefinitionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForPolicySetDefinitionSample.js @@ -20,14 +20,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function queryAtSubscriptionLevelPolicySetDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForPolicySetDefinition( policyEventsResource, - subscriptionId2, + subscriptionId, policySetDefinitionName )) { resArray.push(item); @@ -46,7 +45,6 @@ queryAtSubscriptionLevelPolicySetDefinitionScope().catch(console.error); async function queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const skipToken = "WpmWfBSvPhkAK6QD"; const options = { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.js index 086b68e923e1..eb7dfa997938 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.js @@ -20,7 +20,6 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function queryAtResourceGroupLevelPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "myPolicyAssignment"; const credential = new DefaultAzureCredential(); @@ -28,7 +27,7 @@ async function queryAtResourceGroupLevelPolicyAssignmentScope() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment( policyEventsResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName )) { @@ -48,7 +47,6 @@ queryAtResourceGroupLevelPolicyAssignmentScope().catch(console.error); async function queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "myPolicyAssignment"; const skipToken = "WpmWfBSvPhkAK6QD"; @@ -60,7 +58,7 @@ async function queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment( policyEventsResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName, options diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForResourceGroupSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForResourceGroupSample.js index 7af60adc9db5..1622eb4fc68e 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForResourceGroupSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForResourceGroupSample.js @@ -20,14 +20,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function queryAtResourceGroupScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForResourceGroup( policyEventsResource, - subscriptionId2, + subscriptionId, resourceGroupName )) { resArray.push(item); @@ -46,7 +45,6 @@ queryAtResourceGroupScope().catch(console.error); async function queryAtResourceGroupScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const skipToken = "WpmWfBSvPhkAK6QD"; const options = { @@ -57,7 +55,7 @@ async function queryAtResourceGroupScopeWithNextLink() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForResourceGroup( policyEventsResource, - subscriptionId2, + subscriptionId, resourceGroupName, options )) { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.js index d066596a9326..6f9822afd84c 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.js @@ -20,14 +20,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function queryAtSubscriptionLevelPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment( policyEventsResource, - subscriptionId2, + subscriptionId, policyAssignmentName )) { resArray.push(item); @@ -46,7 +45,6 @@ queryAtSubscriptionLevelPolicyAssignmentScope().catch(console.error); async function queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const skipToken = "WpmWfBSvPhkAK6QD"; const options = { @@ -57,7 +55,7 @@ async function queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment( policyEventsResource, - subscriptionId2, + subscriptionId, policyAssignmentName, options )) { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForSubscriptionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForSubscriptionSample.js index 564a4e2b4f13..a865942deb1e 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForSubscriptionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyEventsListQueryResultsForSubscriptionSample.js @@ -20,7 +20,6 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function filterAndAggregateOnly() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const fromParam = new Date("2018-02-05T18:00:00Z"); const filter = "PolicyDefinitionAction eq 'deny'"; const apply = "aggregate($count as NumDenyEvents)"; @@ -32,7 +31,7 @@ async function filterAndAggregateOnly() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -51,7 +50,6 @@ filterAndAggregateOnly().catch(console.error); async function filterAndGroupWithAggregate() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const fromParam = new Date("2018-02-05T18:00:00Z"); const filter = "PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny'"; @@ -65,7 +63,7 @@ async function filterAndGroupWithAggregate() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -84,7 +82,6 @@ filterAndGroupWithAggregate().catch(console.error); async function filterAndGroupWithoutAggregate() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const fromParam = new Date("2018-01-05T18:00:00Z"); const filter = "PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append'"; @@ -98,7 +95,7 @@ async function filterAndGroupWithoutAggregate() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -117,7 +114,6 @@ filterAndGroupWithoutAggregate().catch(console.error); async function filterAndMultipleGroups() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 10; const orderBy = "NumDeniedResources desc"; const fromParam = new Date("2018-01-01T00:00:00Z"); @@ -132,7 +128,7 @@ async function filterAndMultipleGroups() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -151,13 +147,12 @@ filterAndMultipleGroups().catch(console.error); async function queryAtSubscriptionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2 + subscriptionId )) { resArray.push(item); } @@ -175,7 +170,6 @@ queryAtSubscriptionScope().catch(console.error); async function queryAtSubscriptionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const skipToken = "WpmWfBSvPhkAK6QD"; const options = { queryOptions: { skipToken: skipToken }, @@ -185,7 +179,7 @@ async function queryAtSubscriptionScopeWithNextLink() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -204,7 +198,6 @@ queryAtSubscriptionScopeWithNextLink().catch(console.error); async function timeRangeSortSelectAndLimit() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const orderBy = "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForPolicyDefinitionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForPolicyDefinitionSample.js index e9f1804b41a1..3fb648f9bb23 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForPolicyDefinitionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForPolicyDefinitionSample.js @@ -20,14 +20,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function queryLatestAtSubscriptionLevelPolicyDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForPolicyDefinition( policyStatesResource, - subscriptionId2, + subscriptionId, policyDefinitionName )) { resArray.push(item); @@ -46,7 +45,6 @@ queryLatestAtSubscriptionLevelPolicyDefinitionScope().catch(console.error); async function queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const skipToken = "WpmWfBSvPhkAK6QD"; const options = { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForPolicySetDefinitionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForPolicySetDefinitionSample.js index b3f1f797319f..d76fdb4eeeb3 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForPolicySetDefinitionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForPolicySetDefinitionSample.js @@ -20,14 +20,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function queryLatestAtSubscriptionLevelPolicySetDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForPolicySetDefinition( policyStatesResource, - subscriptionId2, + subscriptionId, policySetDefinitionName )) { resArray.push(item); @@ -46,7 +45,6 @@ queryLatestAtSubscriptionLevelPolicySetDefinitionScope().catch(console.error); async function queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const skipToken = "WpmWfBSvPhkAK6QD"; const options = { @@ -57,7 +55,7 @@ async function queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLin const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForPolicySetDefinition( policyStatesResource, - subscriptionId2, + subscriptionId, policySetDefinitionName, options )) { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.js index c2a4382715c6..9e18f41c8e9c 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.js @@ -20,7 +20,6 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function queryLatestAtResourceGroupLevelPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "myPolicyAssignment"; const credential = new DefaultAzureCredential(); @@ -28,7 +27,7 @@ async function queryLatestAtResourceGroupLevelPolicyAssignmentScope() { const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForResourceGroupLevelPolicyAssignment( policyStatesResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName )) { @@ -48,7 +47,6 @@ queryLatestAtResourceGroupLevelPolicyAssignmentScope().catch(console.error); async function queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "myPolicyAssignment"; const skipToken = "WpmWfBSvPhkAK6QD"; @@ -60,7 +58,7 @@ async function queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink( const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForResourceGroupLevelPolicyAssignment( policyStatesResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName, options diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForResourceGroupSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForResourceGroupSample.js index d0cb18a89c70..7b33aa90b3a7 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForResourceGroupSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForResourceGroupSample.js @@ -20,14 +20,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function queryLatestAtResourceGroupScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForResourceGroup( policyStatesResource, - subscriptionId2, + subscriptionId, resourceGroupName )) { resArray.push(item); @@ -46,7 +45,6 @@ queryLatestAtResourceGroupScope().catch(console.error); async function queryLatestAtResourceGroupScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const skipToken = "WpmWfBSvPhkAK6QD"; const options = { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.js index 83e3e28adcd6..062a6b1885b3 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.js @@ -20,14 +20,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function queryLatestAtSubscriptionLevelPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscriptionLevelPolicyAssignment( policyStatesResource, - subscriptionId2, + subscriptionId, policyAssignmentName )) { resArray.push(item); @@ -46,7 +45,6 @@ queryLatestAtSubscriptionLevelPolicyAssignmentScope().catch(console.error); async function queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const skipToken = "WpmWfBSvPhkAK6QD"; const options = { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForSubscriptionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForSubscriptionSample.js index 6bbe98ca241b..304f7fb583d1 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForSubscriptionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesListQueryResultsForSubscriptionSample.js @@ -20,7 +20,6 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function filterAndAggregateOnly() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const fromParam = new Date("2019-10-05T18:00:00Z"); const filter = "PolicyDefinitionAction eq 'deny'"; const apply = "aggregate($count as NumDenyStates)"; @@ -32,7 +31,7 @@ async function filterAndAggregateOnly() { const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscription( policyStatesResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -51,7 +50,6 @@ filterAndAggregateOnly().catch(console.error); async function filterAndGroupWithAggregate() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const orderBy = "NumAuditDenyNonComplianceRecords desc"; const fromParam = new Date("2019-10-05T18:00:00Z"); @@ -86,7 +84,6 @@ filterAndGroupWithAggregate().catch(console.error); async function filterAndGroupWithoutAggregate() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const fromParam = new Date("2019-10-05T18:00:00Z"); const filter = @@ -101,7 +98,7 @@ async function filterAndGroupWithoutAggregate() { const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscription( policyStatesResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -120,7 +117,6 @@ filterAndGroupWithoutAggregate().catch(console.error); async function filterAndMultipleGroups() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 10; const orderBy = "NumNonCompliantResources desc"; const filter = "IsCompliant eq false"; @@ -134,7 +130,7 @@ async function filterAndMultipleGroups() { const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscription( policyStatesResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -153,13 +149,12 @@ filterAndMultipleGroups().catch(console.error); async function queryLatestAtSubscriptionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscription( policyStatesResource, - subscriptionId2 + subscriptionId )) { resArray.push(item); } @@ -177,7 +172,6 @@ queryLatestAtSubscriptionScope().catch(console.error); async function queryLatestAtSubscriptionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const skipToken = "WpmWfBSvPhkAK6QD"; const options = { queryOptions: { skipToken: skipToken }, @@ -206,7 +200,6 @@ queryLatestAtSubscriptionScopeWithNextLink().catch(console.error); async function timeRangeSortSelectAndLimit() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const orderBy = "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForPolicyDefinitionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForPolicyDefinitionSample.js index c489b5a9b18d..5cdae1a5e875 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForPolicyDefinitionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForPolicyDefinitionSample.js @@ -20,13 +20,12 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function summarizeAtPolicyDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForPolicyDefinition( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, policyDefinitionName ); console.log(result); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForPolicySetDefinitionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForPolicySetDefinitionSample.js index 13cb566930f7..2d8d833e9a43 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForPolicySetDefinitionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForPolicySetDefinitionSample.js @@ -20,7 +20,6 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function summarizeAtPolicySetDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const top = 1; const fromParam = new Date("2019-10-05T18:00:00Z"); @@ -33,7 +32,7 @@ async function summarizeAtPolicySetDefinitionScope() { const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForPolicySetDefinition( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, policySetDefinitionName, options ); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.js index fcd0464a737b..47af9cb872a5 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.js @@ -20,14 +20,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function summarizeAtPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "b7a1ca2596524e3ab19597f2"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForResourceGroupLevelPolicyAssignment( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName ); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForResourceGroupSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForResourceGroupSample.js index c31b60785bbb..6fdeb193b990 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForResourceGroupSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForResourceGroupSample.js @@ -20,13 +20,12 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function summarizeAtResourceGroupScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForResourceGroup( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, resourceGroupName ); console.log(result); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.js index 62b77dfa960d..3247fafb474a 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.js @@ -20,13 +20,12 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function summarizeAtPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForSubscriptionLevelPolicyAssignment( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, policyAssignmentName ); console.log(result); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForSubscriptionSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForSubscriptionSample.js index 419826a03064..0bfe749401b3 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForSubscriptionSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesSummarizeForSubscriptionSample.js @@ -20,14 +20,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function summarizeAtSubscriptionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 5; const options = { queryOptions: { top: top } }; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForSubscription( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, options ); console.log(result); @@ -44,7 +43,6 @@ summarizeAtSubscriptionScope().catch(console.error); async function summarizeAtSubscriptionScopeForAPolicyDefinitionGroup() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 1; const filter = "'group1' IN PolicyDefinitionGroupNames"; const options = { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesTriggerResourceGroupEvaluationSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesTriggerResourceGroupEvaluationSample.js index 1b4658807c81..3f043cc5bba1 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesTriggerResourceGroupEvaluationSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesTriggerResourceGroupEvaluationSample.js @@ -19,12 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); */ async function triggerEvaluationsForAllResourcesInAResourceGroup() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.beginTriggerResourceGroupEvaluationAndWait( - subscriptionId2, + subscriptionId, resourceGroupName ); console.log(result); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesTriggerSubscriptionEvaluationSample.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesTriggerSubscriptionEvaluationSample.js index 2b640874542c..f16b509c82de 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesTriggerSubscriptionEvaluationSample.js +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/policyStatesTriggerSubscriptionEvaluationSample.js @@ -19,11 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); */ async function triggerEvaluationsForAllResourcesInASubscription() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.beginTriggerSubscriptionEvaluationAndWait( - subscriptionId2 + subscriptionId ); console.log(result); } diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtNestedResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtNestedResourceScope.js deleted file mode 100644 index 5828cd6809c1..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtNestedResourceScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryNestedResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAllPolicyStatesAtNestedResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtNestedResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtResourceScope.js deleted file mode 100644 index 768a83211a6f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtResourceScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAllPolicyStatesAtResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.js deleted file mode 100644 index 6fb81754d0b5..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const expand = "PolicyEvaluationDetails"; - const options = { expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtResourceScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtResourceScopeWithNextLink.js deleted file mode 100644 index 260a3a9318dc..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtResourceScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAllPolicyStatesAtResourceScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtResourceScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.js deleted file mode 100644 index 2f3eaa50335f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelNestedResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtSubscriptionLevelResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtSubscriptionLevelResourceScope.js deleted file mode 100644 index 83e78cd90d93..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAllPolicyStatesAtSubscriptionLevelResourceScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAllPolicyStatesAtSubscriptionLevelResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtSubscriptionLevelResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtManagementGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtManagementGroupScope.js deleted file mode 100644 index 654f332ae665..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtManagementGroupScope.js +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Queries policy events for the resources under the management group. - * - * @summary Queries policy events for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupName = "myManagementGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForManagementGroup( - "default", - managementGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtManagementGroupScopeUsingQueryParameters.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtManagementGroupScopeUsingQueryParameters.js deleted file mode 100644 index d330eb484116..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtManagementGroupScopeUsingQueryParameters.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. -/** - * This sample demonstrates how to Queries policy tracked resources under the management group. - * - * @summary Queries policy tracked resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryManagementGroupScopeWithFilterAndTop.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtManagementGroupScopeUsingQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupName = "myManagementGroup"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyTrackedResources.listQueryResultsForManagementGroup( - managementGroupName, - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtManagementGroupScopeUsingQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtManagementGroupScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtManagementGroupScopeWithNextLink.js deleted file mode 100644 index 3e131644523c..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtManagementGroupScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the resources under the management group. - * - * @summary Queries policy events for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtManagementGroupScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupName = "myManagementGroup"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForManagementGroup( - managementGroupName, - "", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtManagementGroupScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtNestedResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtNestedResourceScope.js deleted file mode 100644 index 805ffd0946d3..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtNestedResourceScope.js +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryNestedResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtNestedResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource("default", resourceId)) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtNestedResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupLevelPolicyAssignmentScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupLevelPolicyAssignmentScope.js deleted file mode 100644 index dc33af403396..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupLevelPolicyAssignmentScope.js +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource group level policy assignment. - * - * @summary Queries policy events for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtResourceGroupLevelPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "myPolicyAssignment"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment( - "default", - subscriptionId2, - resourceGroupName, - policyAssignmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupLevelPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.js deleted file mode 100644 index 9a676ab9dc07..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the resource group level policy assignment. - * - * @summary Queries policy events for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "myPolicyAssignment"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment( - "default", - subscriptionId2, - resourceGroupName, - policyAssignmentName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupScope.js deleted file mode 100644 index 58f338400d94..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupScope.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. -/** - * This sample demonstrates how to Queries policy events for the resources under the resource group. - * - * @summary Queries policy events for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResourceGroup( - "default", - subscriptionId2, - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupScopeUsingQueryParameters.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupScopeUsingQueryParameters.js deleted file mode 100644 index 99cb9460269b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupScopeUsingQueryParameters.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. -/** - * This sample demonstrates how to Queries policy tracked resources under the resource group. - * - * @summary Queries policy tracked resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceGroupScopeWithFilterAndTop.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtResourceGroupScopeUsingQueryParameters() { - const subscriptionId = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource/nestedResourceType/TrackedResource1'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyTrackedResources.listQueryResultsForResourceGroup( - resourceGroupName, - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupScopeUsingQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupScopeWithNextLink.js deleted file mode 100644 index 7c41e25a9380..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceGroupScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the resources under the resource group. - * - * @summary Queries policy events for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtResourceGroupScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResourceGroup( - "default", - subscriptionId2, - resourceGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceScope.js deleted file mode 100644 index e30e199d4d53..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceScope.js +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource("default", resourceId)) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceScopeUsingQueryParameters.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceScopeUsingQueryParameters.js deleted file mode 100644 index 1408ab5c13f7..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceScopeUsingQueryParameters.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. -/** - * This sample demonstrates how to Queries policy tracked resources under the resource. - * - * @summary Queries policy tracked resources under the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceScopeWithFilterAndTop.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtResourceScopeUsingQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource/nestedResourceType/TrackedResource1'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyTrackedResources.listQueryResultsForResource( - resourceId, - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceScopeUsingQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceScopeWithNextLink.js deleted file mode 100644 index 5c5f4b9c5945..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtResourceScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtResourceScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource(resourceId, "default", { - queryOptions: options, - })) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelNestedResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelNestedResourceScope.js deleted file mode 100644 index 8cd61d5be2b0..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelNestedResourceScope.js +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelNestedResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtSubscriptionLevelNestedResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource(resourceId, "default")) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelNestedResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyAssignmentScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyAssignmentScope.js deleted file mode 100644 index 7910f62652b7..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyAssignmentScope.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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy assignment. - * - * @summary Queries policy events for the subscription level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtSubscriptionLevelPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment( - "default", - subscriptionId2, - policyAssignmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.js deleted file mode 100644 index 1df558e6c11f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy assignment. - * - * @summary Queries policy events for the subscription level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment( - "default", - subscriptionId2, - policyAssignmentName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyDefinitionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyDefinitionScope.js deleted file mode 100644 index edf95845cb6b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyDefinitionScope.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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy definition. - * - * @summary Queries policy events for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtSubscriptionLevelPolicyDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForPolicyDefinition( - "default", - subscriptionId2, - policyDefinitionName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicyDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.js deleted file mode 100644 index 00ea0c12a085..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy definition. - * - * @summary Queries policy events for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForPolicyDefinition( - "default", - subscriptionId2, - policyDefinitionName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicySetDefinitionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicySetDefinitionScope.js deleted file mode 100644 index b17efe5f5573..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicySetDefinitionScope.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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy set definition. - * - * @summary Queries policy events for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtSubscriptionLevelPolicySetDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForPolicySetDefinition( - "deault", - subscriptionId2, - policySetDefinitionName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicySetDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.js deleted file mode 100644 index c60a17809691..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy set definition. - * - * @summary Queries policy events for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForPolicySetDefinition( - "default", - subscriptionId2, - policySetDefinitionName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelResourceScope.js deleted file mode 100644 index 8f90f63c346e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionLevelResourceScope.js +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtSubscriptionLevelResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource("default", resourceId)) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionScope.js deleted file mode 100644 index eb1c595239ea..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionScope.js +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Queries policy events for the resources under the subscription. - * - * @summary Queries policy events for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForSubscription( - "default", - subscriptionId2 - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionScopeUsingQueryParameters.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionScopeUsingQueryParameters.js deleted file mode 100644 index c7e00225378f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionScopeUsingQueryParameters.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. -/** - * This sample demonstrates how to Queries policy tracked resources under the subscription. - * - * @summary Queries policy tracked resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QuerySubscriptionScopeWithFilterAndTop.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtSubscriptionScopeUsingQueryParameters() { - const subscriptionId = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyTrackedResources.listQueryResultsForSubscription("default", { - queryOptions: options, - })) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionScopeUsingQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionScopeWithNextLink.js deleted file mode 100644 index 1021075e89c6..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryAtSubscriptionScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the resources under the subscription. - * - * @summary Queries policy events for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryAtSubscriptionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForSubscription( - "default", - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.js deleted file mode 100644 index 0a4bfce4f3ce..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandComponents.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const resourceId = - "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName"; - const filter = - "policyAssignmentId eq '/subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/providers/microsoft.authorization/policyassignments/560050f83dbb4a24974323f8'"; - const expand = - "components($filter=ComplianceState eq 'NonCompliant' or ComplianceState eq 'Compliant')"; - const options = { filter: filter, expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.js deleted file mode 100644 index e5c5e7361d54..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.js +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandComponentsGroupByWithAggregate.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const resourceId = - "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName"; - const filter = - "policyAssignmentId eq '/subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/providers/microsoft.authorization/policyassignments/560050f83dbb4a24974323f8'"; - const expand = - "components($filter=ComplianceState eq 'NonCompliant' or ComplianceState eq 'Compliant';$apply=groupby((complianceState),aggregate($count as count)))"; - const options = { filter: filter, expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.js deleted file mode 100644 index b03ed4c8fa7a..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeExpandComponentsGroupByWithAggregate.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName"; - const filter = - "policyAssignmentId eq '/subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/providers/microsoft.authorization/policyassignments/560050f83dbb4a24974323f8'"; - const expand = - "components($apply=groupby((tenantId, principalOid, policyDefinitionAction), aggregate($count as totalActions)))"; - const options = { filter: filter, expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource("default", resourceId, { - queryOptions: options, - })) { - resArray.push(item); - } - console.log(resArray); -} - -queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.js deleted file mode 100644 index 3455cec48f8c..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.js +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeExpandComponents.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName"; - const filter = - "policyAssignmentId eq '/subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/providers/microsoft.authorization/policyassignments/560050f83dbb4a24974323f8'"; - const expand = "components"; - const options = { filter: filter, expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource("default", resourceId, { - queryOptions: options, - })) { - resArray.push(item); - } - console.log(resArray); -} - -queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtManagementGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtManagementGroupScope.js deleted file mode 100644 index 98e1853af2eb..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtManagementGroupScope.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the management group. - * - * @summary Queries policy states for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const managementGroupName = "myManagementGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForManagementGroup( - policyStatesResource, - managementGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtManagementGroupScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtManagementGroupScopeWithNextLink.js deleted file mode 100644 index 57402669915e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtManagementGroupScopeWithNextLink.js +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the management group. - * - * @summary Queries policy states for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtManagementGroupScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const managementGroupName = "myManagementGroup"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForManagementGroup( - policyStatesResource, - managementGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtManagementGroupScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupLevelPolicyAssignmentScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupLevelPolicyAssignmentScope.js deleted file mode 100644 index e6ba99021361..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupLevelPolicyAssignmentScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource group level policy assignment. - * - * @summary Queries policy states for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtResourceGroupLevelPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "myPolicyAssignment"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResourceGroupLevelPolicyAssignment( - policyStatesResource, - subscriptionId2, - resourceGroupName, - policyAssignmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtResourceGroupLevelPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.js deleted file mode 100644 index 2a583c445c93..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resource group level policy assignment. - * - * @summary Queries policy states for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "myPolicyAssignment"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResourceGroupLevelPolicyAssignment( - policyStatesResource, - subscriptionId2, - resourceGroupName, - policyAssignmentName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupScope.js deleted file mode 100644 index ebb8d2f64645..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupScope.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the resource group. - * - * @summary Queries policy states for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResourceGroup( - policyStatesResource, - subscriptionId2, - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupScopeWithNextLink.js deleted file mode 100644 index 46604625b6e4..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtResourceGroupScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the resource group. - * - * @summary Queries policy states for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtResourceGroupScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResourceGroup( - policyStatesResource, - subscriptionId2, - resourceGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtResourceGroupScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyAssignmentScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyAssignmentScope.js deleted file mode 100644 index ca48d829957a..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyAssignmentScope.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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy assignment. - * - * @summary Queries policy states for the subscription level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtSubscriptionLevelPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscriptionLevelPolicyAssignment( - policyStatesResource, - subscriptionId2, - policyAssignmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.js deleted file mode 100644 index 9e0dbbd012e2..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy assignment. - * - * @summary Queries policy states for the subscription level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscriptionLevelPolicyAssignment( - policyStatesResource, - subscriptionId2, - policyAssignmentName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyDefinitionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyDefinitionScope.js deleted file mode 100644 index a6c27678123f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyDefinitionScope.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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy definition. - * - * @summary Queries policy states for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtSubscriptionLevelPolicyDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForPolicyDefinition( - policyStatesResource, - subscriptionId2, - policyDefinitionName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicyDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.js deleted file mode 100644 index 02fbb7debe57..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy definition. - * - * @summary Queries policy states for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForPolicyDefinition( - policyStatesResource, - subscriptionId2, - policyDefinitionName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicySetDefinitionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicySetDefinitionScope.js deleted file mode 100644 index c4f9ce84f62f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicySetDefinitionScope.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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy set definition. - * - * @summary Queries policy states for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtSubscriptionLevelPolicySetDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForPolicySetDefinition( - policyStatesResource, - subscriptionId2, - policySetDefinitionName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicySetDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.js deleted file mode 100644 index b77169ac1201..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy set definition. - * - * @summary Queries policy states for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForPolicySetDefinition( - policyStatesResource, - subscriptionId2, - policySetDefinitionName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionScope.js deleted file mode 100644 index 855638834090..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionScope.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2 - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionScopeWithNextLink.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionScopeWithNextLink.js deleted file mode 100644 index 1e39ea4abb10..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/queryLatestAtSubscriptionScopeWithNextLink.js +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionScopeNextLink.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function queryLatestAtSubscriptionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtManagementGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtManagementGroupScope.js deleted file mode 100644 index ec508d917c22..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtManagementGroupScope.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. -/** - * This sample demonstrates how to Summarizes policy states for the resources under the management group. - * - * @summary Summarizes policy states for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeManagementGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function summarizeAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupName = "myManagementGroup"; - const top = 0; - const from = new Date("2019-10-05T18:00:00Z"); - const to = new Date("2019-10-06T18:00:00Z"); - const filter = "PolicyDefinitionAction eq 'deny' or PolicyDefinitionAction eq 'audit'"; - const options = { top: top, from: from, to: to, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForManagementGroup( - "latest", - managementGroupName, - { queryOptions: options } - ); - console.log(result); -} - -summarizeAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtPolicyAssignmentScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtPolicyAssignmentScope.js deleted file mode 100644 index 17f7d7760c3f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtPolicyAssignmentScope.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. -/** - * This sample demonstrates how to Summarizes policy states for the resource group level policy assignment. - * - * @summary Summarizes policy states for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function summarizeAtPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "b7a1ca2596524e3ab19597f2"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForResourceGroupLevelPolicyAssignment( - "latest", - subscriptionId, - resourceGroupName, - policyAssignmentName - ); - console.log(result); -} - -summarizeAtPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtPolicyDefinitionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtPolicyDefinitionScope.js deleted file mode 100644 index 3f85d2c06c8b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtPolicyDefinitionScope.js +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Summarizes policy states for the subscription level policy definition. - * - * @summary Summarizes policy states for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function summarizeAtPolicyDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForPolicyDefinition( - "", - subscriptionId2, - policyDefinitionName - ); - console.log(result); -} - -summarizeAtPolicyDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtPolicySetDefinitionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtPolicySetDefinitionScope.js deleted file mode 100644 index 9136a6a81e24..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtPolicySetDefinitionScope.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. -/** - * This sample demonstrates how to Summarizes policy states for the subscription level policy set definition. - * - * @summary Summarizes policy states for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function summarizeAtPolicySetDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const top = 1; - const from = new Date("2019-10-05T18:00:00Z"); - const to = new Date("2019-10-06T18:00:00Z"); - const filter = "PolicyDefinitionAction eq 'deny'"; - const options = { top: top, from: from, to: to, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForPolicySetDefinition( - "latest", - subscriptionId2, - policySetDefinitionName, - { queryOptions: options } - ); - console.log(result); -} - -summarizeAtPolicySetDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtResourceGroupScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtResourceGroupScope.js deleted file mode 100644 index dffb7810d557..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtResourceGroupScope.js +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Summarizes policy states for the resources under the resource group. - * - * @summary Summarizes policy states for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function summarizeAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForResourceGroup( - "latest", - subscriptionId2, - resourceGroupName - ); - console.log(result); -} - -summarizeAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtResourceScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtResourceScope.js deleted file mode 100644 index e0b8f095a839..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtResourceScope.js +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Summarizes policy states for the resource. - * - * @summary Summarizes policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function summarizeAtResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault"; - const top = 2; - const options = { top: top }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForResource("latest", resourceId, { - queryOptions: options, - }); - console.log(result); -} - -summarizeAtResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtSubscriptionScope.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtSubscriptionScope.js deleted file mode 100644 index 99af16225cf7..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtSubscriptionScope.js +++ /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. -/** - * This sample demonstrates how to Summarizes policy states for the resources under the subscription. - * - * @summary Summarizes policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScope.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function summarizeAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 5; - const options = { top: top }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForSubscription("latest", subscriptionId2, { - queryOptions: options, - }); - console.log(result); -} - -summarizeAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.js deleted file mode 100644 index c2932939fd34..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.js +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Summarizes policy states for the resources under the subscription. - * - * @summary Summarizes policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScopeForPolicyGroup.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function summarizeAtSubscriptionScopeForAPolicyDefinitionGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 1; - const filter = "'group1' IN PolicyDefinitionGroupNames"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForSubscription("latest", subscriptionId2, { - queryOptions: options, - }); - console.log(result); -} - -summarizeAtSubscriptionScopeForAPolicyDefinitionGroup().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/timeRangeSortSelectAndLimit.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/timeRangeSortSelectAndLimit.js deleted file mode 100644 index f6854fb42606..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/timeRangeSortSelectAndLimit.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TimeRangeSortSelectTop.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function timeRangeSortSelectAndLimit() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 2; - const orderBy = - "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId"; - const select = - "Timestamp, PolicyAssignmentId, PolicyDefinitionId, SubscriptionId, ResourceGroup, ResourceId, policyDefinitionGroupNames"; - const from = new Date("2019-10-05T18:00:00Z"); - const to = new Date("2019-10-06T18:00:00Z"); - const options = { - top: top, - orderBy: orderBy, - select: select, - from: from, - to: to, - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -timeRangeSortSelectAndLimit().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/triggerEvaluationsForAllResourcesInAResourceGroup.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/triggerEvaluationsForAllResourcesInAResourceGroup.js deleted file mode 100644 index d9a69c06048b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/triggerEvaluationsForAllResourcesInAResourceGroup.js +++ /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. -/** - * This sample demonstrates how to Triggers a policy evaluation scan for all the resources under the resource group. - * - * @summary Triggers a policy evaluation scan for all the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function triggerEvaluationsForAllResourcesInAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.beginTriggerResourceGroupEvaluationAndWait( - subscriptionId2, - resourceGroupName - ); - console.log(result); -} - -triggerEvaluationsForAllResourcesInAResourceGroup().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/triggerEvaluationsForAllResourcesInASubscription.js b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/triggerEvaluationsForAllResourcesInASubscription.js deleted file mode 100644 index db8dadcf2f44..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/javascript/triggerEvaluationsForAllResourcesInASubscription.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. -/** - * This sample demonstrates how to Triggers a policy evaluation scan for all the resources under the subscription - * - * @summary Triggers a policy evaluation scan for all the resources under the subscription - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json - */ -const { PolicyInsightsClient } = require("@azure/arm-policyinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function triggerEvaluationsForAllResourcesInASubscription() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.beginTriggerSubscriptionEvaluationAndWait( - subscriptionId2 - ); - console.log(result); -} - -triggerEvaluationsForAllResourcesInASubscription().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/README.md b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/README.md index 67b8a2ea3904..1d3db68b6cfc 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/README.md +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/README.md @@ -2,193 +2,80 @@ These sample programs show how to use the TypeScript client libraries for in some common scenarios. -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [attestationsCreateOrUpdateAtResourceGroupSample.ts][attestationscreateorupdateatresourcegroupsample] | Creates or updates an attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceGroupScope.json | -| [attestationsCreateOrUpdateAtResourceSample.ts][attestationscreateorupdateatresourcesample] | Creates or updates an attestation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceScope.json | -| [attestationsCreateOrUpdateAtSubscriptionSample.ts][attestationscreateorupdateatsubscriptionsample] | Creates or updates an attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope.json | -| [attestationsDeleteAtResourceGroupSample.ts][attestationsdeleteatresourcegroupsample] | Deletes an existing attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceGroupScope.json | -| [attestationsDeleteAtResourceSample.ts][attestationsdeleteatresourcesample] | Deletes an existing attestation at individual resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceScope.json | -| [attestationsDeleteAtSubscriptionSample.ts][attestationsdeleteatsubscriptionsample] | Deletes an existing attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteSubscriptionScope.json | -| [attestationsGetAtResourceGroupSample.ts][attestationsgetatresourcegroupsample] | Gets an existing attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceGroupScope.json | -| [attestationsGetAtResourceSample.ts][attestationsgetatresourcesample] | Gets an existing attestation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceScope.json | -| [attestationsGetAtSubscriptionSample.ts][attestationsgetatsubscriptionsample] | Gets an existing attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetSubscriptionScope.json | -| [attestationsListForResourceGroupSample.ts][attestationslistforresourcegroupsample] | Gets all attestations for the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope.json | -| [attestationsListForResourceSample.ts][attestationslistforresourcesample] | Gets all attestations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope.json | -| [attestationsListForSubscriptionSample.ts][attestationslistforsubscriptionsample] | Gets all attestations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope.json | -| [cancelARemediationAtIndividualResourceScope.ts][cancelaremediationatindividualresourcescope] | Cancel a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceScope.json | -| [cancelARemediationAtManagementGroupScope.ts][cancelaremediationatmanagementgroupscope] | Cancels a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelManagementGroupScope.json | -| [cancelARemediationAtResourceGroupScope.ts][cancelaremediationatresourcegroupscope] | Cancels a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceGroupScope.json | -| [cancelARemediationAtSubscriptionScope.ts][cancelaremediationatsubscriptionscope] | Cancels a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelSubscriptionScope.json | -| [checkPolicyRestrictionsAtResourceGroupScope.ts][checkpolicyrestrictionsatresourcegroupscope] | Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json | -| [checkPolicyRestrictionsAtSubscriptionScope.ts][checkpolicyrestrictionsatsubscriptionscope] | Checks what restrictions Azure Policy will place on a resource within a subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json | -| [createAttestationAtIndividualResourceScope.ts][createattestationatindividualresourcescope] | Creates or updates an attestation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceScope.json | -| [createAttestationAtResourceGroupScope.ts][createattestationatresourcegroupscope] | Creates or updates an attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceGroupScope.json | -| [createAttestationAtSubscriptionScope.ts][createattestationatsubscriptionscope] | Creates or updates an attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope.json | -| [createAttestationAtSubscriptionScopeWithAllProperties.ts][createattestationatsubscriptionscopewithallproperties] | Creates or updates an attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json | -| [createRemediationAtIndividualResourceScope.ts][createremediationatindividualresourcescope] | Creates or updates a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceScope.json | -| [createRemediationAtManagementGroupScope.ts][createremediationatmanagementgroupscope] | Creates or updates a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateManagementGroupScope.json | -| [createRemediationAtResourceGroupScope.ts][createremediationatresourcegroupscope] | Creates or updates a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceGroupScope.json | -| [createRemediationAtSubscriptionScope.ts][createremediationatsubscriptionscope] | Creates or updates a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json | -| [createRemediationAtSubscriptionScopeWithAllProperties.ts][createremediationatsubscriptionscopewithallproperties] | Creates or updates a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope_AllProperties.json | -| [deleteAttestationAtIndividualResourceScope.ts][deleteattestationatindividualresourcescope] | Deletes an existing attestation at individual resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceScope.json | -| [deleteAttestationAtResourceGroupScope.ts][deleteattestationatresourcegroupscope] | Deletes an existing attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceGroupScope.json | -| [deleteAttestationAtSubscriptionScope.ts][deleteattestationatsubscriptionscope] | Deletes an existing attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteSubscriptionScope.json | -| [deleteRemediationAtIndividualResourceScope.ts][deleteremediationatindividualresourcescope] | Deletes an existing remediation at individual resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceScope.json | -| [deleteRemediationAtManagementGroupScope.ts][deleteremediationatmanagementgroupscope] | Deletes an existing remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteManagementGroupScope.json | -| [deleteRemediationAtResourceGroupScope.ts][deleteremediationatresourcegroupscope] | Deletes an existing remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceGroupScope.json | -| [deleteRemediationAtSubscriptionScope.ts][deleteremediationatsubscriptionscope] | Deletes an existing remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteSubscriptionScope.json | -| [filterAndAggregateOnly.ts][filterandaggregateonly] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndAggregateOnly.json | -| [filterAndGroupWithAggregate.ts][filterandgroupwithaggregate] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndGroupByWithAggregate.json | -| [filterAndGroupWithoutAggregate.ts][filterandgroupwithoutaggregate] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndGroupByWithoutAggregate.json | -| [filterAndMultipleGroups.ts][filterandmultiplegroups] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndMultipleGroups.json | -| [getASinglePolicyMetadataResource.ts][getasinglepolicymetadataresource] | Get policy metadata resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_GetResource.json | -| [getAttestationAtIndividualResourceScope.ts][getattestationatindividualresourcescope] | Gets an existing attestation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceScope.json | -| [getAttestationAtResourceGroupScope.ts][getattestationatresourcegroupscope] | Gets an existing attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceGroupScope.json | -| [getAttestationAtSubscriptionScope.ts][getattestationatsubscriptionscope] | Gets an existing attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetSubscriptionScope.json | -| [getCollectionOfPolicyMetadataResources.ts][getcollectionofpolicymetadataresources] | Get a list of the policy metadata resources. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List.json | -| [getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.ts][getcollectionofpolicymetadataresourcesusingtopqueryparameter] | Get a list of the policy metadata resources. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List_WithTop.json | -| [getRemediationAtIndividualResourceScope.ts][getremediationatindividualresourcescope] | Gets an existing remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceScope.json | -| [getRemediationAtManagementGroupScope.ts][getremediationatmanagementgroupscope] | Gets an existing remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetManagementGroupScope.json | -| [getRemediationAtResourceGroupScope.ts][getremediationatresourcegroupscope] | Gets an existing remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceGroupScope.json | -| [getRemediationAtSubscriptionScope.ts][getremediationatsubscriptionscope] | Gets an existing remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetSubscriptionScope.json | -| [listAttestationsAtIndividualResourceScope.ts][listattestationsatindividualresourcescope] | Gets all attestations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope.json | -| [listAttestationsAtIndividualResourceScopeWithQueryParameters.ts][listattestationsatindividualresourcescopewithqueryparameters] | Gets all attestations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope_WithQuery.json | -| [listAttestationsAtResourceGroupScope.ts][listattestationsatresourcegroupscope] | Gets all attestations for the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope.json | -| [listAttestationsAtResourceGroupScopeWithQueryParameters.ts][listattestationsatresourcegroupscopewithqueryparameters] | Gets all attestations for the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope_WithQuery.json | -| [listAttestationsAtSubscriptionScope.ts][listattestationsatsubscriptionscope] | Gets all attestations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope.json | -| [listAttestationsAtSubscriptionScopeWithQueryParameters.ts][listattestationsatsubscriptionscopewithqueryparameters] | Gets all attestations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope_WithQuery.json | -| [listDeploymentsForARemediationAtIndividualResourceScope.ts][listdeploymentsforaremediationatindividualresourcescope] | Gets all deployments for a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceScope.json | -| [listDeploymentsForARemediationAtManagementGroupScope.ts][listdeploymentsforaremediationatmanagementgroupscope] | Gets all deployments for a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsManagementGroupScope.json | -| [listDeploymentsForARemediationAtResourceGroupScope.ts][listdeploymentsforaremediationatresourcegroupscope] | Gets all deployments for a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json | -| [listDeploymentsForARemediationAtSubscriptionScope.ts][listdeploymentsforaremediationatsubscriptionscope] | Gets all deployments for a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsSubscriptionScope.json | -| [listOperations.ts][listoperations] | Lists available operations. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_ListOperations.json | -| [listRemediationsAtIndividualResourceScope.ts][listremediationsatindividualresourcescope] | Gets all remediations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope.json | -| [listRemediationsAtIndividualResourceScopeWithQueryParameters.ts][listremediationsatindividualresourcescopewithqueryparameters] | Gets all remediations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope_WithQuery.json | -| [listRemediationsAtManagementGroupScope.ts][listremediationsatmanagementgroupscope] | Gets all remediations for the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope.json | -| [listRemediationsAtManagementGroupScopeWithQueryParameters.ts][listremediationsatmanagementgroupscopewithqueryparameters] | Gets all remediations for the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope_WithQuery.json | -| [listRemediationsAtResourceGroupScope.ts][listremediationsatresourcegroupscope] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope.json | -| [listRemediationsAtResourceGroupScopeWithQueryParameters.ts][listremediationsatresourcegroupscopewithqueryparameters] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope_WithQuery.json | -| [listRemediationsAtSubscriptionScope.ts][listremediationsatsubscriptionscope] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope.json | -| [listRemediationsAtSubscriptionScopeWithQueryParameters.ts][listremediationsatsubscriptionscopewithqueryparameters] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope_WithQuery.json | -| [operationsListSample.ts][operationslistsample] | Lists available operations. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_ListOperations.json | -| [policyEventsListQueryResultsForManagementGroupSample.ts][policyeventslistqueryresultsformanagementgroupsample] | Queries policy events for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScope.json | -| [policyEventsListQueryResultsForPolicyDefinitionSample.ts][policyeventslistqueryresultsforpolicydefinitionsample] | Queries policy events for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScope.json | -| [policyEventsListQueryResultsForPolicySetDefinitionSample.ts][policyeventslistqueryresultsforpolicysetdefinitionsample] | Queries policy events for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScope.json | -| [policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts][policyeventslistqueryresultsforresourcegrouplevelpolicyassignmentsample] | Queries policy events for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScope.json | -| [policyEventsListQueryResultsForResourceGroupSample.ts][policyeventslistqueryresultsforresourcegroupsample] | Queries policy events for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScope.json | -| [policyEventsListQueryResultsForResourceSample.ts][policyeventslistqueryresultsforresourcesample] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryNestedResourceScope.json | -| [policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts][policyeventslistqueryresultsforsubscriptionlevelpolicyassignmentsample] | Queries policy events for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScope.json | -| [policyEventsListQueryResultsForSubscriptionSample.ts][policyeventslistqueryresultsforsubscriptionsample] | Queries policy events for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_FilterAndAggregateOnly.json | -| [policyMetadataGetResourceSample.ts][policymetadatagetresourcesample] | Get policy metadata resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_GetResource.json | -| [policyMetadataListSample.ts][policymetadatalistsample] | Get a list of the policy metadata resources. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List.json | -| [policyRestrictionsCheckAtManagementGroupScopeSample.ts][policyrestrictionscheckatmanagementgroupscopesample] | Checks what restrictions Azure Policy will place on resources within a management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtManagementGroupScope.json | -| [policyRestrictionsCheckAtResourceGroupScopeSample.ts][policyrestrictionscheckatresourcegroupscopesample] | Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json | -| [policyRestrictionsCheckAtSubscriptionScopeSample.ts][policyrestrictionscheckatsubscriptionscopesample] | Checks what restrictions Azure Policy will place on a resource within a subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json | -| [policyStatesListQueryResultsForManagementGroupSample.ts][policystateslistqueryresultsformanagementgroupsample] | Queries policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScope.json | -| [policyStatesListQueryResultsForPolicyDefinitionSample.ts][policystateslistqueryresultsforpolicydefinitionsample] | Queries policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json | -| [policyStatesListQueryResultsForPolicySetDefinitionSample.ts][policystateslistqueryresultsforpolicysetdefinitionsample] | Queries policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json | -| [policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts][policystateslistqueryresultsforresourcegrouplevelpolicyassignmentsample] | Queries policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json | -| [policyStatesListQueryResultsForResourceGroupSample.ts][policystateslistqueryresultsforresourcegroupsample] | Queries policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScope.json | -| [policyStatesListQueryResultsForResourceSample.ts][policystateslistqueryresultsforresourcesample] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryNestedResourceScope.json | -| [policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts][policystateslistqueryresultsforsubscriptionlevelpolicyassignmentsample] | Queries policy states for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json | -| [policyStatesListQueryResultsForSubscriptionSample.ts][policystateslistqueryresultsforsubscriptionsample] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndAggregateOnly.json | -| [policyStatesSummarizeForManagementGroupSample.ts][policystatessummarizeformanagementgroupsample] | Summarizes policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeManagementGroupScope.json | -| [policyStatesSummarizeForPolicyDefinitionSample.ts][policystatessummarizeforpolicydefinitionsample] | Summarizes policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json | -| [policyStatesSummarizeForPolicySetDefinitionSample.ts][policystatessummarizeforpolicysetdefinitionsample] | Summarizes policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json | -| [policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.ts][policystatessummarizeforresourcegrouplevelpolicyassignmentsample] | Summarizes policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json | -| [policyStatesSummarizeForResourceGroupSample.ts][policystatessummarizeforresourcegroupsample] | Summarizes policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupScope.json | -| [policyStatesSummarizeForResourceSample.ts][policystatessummarizeforresourcesample] | Summarizes policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceScope.json | -| [policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.ts][policystatessummarizeforsubscriptionlevelpolicyassignmentsample] | Summarizes policy states for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyAssignmentScope.json | -| [policyStatesSummarizeForSubscriptionSample.ts][policystatessummarizeforsubscriptionsample] | Summarizes policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScope.json | -| [policyStatesTriggerResourceGroupEvaluationSample.ts][policystatestriggerresourcegroupevaluationsample] | Triggers a policy evaluation scan for all the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json | -| [policyStatesTriggerSubscriptionEvaluationSample.ts][policystatestriggersubscriptionevaluationsample] | Triggers a policy evaluation scan for all the resources under the subscription x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json | -| [policyTrackedResourcesListQueryResultsForManagementGroupSample.ts][policytrackedresourceslistqueryresultsformanagementgroupsample] | Queries policy tracked resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryManagementGroupScope.json | -| [policyTrackedResourcesListQueryResultsForResourceGroupSample.ts][policytrackedresourceslistqueryresultsforresourcegroupsample] | Queries policy tracked resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceGroupScope.json | -| [policyTrackedResourcesListQueryResultsForResourceSample.ts][policytrackedresourceslistqueryresultsforresourcesample] | Queries policy tracked resources under the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceScope.json | -| [policyTrackedResourcesListQueryResultsForSubscriptionSample.ts][policytrackedresourceslistqueryresultsforsubscriptionsample] | Queries policy tracked resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QuerySubscriptionScope.json | -| [queryAllPolicyStatesAtNestedResourceScope.ts][queryallpolicystatesatnestedresourcescope] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryNestedResourceScope.json | -| [queryAllPolicyStatesAtResourceScope.ts][queryallpolicystatesatresourcescope] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScope.json | -| [queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.ts][queryallpolicystatesatresourcescopeandexpandpolicyevaluationdetails] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json | -| [queryAllPolicyStatesAtResourceScopeWithNextLink.ts][queryallpolicystatesatresourcescopewithnextlink] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeNextLink.json | -| [queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.ts][queryallpolicystatesatsubscriptionlevelnestedresourcescope] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelNestedResourceScope.json | -| [queryAllPolicyStatesAtSubscriptionLevelResourceScope.ts][queryallpolicystatesatsubscriptionlevelresourcescope] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelResourceScope.json | -| [queryAtManagementGroupScope.ts][queryatmanagementgroupscope] | Queries policy events for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScope.json | -| [queryAtManagementGroupScopeUsingQueryParameters.ts][queryatmanagementgroupscopeusingqueryparameters] | Queries policy tracked resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryManagementGroupScopeWithFilterAndTop.json | -| [queryAtManagementGroupScopeWithNextLink.ts][queryatmanagementgroupscopewithnextlink] | Queries policy events for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScopeNextLink.json | -| [queryAtNestedResourceScope.ts][queryatnestedresourcescope] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryNestedResourceScope.json | -| [queryAtResourceGroupLevelPolicyAssignmentScope.ts][queryatresourcegrouplevelpolicyassignmentscope] | Queries policy events for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScope.json | -| [queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.ts][queryatresourcegrouplevelpolicyassignmentscopewithnextlink] | Queries policy events for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.json | -| [queryAtResourceGroupScope.ts][queryatresourcegroupscope] | Queries policy events for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScope.json | -| [queryAtResourceGroupScopeUsingQueryParameters.ts][queryatresourcegroupscopeusingqueryparameters] | Queries policy tracked resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceGroupScopeWithFilterAndTop.json | -| [queryAtResourceGroupScopeWithNextLink.ts][queryatresourcegroupscopewithnextlink] | Queries policy events for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScopeNextLink.json | -| [queryAtResourceScope.ts][queryatresourcescope] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScope.json | -| [queryAtResourceScopeUsingQueryParameters.ts][queryatresourcescopeusingqueryparameters] | Queries policy tracked resources under the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceScopeWithFilterAndTop.json | -| [queryAtResourceScopeWithNextLink.ts][queryatresourcescopewithnextlink] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeNextLink.json | -| [queryAtSubscriptionLevelNestedResourceScope.ts][queryatsubscriptionlevelnestedresourcescope] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelNestedResourceScope.json | -| [queryAtSubscriptionLevelPolicyAssignmentScope.ts][queryatsubscriptionlevelpolicyassignmentscope] | Queries policy events for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScope.json | -| [queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts][queryatsubscriptionlevelpolicyassignmentscopewithnextlink] | Queries policy events for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.json | -| [queryAtSubscriptionLevelPolicyDefinitionScope.ts][queryatsubscriptionlevelpolicydefinitionscope] | Queries policy events for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScope.json | -| [queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts][queryatsubscriptionlevelpolicydefinitionscopewithnextlink] | Queries policy events for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.json | -| [queryAtSubscriptionLevelPolicySetDefinitionScope.ts][queryatsubscriptionlevelpolicysetdefinitionscope] | Queries policy events for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScope.json | -| [queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts][queryatsubscriptionlevelpolicysetdefinitionscopewithnextlink] | Queries policy events for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.json | -| [queryAtSubscriptionLevelResourceScope.ts][queryatsubscriptionlevelresourcescope] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelResourceScope.json | -| [queryAtSubscriptionScope.ts][queryatsubscriptionscope] | Queries policy events for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionScope.json | -| [queryAtSubscriptionScopeUsingQueryParameters.ts][queryatsubscriptionscopeusingqueryparameters] | Queries policy tracked resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QuerySubscriptionScopeWithFilterAndTop.json | -| [queryAtSubscriptionScopeWithNextLink.ts][queryatsubscriptionscopewithnextlink] | Queries policy events for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionScopeNextLink.json | -| [queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.ts][querycomponentpolicycompliancestateatresourcescopefilteredbygivenassignment] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandComponents.json | -| [queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.ts][querycomponentpolicycompliancestatecountgroupedbystatetypeatresourcescopefilteredbygivenassignment] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandComponentsGroupByWithAggregate.json | -| [queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.ts][querycomponentspolicyeventscountgroupedbyuserandactiontypeforresourcescopefilteredbygivenassignment] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeExpandComponentsGroupByWithAggregate.json | -| [queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.ts][querycomponentspolicyeventsforresourcescopefilteredbygivenassignment] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeExpandComponents.json | -| [queryLatestAtManagementGroupScope.ts][querylatestatmanagementgroupscope] | Queries policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScope.json | -| [queryLatestAtManagementGroupScopeWithNextLink.ts][querylatestatmanagementgroupscopewithnextlink] | Queries policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScopeNextLink.json | -| [queryLatestAtResourceGroupLevelPolicyAssignmentScope.ts][querylatestatresourcegrouplevelpolicyassignmentscope] | Queries policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json | -| [queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.ts][querylatestatresourcegrouplevelpolicyassignmentscopewithnextlink] | Queries policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.json | -| [queryLatestAtResourceGroupScope.ts][querylatestatresourcegroupscope] | Queries policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScope.json | -| [queryLatestAtResourceGroupScopeWithNextLink.ts][querylatestatresourcegroupscopewithnextlink] | Queries policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScopeNextLink.json | -| [queryLatestAtSubscriptionLevelPolicyAssignmentScope.ts][querylatestatsubscriptionlevelpolicyassignmentscope] | Queries policy states for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json | -| [queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts][querylatestatsubscriptionlevelpolicyassignmentscopewithnextlink] | Queries policy states for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.json | -| [queryLatestAtSubscriptionLevelPolicyDefinitionScope.ts][querylatestatsubscriptionlevelpolicydefinitionscope] | Queries policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json | -| [queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts][querylatestatsubscriptionlevelpolicydefinitionscopewithnextlink] | Queries policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.json | -| [queryLatestAtSubscriptionLevelPolicySetDefinitionScope.ts][querylatestatsubscriptionlevelpolicysetdefinitionscope] | Queries policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json | -| [queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts][querylatestatsubscriptionlevelpolicysetdefinitionscopewithnextlink] | Queries policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.json | -| [queryLatestAtSubscriptionScope.ts][querylatestatsubscriptionscope] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionScope.json | -| [queryLatestAtSubscriptionScopeWithNextLink.ts][querylatestatsubscriptionscopewithnextlink] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionScopeNextLink.json | -| [remediationsCancelAtManagementGroupSample.ts][remediationscancelatmanagementgroupsample] | Cancels a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelManagementGroupScope.json | -| [remediationsCancelAtResourceGroupSample.ts][remediationscancelatresourcegroupsample] | Cancels a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceGroupScope.json | -| [remediationsCancelAtResourceSample.ts][remediationscancelatresourcesample] | Cancel a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceScope.json | -| [remediationsCancelAtSubscriptionSample.ts][remediationscancelatsubscriptionsample] | Cancels a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelSubscriptionScope.json | -| [remediationsCreateOrUpdateAtManagementGroupSample.ts][remediationscreateorupdateatmanagementgroupsample] | Creates or updates a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateManagementGroupScope.json | -| [remediationsCreateOrUpdateAtResourceGroupSample.ts][remediationscreateorupdateatresourcegroupsample] | Creates or updates a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceGroupScope.json | -| [remediationsCreateOrUpdateAtResourceSample.ts][remediationscreateorupdateatresourcesample] | Creates or updates a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceScope.json | -| [remediationsCreateOrUpdateAtSubscriptionSample.ts][remediationscreateorupdateatsubscriptionsample] | Creates or updates a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json | -| [remediationsDeleteAtManagementGroupSample.ts][remediationsdeleteatmanagementgroupsample] | Deletes an existing remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteManagementGroupScope.json | -| [remediationsDeleteAtResourceGroupSample.ts][remediationsdeleteatresourcegroupsample] | Deletes an existing remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceGroupScope.json | -| [remediationsDeleteAtResourceSample.ts][remediationsdeleteatresourcesample] | Deletes an existing remediation at individual resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceScope.json | -| [remediationsDeleteAtSubscriptionSample.ts][remediationsdeleteatsubscriptionsample] | Deletes an existing remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteSubscriptionScope.json | -| [remediationsGetAtManagementGroupSample.ts][remediationsgetatmanagementgroupsample] | Gets an existing remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetManagementGroupScope.json | -| [remediationsGetAtResourceGroupSample.ts][remediationsgetatresourcegroupsample] | Gets an existing remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceGroupScope.json | -| [remediationsGetAtResourceSample.ts][remediationsgetatresourcesample] | Gets an existing remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceScope.json | -| [remediationsGetAtSubscriptionSample.ts][remediationsgetatsubscriptionsample] | Gets an existing remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetSubscriptionScope.json | -| [remediationsListDeploymentsAtManagementGroupSample.ts][remediationslistdeploymentsatmanagementgroupsample] | Gets all deployments for a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsManagementGroupScope.json | -| [remediationsListDeploymentsAtResourceGroupSample.ts][remediationslistdeploymentsatresourcegroupsample] | Gets all deployments for a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json | -| [remediationsListDeploymentsAtResourceSample.ts][remediationslistdeploymentsatresourcesample] | Gets all deployments for a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceScope.json | -| [remediationsListDeploymentsAtSubscriptionSample.ts][remediationslistdeploymentsatsubscriptionsample] | Gets all deployments for a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsSubscriptionScope.json | -| [remediationsListForManagementGroupSample.ts][remediationslistformanagementgroupsample] | Gets all remediations for the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope.json | -| [remediationsListForResourceGroupSample.ts][remediationslistforresourcegroupsample] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope.json | -| [remediationsListForResourceSample.ts][remediationslistforresourcesample] | Gets all remediations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope.json | -| [remediationsListForSubscriptionSample.ts][remediationslistforsubscriptionsample] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope.json | -| [summarizeAtManagementGroupScope.ts][summarizeatmanagementgroupscope] | Summarizes policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeManagementGroupScope.json | -| [summarizeAtPolicyAssignmentScope.ts][summarizeatpolicyassignmentscope] | Summarizes policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json | -| [summarizeAtPolicyDefinitionScope.ts][summarizeatpolicydefinitionscope] | Summarizes policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json | -| [summarizeAtPolicySetDefinitionScope.ts][summarizeatpolicysetdefinitionscope] | Summarizes policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json | -| [summarizeAtResourceGroupScope.ts][summarizeatresourcegroupscope] | Summarizes policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupScope.json | -| [summarizeAtResourceScope.ts][summarizeatresourcescope] | Summarizes policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceScope.json | -| [summarizeAtSubscriptionScope.ts][summarizeatsubscriptionscope] | Summarizes policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScope.json | -| [summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.ts][summarizeatsubscriptionscopeforapolicydefinitiongroup] | Summarizes policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScopeForPolicyGroup.json | -| [timeRangeSortSelectAndLimit.ts][timerangesortselectandlimit] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TimeRangeSortSelectTop.json | -| [triggerEvaluationsForAllResourcesInAResourceGroup.ts][triggerevaluationsforallresourcesinaresourcegroup] | Triggers a policy evaluation scan for all the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json | -| [triggerEvaluationsForAllResourcesInASubscription.ts][triggerevaluationsforallresourcesinasubscription] | Triggers a policy evaluation scan for all the resources under the subscription x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json | +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [attestationsCreateOrUpdateAtResourceGroupSample.ts][attestationscreateorupdateatresourcegroupsample] | Creates or updates an attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceGroupScope.json | +| [attestationsCreateOrUpdateAtResourceSample.ts][attestationscreateorupdateatresourcesample] | Creates or updates an attestation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceScope.json | +| [attestationsCreateOrUpdateAtSubscriptionSample.ts][attestationscreateorupdateatsubscriptionsample] | Creates or updates an attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateSubscriptionScope.json | +| [attestationsDeleteAtResourceGroupSample.ts][attestationsdeleteatresourcegroupsample] | Deletes an existing attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceGroupScope.json | +| [attestationsDeleteAtResourceSample.ts][attestationsdeleteatresourcesample] | Deletes an existing attestation at individual resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceScope.json | +| [attestationsDeleteAtSubscriptionSample.ts][attestationsdeleteatsubscriptionsample] | Deletes an existing attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteSubscriptionScope.json | +| [attestationsGetAtResourceGroupSample.ts][attestationsgetatresourcegroupsample] | Gets an existing attestation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceGroupScope.json | +| [attestationsGetAtResourceSample.ts][attestationsgetatresourcesample] | Gets an existing attestation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceScope.json | +| [attestationsGetAtSubscriptionSample.ts][attestationsgetatsubscriptionsample] | Gets an existing attestation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetSubscriptionScope.json | +| [attestationsListForResourceGroupSample.ts][attestationslistforresourcegroupsample] | Gets all attestations for the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceGroupScope.json | +| [attestationsListForResourceSample.ts][attestationslistforresourcesample] | Gets all attestations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceScope.json | +| [attestationsListForSubscriptionSample.ts][attestationslistforsubscriptionsample] | Gets all attestations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListSubscriptionScope.json | +| [operationsListSample.ts][operationslistsample] | Lists available operations. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_ListOperations.json | +| [policyEventsListQueryResultsForManagementGroupSample.ts][policyeventslistqueryresultsformanagementgroupsample] | Queries policy events for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScope.json | +| [policyEventsListQueryResultsForPolicyDefinitionSample.ts][policyeventslistqueryresultsforpolicydefinitionsample] | Queries policy events for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScope.json | +| [policyEventsListQueryResultsForPolicySetDefinitionSample.ts][policyeventslistqueryresultsforpolicysetdefinitionsample] | Queries policy events for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScope.json | +| [policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts][policyeventslistqueryresultsforresourcegrouplevelpolicyassignmentsample] | Queries policy events for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScope.json | +| [policyEventsListQueryResultsForResourceGroupSample.ts][policyeventslistqueryresultsforresourcegroupsample] | Queries policy events for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScope.json | +| [policyEventsListQueryResultsForResourceSample.ts][policyeventslistqueryresultsforresourcesample] | Queries policy events for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryNestedResourceScope.json | +| [policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts][policyeventslistqueryresultsforsubscriptionlevelpolicyassignmentsample] | Queries policy events for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScope.json | +| [policyEventsListQueryResultsForSubscriptionSample.ts][policyeventslistqueryresultsforsubscriptionsample] | Queries policy events for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_FilterAndAggregateOnly.json | +| [policyMetadataGetResourceSample.ts][policymetadatagetresourcesample] | Get policy metadata resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_GetResource.json | +| [policyMetadataListSample.ts][policymetadatalistsample] | Get a list of the policy metadata resources. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List.json | +| [policyRestrictionsCheckAtManagementGroupScopeSample.ts][policyrestrictionscheckatmanagementgroupscopesample] | Checks what restrictions Azure Policy will place on resources within a management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtManagementGroupScope.json | +| [policyRestrictionsCheckAtResourceGroupScopeSample.ts][policyrestrictionscheckatresourcegroupscopesample] | Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json | +| [policyRestrictionsCheckAtSubscriptionScopeSample.ts][policyrestrictionscheckatsubscriptionscopesample] | Checks what restrictions Azure Policy will place on a resource within a subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json | +| [policyStatesListQueryResultsForManagementGroupSample.ts][policystateslistqueryresultsformanagementgroupsample] | Queries policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScope.json | +| [policyStatesListQueryResultsForPolicyDefinitionSample.ts][policystateslistqueryresultsforpolicydefinitionsample] | Queries policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json | +| [policyStatesListQueryResultsForPolicySetDefinitionSample.ts][policystateslistqueryresultsforpolicysetdefinitionsample] | Queries policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json | +| [policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts][policystateslistqueryresultsforresourcegrouplevelpolicyassignmentsample] | Queries policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json | +| [policyStatesListQueryResultsForResourceGroupSample.ts][policystateslistqueryresultsforresourcegroupsample] | Queries policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScope.json | +| [policyStatesListQueryResultsForResourceSample.ts][policystateslistqueryresultsforresourcesample] | Queries policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryNestedResourceScope.json | +| [policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts][policystateslistqueryresultsforsubscriptionlevelpolicyassignmentsample] | Queries policy states for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json | +| [policyStatesListQueryResultsForSubscriptionSample.ts][policystateslistqueryresultsforsubscriptionsample] | Queries policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndAggregateOnly.json | +| [policyStatesSummarizeForManagementGroupSample.ts][policystatessummarizeformanagementgroupsample] | Summarizes policy states for the resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeManagementGroupScope.json | +| [policyStatesSummarizeForPolicyDefinitionSample.ts][policystatessummarizeforpolicydefinitionsample] | Summarizes policy states for the subscription level policy definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json | +| [policyStatesSummarizeForPolicySetDefinitionSample.ts][policystatessummarizeforpolicysetdefinitionsample] | Summarizes policy states for the subscription level policy set definition. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json | +| [policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.ts][policystatessummarizeforresourcegrouplevelpolicyassignmentsample] | Summarizes policy states for the resource group level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json | +| [policyStatesSummarizeForResourceGroupSample.ts][policystatessummarizeforresourcegroupsample] | Summarizes policy states for the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupScope.json | +| [policyStatesSummarizeForResourceSample.ts][policystatessummarizeforresourcesample] | Summarizes policy states for the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceScope.json | +| [policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.ts][policystatessummarizeforsubscriptionlevelpolicyassignmentsample] | Summarizes policy states for the subscription level policy assignment. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyAssignmentScope.json | +| [policyStatesSummarizeForSubscriptionSample.ts][policystatessummarizeforsubscriptionsample] | Summarizes policy states for the resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScope.json | +| [policyStatesTriggerResourceGroupEvaluationSample.ts][policystatestriggerresourcegroupevaluationsample] | Triggers a policy evaluation scan for all the resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json | +| [policyStatesTriggerSubscriptionEvaluationSample.ts][policystatestriggersubscriptionevaluationsample] | Triggers a policy evaluation scan for all the resources under the subscription x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json | +| [policyTrackedResourcesListQueryResultsForManagementGroupSample.ts][policytrackedresourceslistqueryresultsformanagementgroupsample] | Queries policy tracked resources under the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryManagementGroupScope.json | +| [policyTrackedResourcesListQueryResultsForResourceGroupSample.ts][policytrackedresourceslistqueryresultsforresourcegroupsample] | Queries policy tracked resources under the resource group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceGroupScope.json | +| [policyTrackedResourcesListQueryResultsForResourceSample.ts][policytrackedresourceslistqueryresultsforresourcesample] | Queries policy tracked resources under the resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceScope.json | +| [policyTrackedResourcesListQueryResultsForSubscriptionSample.ts][policytrackedresourceslistqueryresultsforsubscriptionsample] | Queries policy tracked resources under the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QuerySubscriptionScope.json | +| [remediationsCancelAtManagementGroupSample.ts][remediationscancelatmanagementgroupsample] | Cancels a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelManagementGroupScope.json | +| [remediationsCancelAtResourceGroupSample.ts][remediationscancelatresourcegroupsample] | Cancels a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceGroupScope.json | +| [remediationsCancelAtResourceSample.ts][remediationscancelatresourcesample] | Cancel a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceScope.json | +| [remediationsCancelAtSubscriptionSample.ts][remediationscancelatsubscriptionsample] | Cancels a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelSubscriptionScope.json | +| [remediationsCreateOrUpdateAtManagementGroupSample.ts][remediationscreateorupdateatmanagementgroupsample] | Creates or updates a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateManagementGroupScope.json | +| [remediationsCreateOrUpdateAtResourceGroupSample.ts][remediationscreateorupdateatresourcegroupsample] | Creates or updates a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceGroupScope.json | +| [remediationsCreateOrUpdateAtResourceSample.ts][remediationscreateorupdateatresourcesample] | Creates or updates a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceScope.json | +| [remediationsCreateOrUpdateAtSubscriptionSample.ts][remediationscreateorupdateatsubscriptionsample] | Creates or updates a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json | +| [remediationsDeleteAtManagementGroupSample.ts][remediationsdeleteatmanagementgroupsample] | Deletes an existing remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteManagementGroupScope.json | +| [remediationsDeleteAtResourceGroupSample.ts][remediationsdeleteatresourcegroupsample] | Deletes an existing remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceGroupScope.json | +| [remediationsDeleteAtResourceSample.ts][remediationsdeleteatresourcesample] | Deletes an existing remediation at individual resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceScope.json | +| [remediationsDeleteAtSubscriptionSample.ts][remediationsdeleteatsubscriptionsample] | Deletes an existing remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteSubscriptionScope.json | +| [remediationsGetAtManagementGroupSample.ts][remediationsgetatmanagementgroupsample] | Gets an existing remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetManagementGroupScope.json | +| [remediationsGetAtResourceGroupSample.ts][remediationsgetatresourcegroupsample] | Gets an existing remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceGroupScope.json | +| [remediationsGetAtResourceSample.ts][remediationsgetatresourcesample] | Gets an existing remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceScope.json | +| [remediationsGetAtSubscriptionSample.ts][remediationsgetatsubscriptionsample] | Gets an existing remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetSubscriptionScope.json | +| [remediationsListDeploymentsAtManagementGroupSample.ts][remediationslistdeploymentsatmanagementgroupsample] | Gets all deployments for a remediation at management group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsManagementGroupScope.json | +| [remediationsListDeploymentsAtResourceGroupSample.ts][remediationslistdeploymentsatresourcegroupsample] | Gets all deployments for a remediation at resource group scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json | +| [remediationsListDeploymentsAtResourceSample.ts][remediationslistdeploymentsatresourcesample] | Gets all deployments for a remediation at resource scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceScope.json | +| [remediationsListDeploymentsAtSubscriptionSample.ts][remediationslistdeploymentsatsubscriptionsample] | Gets all deployments for a remediation at subscription scope. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsSubscriptionScope.json | +| [remediationsListForManagementGroupSample.ts][remediationslistformanagementgroupsample] | Gets all remediations for the management group. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope.json | +| [remediationsListForResourceGroupSample.ts][remediationslistforresourcegroupsample] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope.json | +| [remediationsListForResourceSample.ts][remediationslistforresourcesample] | Gets all remediations for a resource. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope.json | +| [remediationsListForSubscriptionSample.ts][remediationslistforsubscriptionsample] | Gets all remediations for the subscription. x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope.json | ## Prerequisites @@ -252,61 +139,6 @@ Take a look at our [API Documentation][apiref] for more information about the AP [attestationslistforresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForResourceGroupSample.ts [attestationslistforresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForResourceSample.ts [attestationslistforsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForSubscriptionSample.ts -[cancelaremediationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtIndividualResourceScope.ts -[cancelaremediationatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtManagementGroupScope.ts -[cancelaremediationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtResourceGroupScope.ts -[cancelaremediationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtSubscriptionScope.ts -[checkpolicyrestrictionsatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/checkPolicyRestrictionsAtResourceGroupScope.ts -[checkpolicyrestrictionsatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/checkPolicyRestrictionsAtSubscriptionScope.ts -[createattestationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtIndividualResourceScope.ts -[createattestationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtResourceGroupScope.ts -[createattestationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtSubscriptionScope.ts -[createattestationatsubscriptionscopewithallproperties]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtSubscriptionScopeWithAllProperties.ts -[createremediationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtIndividualResourceScope.ts -[createremediationatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtManagementGroupScope.ts -[createremediationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtResourceGroupScope.ts -[createremediationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtSubscriptionScope.ts -[createremediationatsubscriptionscopewithallproperties]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtSubscriptionScopeWithAllProperties.ts -[deleteattestationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteAttestationAtIndividualResourceScope.ts -[deleteattestationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteAttestationAtResourceGroupScope.ts -[deleteattestationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteAttestationAtSubscriptionScope.ts -[deleteremediationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtIndividualResourceScope.ts -[deleteremediationatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtManagementGroupScope.ts -[deleteremediationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtResourceGroupScope.ts -[deleteremediationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtSubscriptionScope.ts -[filterandaggregateonly]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndAggregateOnly.ts -[filterandgroupwithaggregate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndGroupWithAggregate.ts -[filterandgroupwithoutaggregate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndGroupWithoutAggregate.ts -[filterandmultiplegroups]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndMultipleGroups.ts -[getasinglepolicymetadataresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getASinglePolicyMetadataResource.ts -[getattestationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getAttestationAtIndividualResourceScope.ts -[getattestationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getAttestationAtResourceGroupScope.ts -[getattestationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getAttestationAtSubscriptionScope.ts -[getcollectionofpolicymetadataresources]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getCollectionOfPolicyMetadataResources.ts -[getcollectionofpolicymetadataresourcesusingtopqueryparameter]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.ts -[getremediationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtIndividualResourceScope.ts -[getremediationatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtManagementGroupScope.ts -[getremediationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtResourceGroupScope.ts -[getremediationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtSubscriptionScope.ts -[listattestationsatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtIndividualResourceScope.ts -[listattestationsatindividualresourcescopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtIndividualResourceScopeWithQueryParameters.ts -[listattestationsatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtResourceGroupScope.ts -[listattestationsatresourcegroupscopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtResourceGroupScopeWithQueryParameters.ts -[listattestationsatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtSubscriptionScope.ts -[listattestationsatsubscriptionscopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtSubscriptionScopeWithQueryParameters.ts -[listdeploymentsforaremediationatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtIndividualResourceScope.ts -[listdeploymentsforaremediationatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtManagementGroupScope.ts -[listdeploymentsforaremediationatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtResourceGroupScope.ts -[listdeploymentsforaremediationatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtSubscriptionScope.ts -[listoperations]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listOperations.ts -[listremediationsatindividualresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtIndividualResourceScope.ts -[listremediationsatindividualresourcescopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtIndividualResourceScopeWithQueryParameters.ts -[listremediationsatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtManagementGroupScope.ts -[listremediationsatmanagementgroupscopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtManagementGroupScopeWithQueryParameters.ts -[listremediationsatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtResourceGroupScope.ts -[listremediationsatresourcegroupscopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtResourceGroupScopeWithQueryParameters.ts -[listremediationsatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtSubscriptionScope.ts -[listremediationsatsubscriptionscopewithqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtSubscriptionScopeWithQueryParameters.ts [operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/operationsListSample.ts [policyeventslistqueryresultsformanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForManagementGroupSample.ts [policyeventslistqueryresultsforpolicydefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForPolicyDefinitionSample.ts @@ -343,53 +175,6 @@ Take a look at our [API Documentation][apiref] for more information about the AP [policytrackedresourceslistqueryresultsforresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyTrackedResourcesListQueryResultsForResourceGroupSample.ts [policytrackedresourceslistqueryresultsforresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyTrackedResourcesListQueryResultsForResourceSample.ts [policytrackedresourceslistqueryresultsforsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyTrackedResourcesListQueryResultsForSubscriptionSample.ts -[queryallpolicystatesatnestedresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtNestedResourceScope.ts -[queryallpolicystatesatresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtResourceScope.ts -[queryallpolicystatesatresourcescopeandexpandpolicyevaluationdetails]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.ts -[queryallpolicystatesatresourcescopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtResourceScopeWithNextLink.ts -[queryallpolicystatesatsubscriptionlevelnestedresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.ts -[queryallpolicystatesatsubscriptionlevelresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtSubscriptionLevelResourceScope.ts -[queryatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtManagementGroupScope.ts -[queryatmanagementgroupscopeusingqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtManagementGroupScopeUsingQueryParameters.ts -[queryatmanagementgroupscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtManagementGroupScopeWithNextLink.ts -[queryatnestedresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtNestedResourceScope.ts -[queryatresourcegrouplevelpolicyassignmentscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupLevelPolicyAssignmentScope.ts -[queryatresourcegrouplevelpolicyassignmentscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.ts -[queryatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupScope.ts -[queryatresourcegroupscopeusingqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupScopeUsingQueryParameters.ts -[queryatresourcegroupscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupScopeWithNextLink.ts -[queryatresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceScope.ts -[queryatresourcescopeusingqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceScopeUsingQueryParameters.ts -[queryatresourcescopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceScopeWithNextLink.ts -[queryatsubscriptionlevelnestedresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelNestedResourceScope.ts -[queryatsubscriptionlevelpolicyassignmentscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyAssignmentScope.ts -[queryatsubscriptionlevelpolicyassignmentscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts -[queryatsubscriptionlevelpolicydefinitionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyDefinitionScope.ts -[queryatsubscriptionlevelpolicydefinitionscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts -[queryatsubscriptionlevelpolicysetdefinitionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicySetDefinitionScope.ts -[queryatsubscriptionlevelpolicysetdefinitionscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts -[queryatsubscriptionlevelresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelResourceScope.ts -[queryatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionScope.ts -[queryatsubscriptionscopeusingqueryparameters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionScopeUsingQueryParameters.ts -[queryatsubscriptionscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionScopeWithNextLink.ts -[querycomponentpolicycompliancestateatresourcescopefilteredbygivenassignment]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.ts -[querycomponentpolicycompliancestatecountgroupedbystatetypeatresourcescopefilteredbygivenassignment]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.ts -[querycomponentspolicyeventscountgroupedbyuserandactiontypeforresourcescopefilteredbygivenassignment]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.ts -[querycomponentspolicyeventsforresourcescopefilteredbygivenassignment]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.ts -[querylatestatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtManagementGroupScope.ts -[querylatestatmanagementgroupscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtManagementGroupScopeWithNextLink.ts -[querylatestatresourcegrouplevelpolicyassignmentscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupLevelPolicyAssignmentScope.ts -[querylatestatresourcegrouplevelpolicyassignmentscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.ts -[querylatestatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupScope.ts -[querylatestatresourcegroupscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupScopeWithNextLink.ts -[querylatestatsubscriptionlevelpolicyassignmentscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyAssignmentScope.ts -[querylatestatsubscriptionlevelpolicyassignmentscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts -[querylatestatsubscriptionlevelpolicydefinitionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyDefinitionScope.ts -[querylatestatsubscriptionlevelpolicydefinitionscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts -[querylatestatsubscriptionlevelpolicysetdefinitionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicySetDefinitionScope.ts -[querylatestatsubscriptionlevelpolicysetdefinitionscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts -[querylatestatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionScope.ts -[querylatestatsubscriptionscopewithnextlink]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionScopeWithNextLink.ts [remediationscancelatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/remediationsCancelAtManagementGroupSample.ts [remediationscancelatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/remediationsCancelAtResourceGroupSample.ts [remediationscancelatresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/remediationsCancelAtResourceSample.ts @@ -414,17 +199,6 @@ Take a look at our [API Documentation][apiref] for more information about the AP [remediationslistforresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/remediationsListForResourceGroupSample.ts [remediationslistforresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/remediationsListForResourceSample.ts [remediationslistforsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/remediationsListForSubscriptionSample.ts -[summarizeatmanagementgroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtManagementGroupScope.ts -[summarizeatpolicyassignmentscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtPolicyAssignmentScope.ts -[summarizeatpolicydefinitionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtPolicyDefinitionScope.ts -[summarizeatpolicysetdefinitionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtPolicySetDefinitionScope.ts -[summarizeatresourcegroupscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtResourceGroupScope.ts -[summarizeatresourcescope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtResourceScope.ts -[summarizeatsubscriptionscope]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtSubscriptionScope.ts -[summarizeatsubscriptionscopeforapolicydefinitiongroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.ts -[timerangesortselectandlimit]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/timeRangeSortSelectAndLimit.ts -[triggerevaluationsforallresourcesinaresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/triggerEvaluationsForAllResourcesInAResourceGroup.ts -[triggerevaluationsforallresourcesinasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/triggerEvaluationsForAllResourcesInASubscription.ts [apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-policyinsights?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policyinsights/arm-policyinsights/README.md diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/package.json b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/package.json index 4847bb924abc..31078d9828f9 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/package.json +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/node": "^14.0.0", - "typescript": "~4.6.0", + "typescript": "~4.8.0", "rimraf": "latest" } } diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsCreateOrUpdateAtResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsCreateOrUpdateAtResourceGroupSample.ts index 9e0c4c05e635..7e460e58fc2d 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsCreateOrUpdateAtResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsCreateOrUpdateAtResourceGroupSample.ts @@ -15,13 +15,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Creates or updates an attestation at resource group scope. * * @summary Creates or updates an attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceGroupScope.json */ async function createAttestationAtResourceGroupScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; const resourceGroupName = "myRg"; const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; const parameters: Attestation = { + assessmentDate: new Date("2021-06-10T00:00:00Z"), comments: "This subscription has passed a security audit.", complianceState: "Compliant", evidence: [ @@ -32,6 +33,7 @@ async function createAttestationAtResourceGroupScope() { } ], expiresOn: new Date("2021-06-15T00:00:00Z"), + metadata: { departmentId: "NYC-MARKETING-1" }, owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", policyAssignmentId: "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsCreateOrUpdateAtResourceSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsCreateOrUpdateAtResourceSample.ts index 986a2cf10905..19285ddc3807 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsCreateOrUpdateAtResourceSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsCreateOrUpdateAtResourceSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Creates or updates an attestation at resource scope. * * @summary Creates or updates an attestation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceScope.json */ async function createAttestationAtIndividualResourceScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; @@ -23,6 +23,7 @@ async function createAttestationAtIndividualResourceScope() { "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; const parameters: Attestation = { + assessmentDate: new Date("2021-06-10T00:00:00Z"), comments: "This subscription has passed a security audit.", complianceState: "Compliant", evidence: [ @@ -33,6 +34,7 @@ async function createAttestationAtIndividualResourceScope() { } ], expiresOn: new Date("2021-06-15T00:00:00Z"), + metadata: { departmentId: "NYC-MARKETING-1" }, owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", policyAssignmentId: "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsCreateOrUpdateAtSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsCreateOrUpdateAtSubscriptionSample.ts index 166c66d7ac39..55ae1a7c2b6f 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsCreateOrUpdateAtSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsCreateOrUpdateAtSubscriptionSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Creates or updates an attestation at subscription scope. * * @summary Creates or updates an attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateSubscriptionScope.json */ async function createAttestationAtSubscriptionScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; @@ -40,12 +40,13 @@ createAttestationAtSubscriptionScope().catch(console.error); * This sample demonstrates how to Creates or updates an attestation at subscription scope. * * @summary Creates or updates an attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json */ async function createAttestationAtSubscriptionScopeWithAllProperties() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; const parameters: Attestation = { + assessmentDate: new Date("2021-06-10T00:00:00Z"), comments: "This subscription has passed a security audit.", complianceState: "Compliant", evidence: [ @@ -56,6 +57,7 @@ async function createAttestationAtSubscriptionScopeWithAllProperties() { } ], expiresOn: new Date("2021-06-15T00:00:00Z"), + metadata: { departmentId: "NYC-MARKETING-1" }, owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", policyAssignmentId: "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsDeleteAtResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsDeleteAtResourceGroupSample.ts index f022282866d2..1424292c8c52 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsDeleteAtResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsDeleteAtResourceGroupSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Deletes an existing attestation at resource group scope. * * @summary Deletes an existing attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceGroupScope.json */ async function deleteAttestationAtResourceGroupScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsDeleteAtResourceSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsDeleteAtResourceSample.ts index c047a88f0dcd..71138952fcd4 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsDeleteAtResourceSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsDeleteAtResourceSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Deletes an existing attestation at individual resource scope. * * @summary Deletes an existing attestation at individual resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceScope.json */ async function deleteAttestationAtIndividualResourceScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsDeleteAtSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsDeleteAtSubscriptionSample.ts index 7c8b8a05dfc4..28ea15d08e77 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsDeleteAtSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsDeleteAtSubscriptionSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Deletes an existing attestation at subscription scope. * * @summary Deletes an existing attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteSubscriptionScope.json */ async function deleteAttestationAtSubscriptionScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsGetAtResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsGetAtResourceGroupSample.ts index 244939451bb6..6d471679b3c3 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsGetAtResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsGetAtResourceGroupSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets an existing attestation at resource group scope. * * @summary Gets an existing attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceGroupScope.json */ async function getAttestationAtResourceGroupScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsGetAtResourceSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsGetAtResourceSample.ts index cbd28a584822..1a0a36eeff20 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsGetAtResourceSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsGetAtResourceSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets an existing attestation at resource scope. * * @summary Gets an existing attestation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceScope.json */ async function getAttestationAtIndividualResourceScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsGetAtSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsGetAtSubscriptionSample.ts index 692307b8a8aa..4f2b8e65c467 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsGetAtSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsGetAtSubscriptionSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets an existing attestation at subscription scope. * * @summary Gets an existing attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetSubscriptionScope.json */ async function getAttestationAtSubscriptionScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForResourceGroupSample.ts index d7166a4d6703..ef340c82fe0f 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForResourceGroupSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets all attestations for the resource group. * * @summary Gets all attestations for the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceGroupScope.json */ async function listAttestationsAtResourceGroupScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; @@ -40,7 +40,7 @@ listAttestationsAtResourceGroupScope().catch(console.error); * This sample demonstrates how to Gets all attestations for the resource group. * * @summary Gets all attestations for the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceGroupScope_WithQuery.json */ async function listAttestationsAtResourceGroupScopeWithQueryParameters() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForResourceSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForResourceSample.ts index acb8df8415cf..5c8cd8b86f83 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForResourceSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForResourceSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets all attestations for a resource. * * @summary Gets all attestations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceScope.json */ async function listAttestationsAtIndividualResourceScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ listAttestationsAtIndividualResourceScope().catch(console.error); * This sample demonstrates how to Gets all attestations for a resource. * * @summary Gets all attestations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceScope_WithQuery.json */ async function listAttestationsAtIndividualResourceScopeWithQueryParameters() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForSubscriptionSample.ts index d40b07167746..e126940d1f35 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/attestationsListForSubscriptionSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets all attestations for the subscription. * * @summary Gets all attestations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListSubscriptionScope.json */ async function listAttestationsAtSubscriptionScope() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; @@ -37,7 +37,7 @@ listAttestationsAtSubscriptionScope().catch(console.error); * This sample demonstrates how to Gets all attestations for the subscription. * * @summary Gets all attestations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListSubscriptionScope_WithQuery.json */ async function listAttestationsAtSubscriptionScopeWithQueryParameters() { const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtIndividualResourceScope.ts deleted file mode 100644 index 29a33c4bf930..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtIndividualResourceScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Cancel a remediation at resource scope. - * - * @summary Cancel a remediation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function cancelARemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.cancelAtResource( - resourceId, - remediationName - ); - console.log(result); -} - -cancelARemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtManagementGroupScope.ts deleted file mode 100644 index 7ae993e98282..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtManagementGroupScope.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. -/** - * This sample demonstrates how to Cancels a remediation at management group scope. - * - * @summary Cancels a remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function cancelARemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.cancelAtManagementGroup( - managementGroupId, - remediationName - ); - console.log(result); -} - -cancelARemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtResourceGroupScope.ts deleted file mode 100644 index b8d35abb0e22..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Cancels a remediation at resource group scope. - * - * @summary Cancels a remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function cancelARemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.cancelAtResourceGroup( - resourceGroupName, - remediationName - ); - console.log(result); -} - -cancelARemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtSubscriptionScope.ts deleted file mode 100644 index 1deb903f9c07..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/cancelARemediationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Cancels a remediation at subscription scope. - * - * @summary Cancels a remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CancelSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function cancelARemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.cancelAtSubscription( - remediationName - ); - console.log(result); -} - -cancelARemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/checkPolicyRestrictionsAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/checkPolicyRestrictionsAtResourceGroupScope.ts deleted file mode 100644 index 316e8a2683d7..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/checkPolicyRestrictionsAtResourceGroupScope.ts +++ /dev/null @@ -1,52 +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. -/** - * This sample demonstrates how to Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. - * - * @summary Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json - */ -import { - CheckRestrictionsRequest, - PolicyInsightsClient -} from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function checkPolicyRestrictionsAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "vmRg"; - const parameters: CheckRestrictionsRequest = { - pendingFields: [ - { field: "name", values: ["myVMName"] }, - { - field: "location", - values: ["eastus", "westus", "westus2", "westeurope"] - }, - { field: "tags" } - ], - resourceDetails: { - apiVersion: "2019-12-01", - resourceContent: { - type: "Microsoft.Compute/virtualMachines", - properties: { priority: "Spot" } - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyRestrictions.checkAtResourceGroupScope( - resourceGroupName, - parameters - ); - console.log(result); -} - -checkPolicyRestrictionsAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/checkPolicyRestrictionsAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/checkPolicyRestrictionsAtSubscriptionScope.ts deleted file mode 100644 index 5e3dc6909e82..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/checkPolicyRestrictionsAtSubscriptionScope.ts +++ /dev/null @@ -1,50 +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. -/** - * This sample demonstrates how to Checks what restrictions Azure Policy will place on a resource within a subscription. - * - * @summary Checks what restrictions Azure Policy will place on a resource within a subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json - */ -import { - CheckRestrictionsRequest, - PolicyInsightsClient -} from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function checkPolicyRestrictionsAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const parameters: CheckRestrictionsRequest = { - pendingFields: [ - { field: "name", values: ["myVMName"] }, - { - field: "location", - values: ["eastus", "westus", "westus2", "westeurope"] - }, - { field: "tags" } - ], - resourceDetails: { - apiVersion: "2019-12-01", - resourceContent: { - type: "Microsoft.Compute/virtualMachines", - properties: { priority: "Spot" } - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyRestrictions.checkAtSubscriptionScope( - parameters - ); - console.log(result); -} - -checkPolicyRestrictionsAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtIndividualResourceScope.ts deleted file mode 100644 index ee21a3ae6f86..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtIndividualResourceScope.ts +++ /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. -/** - * This sample demonstrates how to Creates or updates an attestation at resource scope. - * - * @summary Creates or updates an attestation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceScope.json - */ -import { Attestation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createAttestationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const parameters: Attestation = { - comments: "This subscription has passed a security audit.", - complianceState: "Compliant", - evidence: [ - { - description: "The results of the security audit.", - sourceUri: - "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011" - } - ], - expiresOn: new Date("2021-06-15T00:00:00Z"), - owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - policyDefinitionReferenceId: "0b158b46-ff42-4799-8e39-08a5c23b4551" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.beginCreateOrUpdateAtResourceAndWait( - resourceId, - attestationName, - parameters - ); - console.log(result); -} - -createAttestationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtResourceGroupScope.ts deleted file mode 100644 index 4a2a85867819..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtResourceGroupScope.ts +++ /dev/null @@ -1,50 +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. -/** - * This sample demonstrates how to Creates or updates an attestation at resource group scope. - * - * @summary Creates or updates an attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceGroupScope.json - */ -import { Attestation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createAttestationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const parameters: Attestation = { - comments: "This subscription has passed a security audit.", - complianceState: "Compliant", - evidence: [ - { - description: "The results of the security audit.", - sourceUri: - "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011" - } - ], - expiresOn: new Date("2021-06-15T00:00:00Z"), - owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - policyDefinitionReferenceId: "0b158b46-ff42-4799-8e39-08a5c23b4551" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.beginCreateOrUpdateAtResourceGroupAndWait( - resourceGroupName, - attestationName, - parameters - ); - console.log(result); -} - -createAttestationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtSubscriptionScope.ts deleted file mode 100644 index fdac1465e2a9..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Creates or updates an attestation at subscription scope. - * - * @summary Creates or updates an attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope.json - */ -import { Attestation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createAttestationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const parameters: Attestation = { - complianceState: "Compliant", - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.beginCreateOrUpdateAtSubscriptionAndWait( - attestationName, - parameters - ); - console.log(result); -} - -createAttestationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtSubscriptionScopeWithAllProperties.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtSubscriptionScopeWithAllProperties.ts deleted file mode 100644 index 4ae675cad5fc..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createAttestationAtSubscriptionScopeWithAllProperties.ts +++ /dev/null @@ -1,48 +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. -/** - * This sample demonstrates how to Creates or updates an attestation at subscription scope. - * - * @summary Creates or updates an attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json - */ -import { Attestation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createAttestationAtSubscriptionScopeWithAllProperties() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const parameters: Attestation = { - comments: "This subscription has passed a security audit.", - complianceState: "Compliant", - evidence: [ - { - description: "The results of the security audit.", - sourceUri: - "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011" - } - ], - expiresOn: new Date("2021-06-15T00:00:00Z"), - owner: "55a32e28-3aa5-4eea-9b5a-4cd85153b966", - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - policyDefinitionReferenceId: "0b158b46-ff42-4799-8e39-08a5c23b4551" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.beginCreateOrUpdateAtSubscriptionAndWait( - attestationName, - parameters - ); - console.log(result); -} - -createAttestationAtSubscriptionScopeWithAllProperties().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtIndividualResourceScope.ts deleted file mode 100644 index 04667769a054..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Creates or updates a remediation at resource scope. - * - * @summary Creates or updates a remediation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceScope.json - */ -import { Remediation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createRemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "storageRemediation"; - const parameters: Remediation = { - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtResource( - resourceId, - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtManagementGroupScope.ts deleted file mode 100644 index aad903ea5f50..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtManagementGroupScope.ts +++ /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. -/** - * This sample demonstrates how to Creates or updates a remediation at management group scope. - * - * @summary Creates or updates a remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateManagementGroupScope.json - */ -import { Remediation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createRemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "storageRemediation"; - const parameters: Remediation = { - policyAssignmentId: - "/providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtManagementGroup( - managementGroupId, - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtResourceGroupScope.ts deleted file mode 100644 index ef47b99bce24..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtResourceGroupScope.ts +++ /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. -/** - * This sample demonstrates how to Creates or updates a remediation at resource group scope. - * - * @summary Creates or updates a remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateResourceGroupScope.json - */ -import { Remediation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createRemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "storageRemediation"; - const parameters: Remediation = { - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtResourceGroup( - resourceGroupName, - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtSubscriptionScope.ts deleted file mode 100644 index 7b6fbfc48163..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtSubscriptionScope.ts +++ /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. -/** - * This sample demonstrates how to Creates or updates a remediation at subscription scope. - * - * @summary Creates or updates a remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope.json - */ -import { Remediation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createRemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "storageRemediation"; - const parameters: Remediation = { - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtSubscription( - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtSubscriptionScopeWithAllProperties.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtSubscriptionScopeWithAllProperties.ts deleted file mode 100644 index 16f806a669bb..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/createRemediationAtSubscriptionScopeWithAllProperties.ts +++ /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. -/** - * This sample demonstrates how to Creates or updates a remediation at subscription scope. - * - * @summary Creates or updates a remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_CreateSubscriptionScope_AllProperties.json - */ -import { Remediation, PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function createRemediationAtSubscriptionScopeWithAllProperties() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "storageRemediation"; - const parameters: Remediation = { - failureThreshold: { percentage: 0.1 }, - filters: { locations: ["eastus", "westus"] }, - parallelDeployments: 6, - policyAssignmentId: - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - policyDefinitionReferenceId: "8c8fa9e4", - resourceCount: 42, - resourceDiscoveryMode: "ReEvaluateCompliance" - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.createOrUpdateAtSubscription( - remediationName, - parameters - ); - console.log(result); -} - -createRemediationAtSubscriptionScopeWithAllProperties().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteAttestationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteAttestationAtIndividualResourceScope.ts deleted file mode 100644 index 41c45bb5ebec..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteAttestationAtIndividualResourceScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Deletes an existing attestation at individual resource scope. - * - * @summary Deletes an existing attestation at individual resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteAttestationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.deleteAtResource( - resourceId, - attestationName - ); - console.log(result); -} - -deleteAttestationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteAttestationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteAttestationAtResourceGroupScope.ts deleted file mode 100644 index 6a89030746aa..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteAttestationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Deletes an existing attestation at resource group scope. - * - * @summary Deletes an existing attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteAttestationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.deleteAtResourceGroup( - resourceGroupName, - attestationName - ); - console.log(result); -} - -deleteAttestationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteAttestationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteAttestationAtSubscriptionScope.ts deleted file mode 100644 index 9c9c155fad3f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteAttestationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Deletes an existing attestation at subscription scope. - * - * @summary Deletes an existing attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteAttestationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.deleteAtSubscription( - attestationName - ); - console.log(result); -} - -deleteAttestationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtIndividualResourceScope.ts deleted file mode 100644 index 60f9d96a104f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtIndividualResourceScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Deletes an existing remediation at individual resource scope. - * - * @summary Deletes an existing remediation at individual resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteRemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.deleteAtResource( - resourceId, - remediationName - ); - console.log(result); -} - -deleteRemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtManagementGroupScope.ts deleted file mode 100644 index d9dd1ef7d912..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtManagementGroupScope.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. -/** - * This sample demonstrates how to Deletes an existing remediation at management group scope. - * - * @summary Deletes an existing remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteRemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.deleteAtManagementGroup( - managementGroupId, - remediationName - ); - console.log(result); -} - -deleteRemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtResourceGroupScope.ts deleted file mode 100644 index aa3eaf378e24..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Deletes an existing remediation at resource group scope. - * - * @summary Deletes an existing remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteRemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.deleteAtResourceGroup( - resourceGroupName, - remediationName - ); - console.log(result); -} - -deleteRemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtSubscriptionScope.ts deleted file mode 100644 index 3a356d08a4c4..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/deleteRemediationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Deletes an existing remediation at subscription scope. - * - * @summary Deletes an existing remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_DeleteSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function deleteRemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.deleteAtSubscription( - remediationName - ); - console.log(result); -} - -deleteRemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndAggregateOnly.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndAggregateOnly.ts deleted file mode 100644 index 5399e3b73a67..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndAggregateOnly.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndAggregateOnly.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function filterAndAggregateOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const from = new Date("2019-10-05T18:00:00Z"); - const filter = "PolicyDefinitionAction eq 'deny'"; - const apply = "aggregate($count as NumDenyStates)"; - const options = { from: from, filter: filter, apply: apply }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -filterAndAggregateOnly().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndGroupWithAggregate.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndGroupWithAggregate.ts deleted file mode 100644 index 6e11463ac34a..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndGroupWithAggregate.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndGroupByWithAggregate.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function filterAndGroupWithAggregate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 2; - const orderBy = "NumAuditDenyNonComplianceRecords desc"; - const from = new Date("2019-10-05T18:00:00Z"); - const filter = - "IsCompliant eq false and (PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny')"; - const apply = - "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumAuditDenyNonComplianceRecords))"; - const options = { - top: top, - orderBy: orderBy, - from: from, - filter: filter, - apply: apply - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -filterAndGroupWithAggregate().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndGroupWithoutAggregate.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndGroupWithoutAggregate.ts deleted file mode 100644 index 7bd7ac43f0dd..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndGroupWithoutAggregate.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndGroupByWithoutAggregate.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function filterAndGroupWithoutAggregate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 2; - const from = new Date("2019-10-05T18:00:00Z"); - const filter = - "IsCompliant eq false and (PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append')"; - const apply = - "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId))"; - const options = { top: top, from: from, filter: filter, apply: apply }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -filterAndGroupWithoutAggregate().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndMultipleGroups.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndMultipleGroups.ts deleted file mode 100644 index 270d5481b657..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/filterAndMultipleGroups.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_FilterAndMultipleGroups.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function filterAndMultipleGroups() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 10; - const orderBy = "NumNonCompliantResources desc"; - const filter = "IsCompliant eq false"; - const apply = - "groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId, ResourceId))/groupby((PolicyAssignmentId, PolicySetDefinitionId, PolicyDefinitionId, PolicyDefinitionReferenceId), aggregate($count as NumNonCompliantResources))"; - const options = { top: top, orderBy: orderBy, filter: filter, apply: apply }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -filterAndMultipleGroups().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getASinglePolicyMetadataResource.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getASinglePolicyMetadataResource.ts deleted file mode 100644 index 4c5ad8e1dedc..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getASinglePolicyMetadataResource.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. -/** - * This sample demonstrates how to Get policy metadata resource. - * - * @summary Get policy metadata resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_GetResource.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getASinglePolicyMetadataResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceName = "NIST_SP_800-53_R4_AC-2"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyMetadataOperations.getResource( - resourceName - ); - console.log(result); -} - -getASinglePolicyMetadataResource().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getAttestationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getAttestationAtIndividualResourceScope.ts deleted file mode 100644 index 586611d2957e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getAttestationAtIndividualResourceScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Gets an existing attestation at resource scope. - * - * @summary Gets an existing attestation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getAttestationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.getAtResource( - resourceId, - attestationName - ); - console.log(result); -} - -getAttestationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getAttestationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getAttestationAtResourceGroupScope.ts deleted file mode 100644 index 77db93e5f51f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getAttestationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Gets an existing attestation at resource group scope. - * - * @summary Gets an existing attestation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getAttestationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.getAtResourceGroup( - resourceGroupName, - attestationName - ); - console.log(result); -} - -getAttestationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getAttestationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getAttestationAtSubscriptionScope.ts deleted file mode 100644 index dcc3b49b3170..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getAttestationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Gets an existing attestation at subscription scope. - * - * @summary Gets an existing attestation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getAttestationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.attestations.getAtSubscription(attestationName); - console.log(result); -} - -getAttestationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getCollectionOfPolicyMetadataResources.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getCollectionOfPolicyMetadataResources.ts deleted file mode 100644 index 08e50b442230..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getCollectionOfPolicyMetadataResources.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. -/** - * This sample demonstrates how to Get a list of the policy metadata resources. - * - * @summary Get a list of the policy metadata resources. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getCollectionOfPolicyMetadataResources() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyMetadataOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getCollectionOfPolicyMetadataResources().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.ts deleted file mode 100644 index a1a9a5efbaef..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter.ts +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Get a list of the policy metadata resources. - * - * @summary Get a list of the policy metadata resources. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyMetadata_List_WithTop.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const top = 1; - const options = { top: top }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyMetadataOperations.list({ queryOptions: options })) { - resArray.push(item); - } - console.log(resArray); -} - -getCollectionOfPolicyMetadataResourcesUsingTopQueryParameter().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtIndividualResourceScope.ts deleted file mode 100644 index d5026672a5e8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtIndividualResourceScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Gets an existing remediation at resource scope. - * - * @summary Gets an existing remediation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getRemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.getAtResource( - resourceId, - remediationName - ); - console.log(result); -} - -getRemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtManagementGroupScope.ts deleted file mode 100644 index 59f3991a625c..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtManagementGroupScope.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. -/** - * This sample demonstrates how to Gets an existing remediation at management group scope. - * - * @summary Gets an existing remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getRemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.getAtManagementGroup( - managementGroupId, - remediationName - ); - console.log(result); -} - -getRemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtResourceGroupScope.ts deleted file mode 100644 index 17fdf837fad8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtResourceGroupScope.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. -/** - * This sample demonstrates how to Gets an existing remediation at resource group scope. - * - * @summary Gets an existing remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getRemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.getAtResourceGroup( - resourceGroupName, - remediationName - ); - console.log(result); -} - -getRemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtSubscriptionScope.ts deleted file mode 100644 index d437b02fe38e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/getRemediationAtSubscriptionScope.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. -/** - * This sample demonstrates how to Gets an existing remediation at subscription scope. - * - * @summary Gets an existing remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_GetSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function getRemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "storageRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.remediations.getAtSubscription(remediationName); - console.log(result); -} - -getRemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtIndividualResourceScope.ts deleted file mode 100644 index d78b8e9c3f87..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Gets all attestations for a resource. - * - * @summary Gets all attestations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listAttestationsAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForResource(resourceId)) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtIndividualResourceScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtIndividualResourceScopeWithQueryParameters.ts deleted file mode 100644 index 72543a1f2842..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtIndividualResourceScopeWithQueryParameters.ts +++ /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. -/** - * This sample demonstrates how to Gets all attestations for a resource. - * - * @summary Gets all attestations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listAttestationsAtIndividualResourceScopeWithQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq '0b158b46-ff42-4799-8e39-08a5c23b4551'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForResource( - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtIndividualResourceScopeWithQueryParameters().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtResourceGroupScope.ts deleted file mode 100644 index 3a96ec905649..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtResourceGroupScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Gets all attestations for the resource group. - * - * @summary Gets all attestations for the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listAttestationsAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtResourceGroupScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtResourceGroupScopeWithQueryParameters.ts deleted file mode 100644 index 353616634e04..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtResourceGroupScopeWithQueryParameters.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. -/** - * This sample demonstrates how to Gets all attestations for the resource group. - * - * @summary Gets all attestations for the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listAttestationsAtResourceGroupScopeWithQueryParameters() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myRg"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq '0b158b46-ff42-4799-8e39-08a5c23b4551'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForResourceGroup( - resourceGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtResourceGroupScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtSubscriptionScope.ts deleted file mode 100644 index 66079751c529..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtSubscriptionScope.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. -/** - * This sample demonstrates how to Gets all attestations for the subscription. - * - * @summary Gets all attestations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listAttestationsAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForSubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtSubscriptionScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtSubscriptionScopeWithQueryParameters.ts deleted file mode 100644 index 6fb4ce1c1339..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listAttestationsAtSubscriptionScopeWithQueryParameters.ts +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Gets all attestations for the subscription. - * - * @summary Gets all attestations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listAttestationsAtSubscriptionScopeWithQueryParameters() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq '0b158b46-ff42-4799-8e39-08a5c23b4551'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.attestations.listForSubscription({ queryOptions: options })) { - resArray.push(item); - } - console.log(resArray); -} - -listAttestationsAtSubscriptionScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtIndividualResourceScope.ts deleted file mode 100644 index 7860080652c8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Gets all deployments for a remediation at resource scope. - * - * @summary Gets all deployments for a remediation at resource scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listDeploymentsForARemediationAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listDeploymentsAtResource( - resourceId, - remediationName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDeploymentsForARemediationAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtManagementGroupScope.ts deleted file mode 100644 index 3a652ef7dc51..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtManagementGroupScope.ts +++ /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. -/** - * This sample demonstrates how to Gets all deployments for a remediation at management group scope. - * - * @summary Gets all deployments for a remediation at management group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listDeploymentsForARemediationAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listDeploymentsAtManagementGroup( - managementGroupId, - remediationName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDeploymentsForARemediationAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtResourceGroupScope.ts deleted file mode 100644 index 758d378d4ba8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtResourceGroupScope.ts +++ /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. -/** - * This sample demonstrates how to Gets all deployments for a remediation at resource group scope. - * - * @summary Gets all deployments for a remediation at resource group scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listDeploymentsForARemediationAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listDeploymentsAtResourceGroup( - resourceGroupName, - remediationName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDeploymentsForARemediationAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtSubscriptionScope.ts deleted file mode 100644 index 63ab42448336..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listDeploymentsForARemediationAtSubscriptionScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Gets all deployments for a remediation at subscription scope. - * - * @summary Gets all deployments for a remediation at subscription scope. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listDeploymentsForARemediationAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const remediationName = "myRemediation"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listDeploymentsAtSubscription( - remediationName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listDeploymentsForARemediationAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listOperations.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listOperations.ts deleted file mode 100644 index 2613ba685c23..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listOperations.ts +++ /dev/null @@ -1,28 +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. -/** - * This sample demonstrates how to Lists available operations. - * - * @summary Lists available operations. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_ListOperations.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listOperations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.operations.list(); - console.log(result); -} - -listOperations().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtIndividualResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtIndividualResourceScope.ts deleted file mode 100644 index 6541b329cf12..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtIndividualResourceScope.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. -/** - * This sample demonstrates how to Gets all remediations for a resource. - * - * @summary Gets all remediations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtIndividualResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForResource(resourceId)) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtIndividualResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtIndividualResourceScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtIndividualResourceScopeWithQueryParameters.ts deleted file mode 100644 index 0c69d4c2d106..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtIndividualResourceScopeWithQueryParameters.ts +++ /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. -/** - * This sample demonstrates how to Gets all remediations for a resource. - * - * @summary Gets all remediations for a resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtIndividualResourceScopeWithQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForResource( - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtIndividualResourceScopeWithQueryParameters().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtManagementGroupScope.ts deleted file mode 100644 index 026d32fd4923..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtManagementGroupScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Gets all remediations for the management group. - * - * @summary Gets all remediations for the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForManagementGroup( - managementGroupId - )) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtManagementGroupScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtManagementGroupScopeWithQueryParameters.ts deleted file mode 100644 index a31440011a1d..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtManagementGroupScopeWithQueryParameters.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. -/** - * This sample demonstrates how to Gets all remediations for the management group. - * - * @summary Gets all remediations for the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListManagementGroupScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtManagementGroupScopeWithQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupId = "financeMg"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForManagementGroup( - managementGroupId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtManagementGroupScopeWithQueryParameters().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtResourceGroupScope.ts deleted file mode 100644 index 032128db933a..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtResourceGroupScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Gets all remediations for the subscription. - * - * @summary Gets all remediations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtResourceGroupScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtResourceGroupScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtResourceGroupScopeWithQueryParameters.ts deleted file mode 100644 index be619c6c2656..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtResourceGroupScopeWithQueryParameters.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. -/** - * This sample demonstrates how to Gets all remediations for the subscription. - * - * @summary Gets all remediations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListResourceGroupScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtResourceGroupScopeWithQueryParameters() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const resourceGroupName = "myResourceGroup"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForResourceGroup( - resourceGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtResourceGroupScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtSubscriptionScope.ts deleted file mode 100644 index 6d77466e547f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtSubscriptionScope.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. -/** - * This sample demonstrates how to Gets all remediations for the subscription. - * - * @summary Gets all remediations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtSubscriptionScope() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForSubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtSubscriptionScopeWithQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtSubscriptionScopeWithQueryParameters.ts deleted file mode 100644 index 0f1598025ff4..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/listRemediationsAtSubscriptionScopeWithQueryParameters.ts +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Gets all remediations for the subscription. - * - * @summary Gets all remediations for the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListSubscriptionScope_WithQuery.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listRemediationsAtSubscriptionScopeWithQueryParameters() { - const subscriptionId = "35ee058e-5fa0-414c-8145-3ebb8d09b6e2"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5' AND PolicyDefinitionReferenceId eq 'storageSkuDef'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.remediations.listForSubscription({ queryOptions: options })) { - resArray.push(item); - } - console.log(resArray); -} - -listRemediationsAtSubscriptionScopeWithQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForPolicyDefinitionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForPolicyDefinitionSample.ts index 7c0e83829745..b1b4db119cbd 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForPolicyDefinitionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForPolicyDefinitionSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryAtSubscriptionLevelPolicyDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForPolicyDefinition( policyEventsResource, - subscriptionId2, + subscriptionId, policyDefinitionName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryAtSubscriptionLevelPolicyDefinitionScope().catch(console.error); async function queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams = { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForPolicySetDefinitionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForPolicySetDefinitionSample.ts index b9a284a7941c..e33403ece2ed 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForPolicySetDefinitionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForPolicySetDefinitionSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryAtSubscriptionLevelPolicySetDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForPolicySetDefinition( policyEventsResource, - subscriptionId2, + subscriptionId, policySetDefinitionName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryAtSubscriptionLevelPolicySetDefinitionScope().catch(console.error); async function queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams = { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts index 205c4960932f..abac3d5491b9 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts @@ -23,7 +23,6 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryAtResourceGroupLevelPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "myPolicyAssignment"; const credential = new DefaultAzureCredential(); @@ -31,7 +30,7 @@ async function queryAtResourceGroupLevelPolicyAssignmentScope() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment( policyEventsResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName )) { @@ -51,7 +50,6 @@ queryAtResourceGroupLevelPolicyAssignmentScope().catch(console.error); async function queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "myPolicyAssignment"; const skipToken = "WpmWfBSvPhkAK6QD"; @@ -63,7 +61,7 @@ async function queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment( policyEventsResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName, options diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForResourceGroupSample.ts index 1fd66a185308..5d7405a97f61 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForResourceGroupSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryAtResourceGroupScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForResourceGroup( policyEventsResource, - subscriptionId2, + subscriptionId, resourceGroupName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryAtResourceGroupScope().catch(console.error); async function queryAtResourceGroupScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyEventsListQueryResultsForResourceGroupOptionalParams = { @@ -60,7 +58,7 @@ async function queryAtResourceGroupScopeWithNextLink() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForResourceGroup( policyEventsResource, - subscriptionId2, + subscriptionId, resourceGroupName, options )) { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts index ccc4a91064ec..c5275a7034ec 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryAtSubscriptionLevelPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment( policyEventsResource, - subscriptionId2, + subscriptionId, policyAssignmentName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryAtSubscriptionLevelPolicyAssignmentScope().catch(console.error); async function queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams = { @@ -60,7 +58,7 @@ async function queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment( policyEventsResource, - subscriptionId2, + subscriptionId, policyAssignmentName, options )) { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForSubscriptionSample.ts index 4765d4313f4a..a990922e5f64 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyEventsListQueryResultsForSubscriptionSample.ts @@ -13,7 +13,6 @@ import { PolicyInsightsClient } from "@azure/arm-policyinsights"; import { DefaultAzureCredential } from "@azure/identity"; -import { to } from "../src/models/parameters"; /** * This sample demonstrates how to Queries policy events for the resources under the subscription. @@ -24,7 +23,6 @@ import { to } from "../src/models/parameters"; async function filterAndAggregateOnly() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const fromParam = new Date("2018-02-05T18:00:00Z"); const filter = "PolicyDefinitionAction eq 'deny'"; const apply = "aggregate($count as NumDenyEvents)"; @@ -36,7 +34,7 @@ async function filterAndAggregateOnly() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -55,7 +53,6 @@ filterAndAggregateOnly().catch(console.error); async function filterAndGroupWithAggregate() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const fromParam = new Date("2018-02-05T18:00:00Z"); const filter = @@ -70,7 +67,7 @@ async function filterAndGroupWithAggregate() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -89,7 +86,6 @@ filterAndGroupWithAggregate().catch(console.error); async function filterAndGroupWithoutAggregate() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const fromParam = new Date("2018-01-05T18:00:00Z"); const filter = @@ -104,7 +100,7 @@ async function filterAndGroupWithoutAggregate() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -123,7 +119,6 @@ filterAndGroupWithoutAggregate().catch(console.error); async function filterAndMultipleGroups() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 10; const orderBy = "NumDeniedResources desc"; const fromParam = new Date("2018-01-01T00:00:00Z"); @@ -138,7 +133,7 @@ async function filterAndMultipleGroups() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -157,13 +152,12 @@ filterAndMultipleGroups().catch(console.error); async function queryAtSubscriptionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2 + subscriptionId )) { resArray.push(item); } @@ -181,7 +175,6 @@ queryAtSubscriptionScope().catch(console.error); async function queryAtSubscriptionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyEventsListQueryResultsForSubscriptionOptionalParams = { queryOptions: { skipToken: skipToken } @@ -191,7 +184,7 @@ async function queryAtSubscriptionScopeWithNextLink() { const resArray = new Array(); for await (let item of client.policyEvents.listQueryResultsForSubscription( policyEventsResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -210,7 +203,6 @@ queryAtSubscriptionScopeWithNextLink().catch(console.error); async function timeRangeSortSelectAndLimit() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyEventsResource = "default"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const orderBy = "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForPolicyDefinitionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForPolicyDefinitionSample.ts index f682c027b5e1..1b78610db260 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForPolicyDefinitionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForPolicyDefinitionSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryLatestAtSubscriptionLevelPolicyDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForPolicyDefinition( policyStatesResource, - subscriptionId2, + subscriptionId, policyDefinitionName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryLatestAtSubscriptionLevelPolicyDefinitionScope().catch(console.error); async function queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams = { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForPolicySetDefinitionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForPolicySetDefinitionSample.ts index fd7a082ac820..87d34a03e3c0 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForPolicySetDefinitionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForPolicySetDefinitionSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryLatestAtSubscriptionLevelPolicySetDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForPolicySetDefinition( policyStatesResource, - subscriptionId2, + subscriptionId, policySetDefinitionName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryLatestAtSubscriptionLevelPolicySetDefinitionScope().catch(console.error); async function queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams = { @@ -60,7 +58,7 @@ async function queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLin const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForPolicySetDefinition( policyStatesResource, - subscriptionId2, + subscriptionId, policySetDefinitionName, options )) { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts index b17274bc95d3..ab5d68ebb561 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentSample.ts @@ -23,7 +23,6 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryLatestAtResourceGroupLevelPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "myPolicyAssignment"; const credential = new DefaultAzureCredential(); @@ -31,7 +30,7 @@ async function queryLatestAtResourceGroupLevelPolicyAssignmentScope() { const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForResourceGroupLevelPolicyAssignment( policyStatesResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName )) { @@ -51,7 +50,6 @@ queryLatestAtResourceGroupLevelPolicyAssignmentScope().catch(console.error); async function queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "myPolicyAssignment"; const skipToken = "WpmWfBSvPhkAK6QD"; @@ -63,7 +61,7 @@ async function queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink( const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForResourceGroupLevelPolicyAssignment( policyStatesResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName, options diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForResourceGroupSample.ts index b57e34c56255..e6061c2d102b 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForResourceGroupSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryLatestAtResourceGroupScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForResourceGroup( policyStatesResource, - subscriptionId2, + subscriptionId, resourceGroupName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryLatestAtResourceGroupScope().catch(console.error); async function queryLatestAtResourceGroupScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyStatesListQueryResultsForResourceGroupOptionalParams = { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts index 30ee88491652..35a99dfe58c9 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function queryLatestAtSubscriptionLevelPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscriptionLevelPolicyAssignment( policyStatesResource, - subscriptionId2, + subscriptionId, policyAssignmentName )) { resArray.push(item); @@ -49,7 +48,6 @@ queryLatestAtSubscriptionLevelPolicyAssignmentScope().catch(console.error); async function queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams = { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForSubscriptionSample.ts index e23e28f686cc..f13f0ae7c2ea 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesListQueryResultsForSubscriptionSample.ts @@ -23,7 +23,6 @@ import { DefaultAzureCredential } from "@azure/identity"; async function filterAndAggregateOnly() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const fromParam = new Date("2019-10-05T18:00:00Z"); const filter = "PolicyDefinitionAction eq 'deny'"; const apply = "aggregate($count as NumDenyStates)"; @@ -35,7 +34,7 @@ async function filterAndAggregateOnly() { const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscription( policyStatesResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -54,7 +53,6 @@ filterAndAggregateOnly().catch(console.error); async function filterAndGroupWithAggregate() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const orderBy = "NumAuditDenyNonComplianceRecords desc"; const fromParam = new Date("2019-10-05T18:00:00Z"); @@ -89,7 +87,6 @@ filterAndGroupWithAggregate().catch(console.error); async function filterAndGroupWithoutAggregate() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const fromParam = new Date("2019-10-05T18:00:00Z"); const filter = @@ -104,7 +101,7 @@ async function filterAndGroupWithoutAggregate() { const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscription( policyStatesResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -123,7 +120,6 @@ filterAndGroupWithoutAggregate().catch(console.error); async function filterAndMultipleGroups() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 10; const orderBy = "NumNonCompliantResources desc"; const filter = "IsCompliant eq false"; @@ -137,7 +133,7 @@ async function filterAndMultipleGroups() { const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscription( policyStatesResource, - subscriptionId2, + subscriptionId, options )) { resArray.push(item); @@ -156,13 +152,12 @@ filterAndMultipleGroups().catch(console.error); async function queryLatestAtSubscriptionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const resArray = new Array(); for await (let item of client.policyStates.listQueryResultsForSubscription( policyStatesResource, - subscriptionId2 + subscriptionId )) { resArray.push(item); } @@ -180,7 +175,6 @@ queryLatestAtSubscriptionScope().catch(console.error); async function queryLatestAtSubscriptionScopeWithNextLink() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const skipToken = "WpmWfBSvPhkAK6QD"; const options: PolicyStatesListQueryResultsForSubscriptionOptionalParams = { queryOptions: { skipToken: skipToken } @@ -209,7 +203,6 @@ queryLatestAtSubscriptionScopeWithNextLink().catch(console.error); async function timeRangeSortSelectAndLimit() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 2; const orderBy = "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId"; diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForPolicyDefinitionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForPolicyDefinitionSample.ts index 3ec21d154cc9..a5f52aaf6045 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForPolicyDefinitionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForPolicyDefinitionSample.ts @@ -20,13 +20,12 @@ import { DefaultAzureCredential } from "@azure/identity"; async function summarizeAtPolicyDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForPolicyDefinition( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, policyDefinitionName ); console.log(result); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForPolicySetDefinitionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForPolicySetDefinitionSample.ts index 82a5f6beba42..a7744067282e 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForPolicySetDefinitionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForPolicySetDefinitionSample.ts @@ -23,7 +23,6 @@ import { DefaultAzureCredential } from "@azure/identity"; async function summarizeAtPolicySetDefinitionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; const top = 1; const fromParam = new Date("2019-10-05T18:00:00Z"); @@ -36,7 +35,7 @@ async function summarizeAtPolicySetDefinitionScope() { const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForPolicySetDefinition( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, policySetDefinitionName, options ); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.ts index 80d1e8c921b5..0c8812bbc3d5 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForResourceGroupLevelPolicyAssignmentSample.ts @@ -20,14 +20,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function summarizeAtPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const policyAssignmentName = "b7a1ca2596524e3ab19597f2"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForResourceGroupLevelPolicyAssignment( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, resourceGroupName, policyAssignmentName ); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForResourceGroupSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForResourceGroupSample.ts index 5e3d3c56301c..d1ed5b78e31d 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForResourceGroupSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForResourceGroupSample.ts @@ -20,13 +20,12 @@ import { DefaultAzureCredential } from "@azure/identity"; async function summarizeAtResourceGroupScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForResourceGroup( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, resourceGroupName ); console.log(result); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.ts index d54879e27720..ac09f8d550c2 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForSubscriptionLevelPolicyAssignmentSample.ts @@ -20,13 +20,12 @@ import { DefaultAzureCredential } from "@azure/identity"; async function summarizeAtPolicyAssignmentScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForSubscriptionLevelPolicyAssignment( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, policyAssignmentName ); console.log(result); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForSubscriptionSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForSubscriptionSample.ts index 794b4763db9c..3cf75a8a970e 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForSubscriptionSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesSummarizeForSubscriptionSample.ts @@ -23,14 +23,13 @@ import { DefaultAzureCredential } from "@azure/identity"; async function summarizeAtSubscriptionScope() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 5; const options: PolicyStatesSummarizeForSubscriptionOptionalParams = { queryOptions: { top: top } }; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.summarizeForSubscription( policyStatesSummaryResource, - subscriptionId2, + subscriptionId, options ); console.log(result); @@ -47,7 +46,6 @@ summarizeAtSubscriptionScope().catch(console.error); async function summarizeAtSubscriptionScopeForAPolicyDefinitionGroup() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const policyStatesSummaryResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const top = 1; const filter = "'group1' IN PolicyDefinitionGroupNames"; const options: PolicyStatesSummarizeForSubscriptionOptionalParams = { diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesTriggerResourceGroupEvaluationSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesTriggerResourceGroupEvaluationSample.ts index 2664fdddcaf3..3466124927ba 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesTriggerResourceGroupEvaluationSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesTriggerResourceGroupEvaluationSample.ts @@ -19,12 +19,11 @@ import { DefaultAzureCredential } from "@azure/identity"; */ async function triggerEvaluationsForAllResourcesInAResourceGroup() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const resourceGroupName = "myResourceGroup"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.beginTriggerResourceGroupEvaluationAndWait( - subscriptionId2, + subscriptionId, resourceGroupName ); console.log(result); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesTriggerSubscriptionEvaluationSample.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesTriggerSubscriptionEvaluationSample.ts index 802c30dc79fc..32c9ff36eb13 100644 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesTriggerSubscriptionEvaluationSample.ts +++ b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/policyStatesTriggerSubscriptionEvaluationSample.ts @@ -19,11 +19,10 @@ import { DefaultAzureCredential } from "@azure/identity"; */ async function triggerEvaluationsForAllResourcesInASubscription() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; const credential = new DefaultAzureCredential(); const client = new PolicyInsightsClient(credential, subscriptionId); const result = await client.policyStates.beginTriggerSubscriptionEvaluationAndWait( - subscriptionId2 + subscriptionId ); console.log(result); } diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtNestedResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtNestedResourceScope.ts deleted file mode 100644 index fe6529dedfec..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtNestedResourceScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryNestedResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAllPolicyStatesAtNestedResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtNestedResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtResourceScope.ts deleted file mode 100644 index 8d98c610843a..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtResourceScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAllPolicyStatesAtResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.ts deleted file mode 100644 index e0d636ad9723..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const expand = "PolicyEvaluationDetails"; - const options = { expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtResourceScopeAndExpandPolicyEvaluationDetails().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtResourceScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtResourceScopeWithNextLink.ts deleted file mode 100644 index a734e12fbcd8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtResourceScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAllPolicyStatesAtResourceScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtResourceScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.ts deleted file mode 100644 index 10f17691b8ba..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelNestedResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtSubscriptionLevelNestedResourceScope().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtSubscriptionLevelResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtSubscriptionLevelResourceScope.ts deleted file mode 100644 index fb7bc751025d..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAllPolicyStatesAtSubscriptionLevelResourceScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAllPolicyStatesAtSubscriptionLevelResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "default"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAllPolicyStatesAtSubscriptionLevelResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtManagementGroupScope.ts deleted file mode 100644 index 1a83d090048e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtManagementGroupScope.ts +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Queries policy events for the resources under the management group. - * - * @summary Queries policy events for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupName = "myManagementGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForManagementGroup( - "default", - managementGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtManagementGroupScopeUsingQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtManagementGroupScopeUsingQueryParameters.ts deleted file mode 100644 index 1a5a3be1bccc..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtManagementGroupScopeUsingQueryParameters.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. -/** - * This sample demonstrates how to Queries policy tracked resources under the management group. - * - * @summary Queries policy tracked resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryManagementGroupScopeWithFilterAndTop.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtManagementGroupScopeUsingQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupName = "myManagementGroup"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyTrackedResources.listQueryResultsForManagementGroup( - managementGroupName, - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtManagementGroupScopeUsingQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtManagementGroupScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtManagementGroupScopeWithNextLink.ts deleted file mode 100644 index e080f8bd199f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtManagementGroupScopeWithNextLink.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resources under the management group. - * - * @summary Queries policy events for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryManagementGroupScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtManagementGroupScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupName = "myManagementGroup"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForManagementGroup( - managementGroupName, - "", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtManagementGroupScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtNestedResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtNestedResourceScope.ts deleted file mode 100644 index 2a9adc4acca9..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtNestedResourceScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryNestedResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtNestedResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - "default", - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtNestedResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupLevelPolicyAssignmentScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupLevelPolicyAssignmentScope.ts deleted file mode 100644 index 533dd9682d22..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupLevelPolicyAssignmentScope.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. -/** - * This sample demonstrates how to Queries policy events for the resource group level policy assignment. - * - * @summary Queries policy events for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceGroupLevelPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "myPolicyAssignment"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment( - "default", - subscriptionId2, - resourceGroupName, - policyAssignmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupLevelPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.ts deleted file mode 100644 index e5352b9dfe89..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the resource group level policy assignment. - * - * @summary Queries policy events for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "myPolicyAssignment"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment( - "default", - subscriptionId2, - resourceGroupName, - policyAssignmentName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupScope.ts deleted file mode 100644 index a15b84f40393..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupScope.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. -/** - * This sample demonstrates how to Queries policy events for the resources under the resource group. - * - * @summary Queries policy events for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResourceGroup( - "default", - subscriptionId2, - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupScopeUsingQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupScopeUsingQueryParameters.ts deleted file mode 100644 index ca4b21a2be29..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupScopeUsingQueryParameters.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. -/** - * This sample demonstrates how to Queries policy tracked resources under the resource group. - * - * @summary Queries policy tracked resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceGroupScopeWithFilterAndTop.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceGroupScopeUsingQueryParameters() { - const subscriptionId = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource/nestedResourceType/TrackedResource1'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyTrackedResources.listQueryResultsForResourceGroup( - resourceGroupName, - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupScopeUsingQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupScopeWithNextLink.ts deleted file mode 100644 index 87fa418b4658..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceGroupScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the resources under the resource group. - * - * @summary Queries policy events for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceGroupScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceGroupScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResourceGroup( - "default", - subscriptionId2, - resourceGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceGroupScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceScope.ts deleted file mode 100644 index a67bc347c8c8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - "default", - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceScopeUsingQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceScopeUsingQueryParameters.ts deleted file mode 100644 index 2df6a37510be..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceScopeUsingQueryParameters.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. -/** - * This sample demonstrates how to Queries policy tracked resources under the resource. - * - * @summary Queries policy tracked resources under the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceScopeWithFilterAndTop.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceScopeUsingQueryParameters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource/nestedResourceType/TrackedResource1'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyTrackedResources.listQueryResultsForResource( - resourceId, - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceScopeUsingQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceScopeWithNextLink.ts deleted file mode 100644 index b673111c3a5f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtResourceScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtResourceScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - resourceId, - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtResourceScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelNestedResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelNestedResourceScope.ts deleted file mode 100644 index 49468aaafafa..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelNestedResourceScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelNestedResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelNestedResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - resourceId, - "default" - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelNestedResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyAssignmentScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyAssignmentScope.ts deleted file mode 100644 index 5cc13e36792e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyAssignmentScope.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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy assignment. - * - * @summary Queries policy events for the subscription level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment( - "default", - subscriptionId2, - policyAssignmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts deleted file mode 100644 index 1e58b8e55f37..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy assignment. - * - * @summary Queries policy events for the subscription level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment( - "default", - subscriptionId2, - policyAssignmentName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyDefinitionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyDefinitionScope.ts deleted file mode 100644 index d10e59b5d09f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyDefinitionScope.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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy definition. - * - * @summary Queries policy events for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelPolicyDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForPolicyDefinition( - "default", - subscriptionId2, - policyDefinitionName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicyDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts deleted file mode 100644 index 3db9bf5bdd4b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy definition. - * - * @summary Queries policy events for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForPolicyDefinition( - "default", - subscriptionId2, - policyDefinitionName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicySetDefinitionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicySetDefinitionScope.ts deleted file mode 100644 index 9a062f33ed1b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicySetDefinitionScope.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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy set definition. - * - * @summary Queries policy events for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelPolicySetDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForPolicySetDefinition( - "deault", - subscriptionId2, - policySetDefinitionName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicySetDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts deleted file mode 100644 index 8a3c9ae01bfe..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the subscription level policy set definition. - * - * @summary Queries policy events for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForPolicySetDefinition( - "default", - subscriptionId2, - policySetDefinitionName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelResourceScope.ts deleted file mode 100644 index 6dbb71638a6d..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionLevelResourceScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionLevelResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionLevelResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - "default", - resourceId - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionLevelResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionScope.ts deleted file mode 100644 index 6d297117954e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionScope.ts +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Queries policy events for the resources under the subscription. - * - * @summary Queries policy events for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForSubscription( - "default", - subscriptionId2 - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionScopeUsingQueryParameters.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionScopeUsingQueryParameters.ts deleted file mode 100644 index 776296ffe4ac..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionScopeUsingQueryParameters.ts +++ /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. -/** - * This sample demonstrates how to Queries policy tracked resources under the subscription. - * - * @summary Queries policy tracked resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QuerySubscriptionScopeWithFilterAndTop.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionScopeUsingQueryParameters() { - const subscriptionId = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 1; - const filter = - "PolicyAssignmentId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment' AND TrackedResourceId eq '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/exampleTrackedResourceName'"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyTrackedResources.listQueryResultsForSubscription( - "default", - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionScopeUsingQueryParameters().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionScopeWithNextLink.ts deleted file mode 100644 index dcb68937a383..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryAtSubscriptionScopeWithNextLink.ts +++ /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. -/** - * This sample demonstrates how to Queries policy events for the resources under the subscription. - * - * @summary Queries policy events for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QuerySubscriptionScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryAtSubscriptionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForSubscription( - "default", - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryAtSubscriptionScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.ts deleted file mode 100644 index 7f8810489826..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandComponents.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const resourceId = - "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName"; - const filter = - "policyAssignmentId eq '/subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/providers/microsoft.authorization/policyassignments/560050f83dbb4a24974323f8'"; - const expand = - "components($filter=ComplianceState eq 'NonCompliant' or ComplianceState eq 'Compliant')"; - const options = { filter: filter, expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryComponentPolicyComplianceStateAtResourceScopeFilteredByGivenAssignment().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.ts deleted file mode 100644 index 66f7c8bb883e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment.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. -/** - * This sample demonstrates how to Queries policy states for the resource. - * - * @summary Queries policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceScopeExpandComponentsGroupByWithAggregate.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const resourceId = - "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName"; - const filter = - "policyAssignmentId eq '/subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/providers/microsoft.authorization/policyassignments/560050f83dbb4a24974323f8'"; - const expand = - "components($filter=ComplianceState eq 'NonCompliant' or ComplianceState eq 'Compliant';$apply=groupby((complianceState),aggregate($count as count)))"; - const options = { filter: filter, expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResource( - policyStatesResource, - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryComponentPolicyComplianceStateCountGroupedByStateTypeAtResourceScopeFilteredByGivenAssignment().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.ts deleted file mode 100644 index 4fcc723e5157..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment.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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeExpandComponentsGroupByWithAggregate.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName"; - const filter = - "policyAssignmentId eq '/subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/providers/microsoft.authorization/policyassignments/560050f83dbb4a24974323f8'"; - const expand = - "components($apply=groupby((tenantId, principalOid, policyDefinitionAction), aggregate($count as totalActions)))"; - const options = { filter: filter, expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - "default", - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryComponentsPolicyEventsCountGroupedByUserAndActionTypeForResourceScopeFilteredByGivenAssignment().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.ts deleted file mode 100644 index 377a332d02aa..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment.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. -/** - * This sample demonstrates how to Queries policy events for the resource. - * - * @summary Queries policy events for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyEvents_QueryResourceScopeExpandComponents.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName"; - const filter = - "policyAssignmentId eq '/subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/providers/microsoft.authorization/policyassignments/560050f83dbb4a24974323f8'"; - const expand = "components"; - const options = { filter: filter, expand: expand }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyEvents.listQueryResultsForResource( - "default", - resourceId, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryComponentsPolicyEventsForResourceScopeFilteredByGivenAssignment().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtManagementGroupScope.ts deleted file mode 100644 index dc3f3fd58016..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtManagementGroupScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the management group. - * - * @summary Queries policy states for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const managementGroupName = "myManagementGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForManagementGroup( - policyStatesResource, - managementGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtManagementGroupScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtManagementGroupScopeWithNextLink.ts deleted file mode 100644 index 39e5a7fb02c0..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtManagementGroupScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the management group. - * - * @summary Queries policy states for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryManagementGroupScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtManagementGroupScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const managementGroupName = "myManagementGroup"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForManagementGroup( - policyStatesResource, - managementGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtManagementGroupScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupLevelPolicyAssignmentScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupLevelPolicyAssignmentScope.ts deleted file mode 100644 index 9c9797f41c8d..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupLevelPolicyAssignmentScope.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. -/** - * This sample demonstrates how to Queries policy states for the resource group level policy assignment. - * - * @summary Queries policy states for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtResourceGroupLevelPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "myPolicyAssignment"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResourceGroupLevelPolicyAssignment( - policyStatesResource, - subscriptionId2, - resourceGroupName, - policyAssignmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtResourceGroupLevelPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.ts deleted file mode 100644 index 62c366ff9ad7..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resource group level policy assignment. - * - * @summary Queries policy states for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "myPolicyAssignment"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResourceGroupLevelPolicyAssignment( - policyStatesResource, - subscriptionId2, - resourceGroupName, - policyAssignmentName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtResourceGroupLevelPolicyAssignmentScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupScope.ts deleted file mode 100644 index 982e75daef28..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the resource group. - * - * @summary Queries policy states for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResourceGroup( - policyStatesResource, - subscriptionId2, - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupScopeWithNextLink.ts deleted file mode 100644 index 914aae70fd22..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtResourceGroupScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the resource group. - * - * @summary Queries policy states for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QueryResourceGroupScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtResourceGroupScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForResourceGroup( - policyStatesResource, - subscriptionId2, - resourceGroupName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtResourceGroupScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyAssignmentScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyAssignmentScope.ts deleted file mode 100644 index ee13862c528a..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyAssignmentScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy assignment. - * - * @summary Queries policy states for the subscription level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionLevelPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscriptionLevelPolicyAssignment( - policyStatesResource, - subscriptionId2, - policyAssignmentName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.ts deleted file mode 100644 index adfa49a6b320..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy assignment. - * - * @summary Queries policy states for the subscription level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyAssignmentName = "ec8f9645-8ecb-4abb-9c0b-5292f19d4003"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscriptionLevelPolicyAssignment( - policyStatesResource, - subscriptionId2, - policyAssignmentName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicyAssignmentScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyDefinitionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyDefinitionScope.ts deleted file mode 100644 index f43fb95a0cbc..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyDefinitionScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy definition. - * - * @summary Queries policy states for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionLevelPolicyDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForPolicyDefinition( - policyStatesResource, - subscriptionId2, - policyDefinitionName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicyDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.ts deleted file mode 100644 index 6af824a7ddd8..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy definition. - * - * @summary Queries policy states for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForPolicyDefinition( - policyStatesResource, - subscriptionId2, - policyDefinitionName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicyDefinitionScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicySetDefinitionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicySetDefinitionScope.ts deleted file mode 100644 index e2a442c1ac30..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicySetDefinitionScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy set definition. - * - * @summary Queries policy states for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionLevelPolicySetDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForPolicySetDefinition( - policyStatesResource, - subscriptionId2, - policySetDefinitionName - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicySetDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.ts deleted file mode 100644 index 4c30aa2af3d6..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the subscription level policy set definition. - * - * @summary Queries policy states for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForPolicySetDefinition( - policyStatesResource, - subscriptionId2, - policySetDefinitionName, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink().catch( - console.error -); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionScope.ts deleted file mode 100644 index 691bea19bc0b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionScope.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2 - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionScopeWithNextLink.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionScopeWithNextLink.ts deleted file mode 100644 index 54869fae4927..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/queryLatestAtSubscriptionScopeWithNextLink.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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_QuerySubscriptionScopeNextLink.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function queryLatestAtSubscriptionScopeWithNextLink() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const skipToken = "WpmWfBSvPhkAK6QD"; - const options = { skipToken: skipToken }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -queryLatestAtSubscriptionScopeWithNextLink().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtManagementGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtManagementGroupScope.ts deleted file mode 100644 index 34c8dfc67d86..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtManagementGroupScope.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. -/** - * This sample demonstrates how to Summarizes policy states for the resources under the management group. - * - * @summary Summarizes policy states for the resources under the management group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeManagementGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtManagementGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const managementGroupName = "myManagementGroup"; - const top = 0; - const from = new Date("2019-10-05T18:00:00Z"); - const to = new Date("2019-10-06T18:00:00Z"); - const filter = - "PolicyDefinitionAction eq 'deny' or PolicyDefinitionAction eq 'audit'"; - const options = { top: top, from: from, to: to, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForManagementGroup( - "latest", - managementGroupName, - { queryOptions: options } - ); - console.log(result); -} - -summarizeAtManagementGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtPolicyAssignmentScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtPolicyAssignmentScope.ts deleted file mode 100644 index 719ef2098d62..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtPolicyAssignmentScope.ts +++ /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. -/** - * This sample demonstrates how to Summarizes policy states for the resource group level policy assignment. - * - * @summary Summarizes policy states for the resource group level policy assignment. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtPolicyAssignmentScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const policyAssignmentName = "b7a1ca2596524e3ab19597f2"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForResourceGroupLevelPolicyAssignment( - "latest", - subscriptionId, - resourceGroupName, - policyAssignmentName - ); - console.log(result); -} - -summarizeAtPolicyAssignmentScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtPolicyDefinitionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtPolicyDefinitionScope.ts deleted file mode 100644 index d5dc2d3c7136..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtPolicyDefinitionScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Summarizes policy states for the subscription level policy definition. - * - * @summary Summarizes policy states for the subscription level policy definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtPolicyDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policyDefinitionName = "24813039-7534-408a-9842-eb99f45721b1"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForPolicyDefinition( - "", - subscriptionId2, - policyDefinitionName - ); - console.log(result); -} - -summarizeAtPolicyDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtPolicySetDefinitionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtPolicySetDefinitionScope.ts deleted file mode 100644 index 50a67f1da647..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtPolicySetDefinitionScope.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. -/** - * This sample demonstrates how to Summarizes policy states for the subscription level policy set definition. - * - * @summary Summarizes policy states for the subscription level policy set definition. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtPolicySetDefinitionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const policySetDefinitionName = "3e3807c1-65c9-49e0-a406-82d8ae3e338c"; - const top = 1; - const from = new Date("2019-10-05T18:00:00Z"); - const to = new Date("2019-10-06T18:00:00Z"); - const filter = "PolicyDefinitionAction eq 'deny'"; - const options = { top: top, from: from, to: to, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForPolicySetDefinition( - "latest", - subscriptionId2, - policySetDefinitionName, - { queryOptions: options } - ); - console.log(result); -} - -summarizeAtPolicySetDefinitionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtResourceGroupScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtResourceGroupScope.ts deleted file mode 100644 index aa18a664a94f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtResourceGroupScope.ts +++ /dev/null @@ -1,34 +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. -/** - * This sample demonstrates how to Summarizes policy states for the resources under the resource group. - * - * @summary Summarizes policy states for the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceGroupScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtResourceGroupScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForResourceGroup( - "latest", - subscriptionId2, - resourceGroupName - ); - console.log(result); -} - -summarizeAtResourceGroupScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtResourceScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtResourceScope.ts deleted file mode 100644 index 94d1bb91a589..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtResourceScope.ts +++ /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. -/** - * This sample demonstrates how to Summarizes policy states for the resource. - * - * @summary Summarizes policy states for the resource. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeResourceScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtResourceScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceId = - "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault"; - const top = 2; - const options = { top: top }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForResource( - "latest", - resourceId, - { queryOptions: options } - ); - console.log(result); -} - -summarizeAtResourceScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtSubscriptionScope.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtSubscriptionScope.ts deleted file mode 100644 index d6c4a2510269..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtSubscriptionScope.ts +++ /dev/null @@ -1,35 +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. -/** - * This sample demonstrates how to Summarizes policy states for the resources under the subscription. - * - * @summary Summarizes policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScope.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtSubscriptionScope() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 5; - const options = { top: top }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForSubscription( - "latest", - subscriptionId2, - { queryOptions: options } - ); - console.log(result); -} - -summarizeAtSubscriptionScope().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.ts deleted file mode 100644 index 6c94dc57cfe9..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/summarizeAtSubscriptionScopeForAPolicyDefinitionGroup.ts +++ /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. -/** - * This sample demonstrates how to Summarizes policy states for the resources under the subscription. - * - * @summary Summarizes policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_SummarizeSubscriptionScopeForPolicyGroup.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function summarizeAtSubscriptionScopeForAPolicyDefinitionGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 1; - const filter = "'group1' IN PolicyDefinitionGroupNames"; - const options = { top: top, filter: filter }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.summarizeForSubscription( - "latest", - subscriptionId2, - { queryOptions: options } - ); - console.log(result); -} - -summarizeAtSubscriptionScopeForAPolicyDefinitionGroup().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/timeRangeSortSelectAndLimit.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/timeRangeSortSelectAndLimit.ts deleted file mode 100644 index b9b33450cc7f..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/timeRangeSortSelectAndLimit.ts +++ /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. -/** - * This sample demonstrates how to Queries policy states for the resources under the subscription. - * - * @summary Queries policy states for the resources under the subscription. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TimeRangeSortSelectTop.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function timeRangeSortSelectAndLimit() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const policyStatesResource = "latest"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const top = 2; - const orderBy = - "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId"; - const select = - "Timestamp, PolicyAssignmentId, PolicyDefinitionId, SubscriptionId, ResourceGroup, ResourceId, policyDefinitionGroupNames"; - const from = new Date("2019-10-05T18:00:00Z"); - const to = new Date("2019-10-06T18:00:00Z"); - const options = { - top: top, - orderBy: orderBy, - select: select, - from: from, - to: to - }; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.policyStates.listQueryResultsForSubscription( - policyStatesResource, - subscriptionId2, - { queryOptions: options } - )) { - resArray.push(item); - } - console.log(resArray); -} - -timeRangeSortSelectAndLimit().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/triggerEvaluationsForAllResourcesInAResourceGroup.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/triggerEvaluationsForAllResourcesInAResourceGroup.ts deleted file mode 100644 index 88a35dfdbf59..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/triggerEvaluationsForAllResourcesInAResourceGroup.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. -/** - * This sample demonstrates how to Triggers a policy evaluation scan for all the resources under the resource group. - * - * @summary Triggers a policy evaluation scan for all the resources under the resource group. - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function triggerEvaluationsForAllResourcesInAResourceGroup() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.beginTriggerResourceGroupEvaluationAndWait( - subscriptionId2, - resourceGroupName - ); - console.log(result); -} - -triggerEvaluationsForAllResourcesInAResourceGroup().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/triggerEvaluationsForAllResourcesInASubscription.ts b/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/triggerEvaluationsForAllResourcesInASubscription.ts deleted file mode 100644 index 42f97f1298ac..000000000000 --- a/sdk/policyinsights/arm-policyinsights/samples/v6-beta/typescript/src/triggerEvaluationsForAllResourcesInASubscription.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. -/** - * This sample demonstrates how to Triggers a policy evaluation scan for all the resources under the subscription - * - * @summary Triggers a policy evaluation scan for all the resources under the subscription - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json - */ -import { PolicyInsightsClient } from "@azure/arm-policyinsights"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function triggerEvaluationsForAllResourcesInASubscription() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const subscriptionId2 = "fffedd8f-ffff-fffd-fffd-fffed2f84852"; - const credential = new DefaultAzureCredential(); - const client = new PolicyInsightsClient(credential, subscriptionId); - const result = await client.policyStates.beginTriggerSubscriptionEvaluationAndWait( - subscriptionId2 - ); - console.log(result); -} - -triggerEvaluationsForAllResourcesInASubscription().catch(console.error); diff --git a/sdk/policyinsights/arm-policyinsights/src/models/index.ts b/sdk/policyinsights/arm-policyinsights/src/models/index.ts index 023894da5a0e..9b48cabbaf98 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/index.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/index.ts @@ -1113,7 +1113,7 @@ export interface ErrorDefinitionAutoGenerated2 { } /** The properties of the policy metadata. */ -export type PolicyMetadataProperties = PolicyMetadataSlimProperties & { +export interface PolicyMetadataProperties extends PolicyMetadataSlimProperties { /** * The description of the policy metadata. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1124,10 +1124,10 @@ export type PolicyMetadataProperties = PolicyMetadataSlimProperties & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly requirements?: string; -}; +} /** An attestation resource. */ -export type Attestation = Resource & { +export interface Attestation extends Resource { /** * Azure Resource Manager metadata containing createdBy and modifiedBy information. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1157,7 +1157,11 @@ export type Attestation = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastComplianceStateChangeAt?: Date; -}; + /** The time the evidence was assessed */ + assessmentDate?: Date; + /** Additional metadata for this attestation */ + metadata?: Record; +} /** Parameter group */ export interface QueryOptions { @@ -1183,6 +1187,7 @@ export interface QueryOptions { /** Known values of {@link PolicyTrackedResourcesResourceType} that the service accepts. */ export enum KnownPolicyTrackedResourcesResourceType { + /** Default */ Default = "default" } @@ -1215,9 +1220,13 @@ export type ResourceDiscoveryMode = string; /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { + /** User */ User = "User", + /** Application */ Application = "Application", + /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", + /** Key */ Key = "Key" } @@ -1235,6 +1244,7 @@ export type CreatedByType = string; /** Known values of {@link PolicyEventsResourceType} that the service accepts. */ export enum KnownPolicyEventsResourceType { + /** Default */ Default = "default" } @@ -1249,7 +1259,9 @@ export type PolicyEventsResourceType = string; /** Known values of {@link PolicyStatesResource} that the service accepts. */ export enum KnownPolicyStatesResource { + /** Default */ Default = "default", + /** Latest */ Latest = "latest" } @@ -1265,6 +1277,7 @@ export type PolicyStatesResource = string; /** Known values of {@link PolicyStatesSummaryResourceType} that the service accepts. */ export enum KnownPolicyStatesSummaryResourceType { + /** Latest */ Latest = "latest" } diff --git a/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts b/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts index 167d6bd2cc96..5546ecf73f9e 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts @@ -2589,6 +2589,19 @@ export const Attestation: coreClient.CompositeMapper = { type: { name: "DateTime" } + }, + assessmentDate: { + serializedName: "properties.assessmentDate", + type: { + name: "DateTime" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } } } } diff --git a/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts b/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts index 195eefce6a97..025c45f79031 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts @@ -431,7 +431,7 @@ export const parameters2: OperationParameter = { export const apiVersion4: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-01-01", + defaultValue: "2022-09-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts b/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts index 56c8a738e6fa..c9e05c9d3d3d 100644 --- a/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts +++ b/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts @@ -7,6 +7,7 @@ */ import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { PolicyTrackedResourcesImpl, @@ -80,6 +81,36 @@ export class PolicyInsightsClient extends coreClient.ServiceClient { options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName + ); + } + 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; diff --git a/sdk/policyinsights/arm-policyinsights/test/policyinsights_example.spec.ts b/sdk/policyinsights/arm-policyinsights/test/policyinsights_example.spec.ts new file mode 100644 index 000000000000..575171b48aba --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/test/policyinsights_example.spec.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + Recorder, + RecorderStartOptions, + delay, + isPlaybackMode, +} from "@azure-tools/test-recorder"; +import { createTestCredential } from "@azure-tools/test-credential"; +import { assert } from "chai"; +import { Context } from "mocha"; +import { PolicyInsightsClient } from "../src/policyInsightsClient"; + +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 = { + updateIntervalInMs: isPlaybackMode() ? 0 : undefined, +}; + +describe("policyinsights test", () => { + let recorder: Recorder; + let subscriptionId: string; + let client: PolicyInsightsClient; + let location: string; + let resourceGroup: string; + let attestationName: string; + + beforeEach(async function (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + subscriptionId = env.SUBSCRIPTION_ID || ''; + // This is an example of how the environment variables are used + const credential = createTestCredential(); + client = new PolicyInsightsClient(credential, subscriptionId, recorder.configureClientOptions({})); + location = "eastus"; + resourceGroup = "myjstest"; + attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e"; + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("attestations list test", async function () { + const resArray = new Array(); + for await (let item of client.attestations.listForResourceGroup(resourceGroup)) { + resArray.push(item); + } + assert.equal(resArray.length, 0); + }); +}) diff --git a/sdk/policyinsights/arm-policyinsights/test/sampleTest.ts b/sdk/policyinsights/arm-policyinsights/test/sampleTest.ts deleted file mode 100644 index 7ed89b043e1b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/test/sampleTest.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - record, - RecorderEnvironmentSetup, - Recorder -} from "@azure-tools/test-recorder"; -import * as assert from "assert"; - -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: [] -}; - -describe("My test", () => { - let recorder: Recorder; - - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); - }); - - afterEach(async function() { - await recorder.stop(); - }); - - it("sample test", async function() { - console.log("Hi, I'm a test!"); - }); -});