diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7ba3be0dec44..e21f5ed634f4 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -12,6 +12,7 @@ specifiers: '@rush-temp/ai-metrics-advisor': file:./projects/ai-metrics-advisor.tgz '@rush-temp/ai-personalizer': file:./projects/ai-personalizer.tgz '@rush-temp/ai-text-analytics': file:./projects/ai-text-analytics.tgz + '@rush-temp/ai-translation-text': file:./projects/ai-translation-text.tgz '@rush-temp/api-management-custom-widgets-scaffolder': file:./projects/api-management-custom-widgets-scaffolder.tgz '@rush-temp/api-management-custom-widgets-tools': file:./projects/api-management-custom-widgets-tools.tgz '@rush-temp/app-configuration': file:./projects/app-configuration.tgz @@ -217,7 +218,6 @@ specifiers: '@rush-temp/arm-workloads': file:./projects/arm-workloads.tgz '@rush-temp/arm-workspaces': file:./projects/arm-workspaces.tgz '@rush-temp/attestation': file:./projects/attestation.tgz - '@rush-temp/ai-translation-text': file:./projects/ai-translation-text.tgz '@rush-temp/communication-alpha-ids': file:./projects/communication-alpha-ids.tgz '@rush-temp/communication-call-automation': file:./projects/communication-call-automation.tgz '@rush-temp/communication-chat': file:./projects/communication-chat.tgz @@ -350,6 +350,7 @@ dependencies: '@rush-temp/ai-metrics-advisor': file:projects/ai-metrics-advisor.tgz '@rush-temp/ai-personalizer': file:projects/ai-personalizer.tgz '@rush-temp/ai-text-analytics': file:projects/ai-text-analytics.tgz + '@rush-temp/ai-translation-text': file:projects/ai-translation-text.tgz '@rush-temp/api-management-custom-widgets-scaffolder': file:projects/api-management-custom-widgets-scaffolder.tgz '@rush-temp/api-management-custom-widgets-tools': file:projects/api-management-custom-widgets-tools.tgz '@rush-temp/app-configuration': file:projects/app-configuration.tgz @@ -555,7 +556,6 @@ dependencies: '@rush-temp/arm-workloads': file:projects/arm-workloads.tgz '@rush-temp/arm-workspaces': file:projects/arm-workspaces.tgz '@rush-temp/attestation': file:projects/attestation.tgz - '@rush-temp/ai-translation-text': file:projects/ai-translation-text.tgz '@rush-temp/communication-alpha-ids': file:projects/communication-alpha-ids.tgz '@rush-temp/communication-call-automation': file:projects/communication-call-automation.tgz '@rush-temp/communication-chat': file:projects/communication-chat.tgz @@ -738,6 +738,7 @@ packages: /@azure/ai-form-recognizer/3.1.0-beta.3: resolution: {integrity: sha512-+4QtFKNyxAmdqpcYjuAtmWKm/MuOe9kZsbpS9jA9h0YHzngNj5gc67AA4egV9BXOq9x+1phjYTNC/rxiOUr1uQ==} engines: {node: '>=8.0.0'} + deprecated: Please migrate to a supported (non-beta) version of this package dependencies: '@azure/core-auth': 1.4.0 '@azure/core-http': 1.2.6 @@ -2012,22 +2013,6 @@ packages: - supports-color dev: false - /@rollup/plugin-commonjs/21.1.0_rollup@2.79.1: - resolution: {integrity: sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA==} - engines: {node: '>= 8.0.0'} - peerDependencies: - rollup: ^2.38.3 - dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.79.1 - commondir: 1.0.1 - estree-walker: 2.0.2 - glob: 7.2.3 - is-reference: 1.2.1 - magic-string: 0.25.9 - resolve: 1.22.1 - rollup: 2.79.1 - dev: false - /@rollup/plugin-commonjs/24.0.1_rollup@2.79.1: resolution: {integrity: sha512-15LsiWRZk4eOGqvrJyu3z3DaBu5BhXIMeWnijSRvd8irrrg9SHpQ1pH+BUK4H6Z9wL9yOxZJMTLU+Au86XHxow==} engines: {node: '>=14.0.0'} @@ -2061,15 +2046,6 @@ packages: rollup: 2.79.1 dev: false - /@rollup/plugin-json/4.1.0_rollup@2.79.1: - resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} - peerDependencies: - rollup: ^1.20.0 || ^2.0.0 - dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.79.1 - rollup: 2.79.1 - dev: false - /@rollup/plugin-json/6.0.0_rollup@2.79.1: resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==} engines: {node: '>=14.0.0'} @@ -2083,17 +2059,6 @@ packages: rollup: 2.79.1 dev: false - /@rollup/plugin-multi-entry/4.1.0_rollup@2.79.1: - resolution: {integrity: sha512-nellK5pr50W0JA2+bDJbG8F79GBP802J40YRoC0wyfpTAeAn5mJ4eaFiB/MN+YoX9hgb/6RJoZl9leDjZnUFKw==} - engines: {node: '>=10.0.0'} - peerDependencies: - rollup: ^1.20.0 || ^2.0.0 - dependencies: - '@rollup/plugin-virtual': 2.1.0_rollup@2.79.1 - matched: 5.0.1 - rollup: 2.79.1 - dev: false - /@rollup/plugin-multi-entry/6.0.0_rollup@2.79.1: resolution: {integrity: sha512-msBgVncGQwh/ahxeP/rc8MXVZNBOjoVCsBuDk6uqyFzDv/SZN7jksfAsu6DJ2w4r5PaBX3/OXOjVPeCxya2waA==} engines: {node: '>=14.0.0'} @@ -2157,15 +2122,6 @@ packages: typescript: 4.8.4 dev: false - /@rollup/plugin-virtual/2.1.0_rollup@2.79.1: - resolution: {integrity: sha512-CPPAtlKT53HFqC8jFHb/V5WErpU8Hrq2TyCR0A7kPQMlF2wNUf0o1xuAc+Qxj8NCZM0Z3Yvl+FbUXfJjVWqDwA==} - engines: {node: '>=8.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0 - dependencies: - rollup: 2.79.1 - dev: false - /@rollup/plugin-virtual/3.0.1_rollup@2.79.1: resolution: {integrity: sha512-fK8O0IL5+q+GrsMLuACVNk2x21g3yaw+sG2qn16SnUd3IlBsQyvWxLMGHmCmXRMecPjGRSZ/1LmZB4rjQm68og==} engines: {node: '>=14.0.0'} @@ -4017,7 +3973,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230412 + typescript: 5.1.0-dev.20230416 dev: false /ecdsa-sig-formatter/1.0.11: @@ -6377,12 +6333,6 @@ packages: engines: {node: '>=12'} dev: false - /magic-string/0.25.9: - resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==} - dependencies: - sourcemap-codec: 1.4.8 - dev: false - /magic-string/0.27.0: resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==} engines: {node: '>=12'} @@ -8266,11 +8216,6 @@ packages: engines: {node: '>= 8'} dev: false - /sourcemap-codec/1.4.8: - resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} - deprecated: Please use @jridgewell/sourcemap-codec instead - dev: false - /spawn-command/0.0.2-1: resolution: {integrity: sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg==} dev: false @@ -8880,9 +8825,9 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230412: - resolution: {integrity: sha512-O7UY8wd8wEa6pd6CpVFbS9u+DArm73B4rRz8dwm6SDORvEF7rbuNzJ6GTTnBvGavlVkWT5/cYstySs5uhj0vPg==} - engines: {node: '>=12.20'} + /typescript/5.1.0-dev.20230416: + resolution: {integrity: sha512-LdNpnAyqzCIcx7R5/cZDGlsxGTL4j+omGMhMYVCVaroMOFZBnMtzUJSlMIO9yHBjN5ENSVJ2+Pq57GwmSPiZFA==} + engines: {node: '>=14.17'} hasBin: true dev: false @@ -9881,6 +9826,47 @@ packages: - utf-8-validate dev: false + file:projects/ai-translation-text.tgz: + resolution: {integrity: sha512-+LZrnKC6WEXktJx5OM7vSu4A3EwsBCcnX3xS4R5x1MYKUzTkgXoC1xDrXPfX/fX/98de+6s5yKkX+bWeFoOt8Q==, tarball: file:projects/ai-translation-text.tgz} + name: '@rush-temp/ai-translation-text' + version: 0.0.0 + dependencies: + '@azure/identity': 2.1.0 + '@microsoft/api-extractor': 7.34.4_@types+node@14.18.42 + '@types/chai': 4.3.4 + '@types/mocha': 7.0.2 + '@types/node': 14.18.42 + autorest: 3.6.3 + chai: 4.3.7 + cross-env: 7.0.3 + dotenv: 16.0.3 + eslint: 8.37.0 + karma: 6.4.1 + karma-chrome-launcher: 3.1.1 + karma-coverage: 2.2.0 + karma-env-preprocessor: 0.1.1 + karma-firefox-launcher: 1.3.0 + karma-junit-reporter: 2.0.1_karma@6.4.1 + karma-mocha: 2.0.1 + karma-mocha-reporter: 2.2.5_karma@6.4.1 + karma-source-map-support: 1.4.0 + karma-sourcemap-loader: 0.3.8 + mkdirp: 2.1.6 + mocha: 7.2.0 + mocha-junit-reporter: 1.23.3_mocha@7.2.0 + nyc: 15.1.0 + prettier: 2.8.7 + rimraf: 3.0.2 + source-map-support: 0.5.21 + tslib: 2.5.0 + typescript: 4.8.4 + transitivePeerDependencies: + - bufferutil + - debug + - supports-color + - utf-8-validate + dev: false + file:projects/api-management-custom-widgets-scaffolder.tgz: resolution: {integrity: sha512-QNlFQJsk/3ET4caCJxXBWooRMGlyglbYaCmZDQL28eE8fjHX62lkGweUlMvBZKspVE6UaaDrl3ddDJVJeybv8g==, tarball: file:projects/api-management-custom-widgets-scaffolder.tgz} name: '@rush-temp/api-management-custom-widgets-scaffolder' @@ -12183,7 +12169,7 @@ packages: dev: false file:projects/arm-eventhub.tgz: - resolution: {integrity: sha512-rtxJ4Prtd8pxuy3542XRTj6Wvba15pduyiNQbLtsai/c/dsbwP0Y9HM2BKIY6rjYvs8zUjefslETyuYLViA1Dw==, tarball: file:projects/arm-eventhub.tgz} + resolution: {integrity: sha512-gV3DahTOIjhlf6WNSNaTy/ZYil0Et8lC4DmynE0fUGlNiWlHWRlHvK6VG5zbfBY5zZO8vFCKZ6dSNl6K9M0u8A==, tarball: file:projects/arm-eventhub.tgz} name: '@rush-temp/arm-eventhub' version: 0.0.0 dependencies: @@ -13372,7 +13358,7 @@ packages: dev: false file:projects/arm-monitor.tgz: - resolution: {integrity: sha512-Cp0JwnEPjOgbpcjJ0FcSZnfI1jVSexkW6KxH8f9ci7UbhQis2h5Owt2/zf2LW1li5Ht3ad/IcqzkfC5ieMZmsA==, tarball: file:projects/arm-monitor.tgz} + resolution: {integrity: sha512-6AWHWYK1/QqvR8WRW8QrLUu600nQ9HlAL3udjH64nu2nFyoeB/wy+Zb+tWfIoRLFdMHBCzs/TWJvBzMXsKBiYQ==, tarball: file:projects/arm-monitor.tgz} name: '@rush-temp/arm-monitor' version: 0.0.0 dependencies: @@ -13381,9 +13367,9 @@ packages: '@azure/arm-storage': 17.2.1 '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.4_@types+node@14.18.42 - '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 - '@rollup/plugin-json': 4.1.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 + '@rollup/plugin-json': 6.0.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.42 @@ -15691,47 +15677,6 @@ packages: - utf-8-validate dev: false - file:projects/ai-translation-text.tgz: - resolution: {integrity: sha512-t1vY6CnSsEovNxSSUxRia/62S0MvizhtA8sqFxpbQYqmk369JA3RcADZgFIJybT0nlOybtuI8IK7XjF33LGYdQ==, tarball: file:projects/ai-translation-text.tgz} - name: '@rush-temp/ai-translation-text' - version: 0.0.0 - dependencies: - '@azure/identity': 2.1.0 - '@microsoft/api-extractor': 7.34.3_@types+node@14.18.36 - '@types/chai': 4.3.4 - '@types/mocha': 7.0.2 - '@types/node': 14.18.36 - autorest: 3.6.3 - chai: 4.3.7 - cross-env: 7.0.3 - dotenv: 16.0.3 - eslint: 8.33.0 - karma: 6.4.1 - karma-chrome-launcher: 3.1.1 - karma-coverage: 2.2.0 - karma-env-preprocessor: 0.1.1 - karma-firefox-launcher: 1.3.0 - karma-junit-reporter: 2.0.1_karma@6.4.1 - karma-mocha: 2.0.1 - karma-mocha-reporter: 2.2.5_karma@6.4.1 - karma-source-map-support: 1.4.0 - karma-sourcemap-loader: 0.3.8 - mkdirp: 2.1.3 - mocha: 7.2.0 - mocha-junit-reporter: 1.23.3_mocha@7.2.0 - nyc: 15.1.0 - prettier: 2.8.3 - rimraf: 3.0.2 - source-map-support: 0.5.21 - tslib: 2.5.0 - typescript: 4.8.4 - transitivePeerDependencies: - - bufferutil - - debug - - supports-color - - utf-8-validate - dev: false - file:projects/communication-alpha-ids.tgz: resolution: {integrity: sha512-gFfNaey5SYHtam8H0afb4emCX5xnhR6Ox3K+kzSJUVtrNC4fakIPOWaks0YtFd96toLk6vqIafa+cGdqdRrPPQ==, tarball: file:projects/communication-alpha-ids.tgz} name: '@rush-temp/communication-alpha-ids' @@ -16391,7 +16336,7 @@ packages: dev: false file:projects/container-registry.tgz: - resolution: {integrity: sha512-pWipLCUwNNpKjqh/MmLBG9lS3mgIXHq09E0+XAfodzcWd4Y1qcNqryKbK+qFLSs9objuHa9HO6t0k8x3CI7okA==, tarball: file:projects/container-registry.tgz} + resolution: {integrity: sha512-iW6S5CQK5+wHaxT4yGBXFzEkOkPQ4dS23kw1n3B+MZOltDDVe7oZXlv2Y9r0KA780hKzZ9+yVyJNIyHR+luZQA==, tarball: file:projects/container-registry.tgz} name: '@rush-temp/container-registry' version: 0.0.0 dependencies: diff --git a/sdk/monitor/arm-monitor/CHANGELOG.md b/sdk/monitor/arm-monitor/CHANGELOG.md index e77c8b42362d..80283bf614a7 100644 --- a/sdk/monitor/arm-monitor/CHANGELOG.md +++ b/sdk/monitor/arm-monitor/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History - -## 8.0.0-beta.5 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 8.0.0-beta.4 (2023-02-13) + +## 8.0.0-beta.5 (2023-04-17) **Features** @@ -18,24 +8,20 @@ - Added operation group MetricsOperations - Added operation group MonitorOperations - Added operation group PredictiveMetric + - Added operation group TenantActionGroups - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevel - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait - - Added operation ActionGroups.beginCreateNotificationsAtResourceGroupLevel - - Added operation ActionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait - Added operation ActionGroups.getTestNotificationsAtActionGroupResourceLevel - - Added operation ActionGroups.getTestNotificationsAtResourceGroupLevel - Added operation DataCollectionRuleAssociations.listByDataCollectionEndpoint + - Added operation MetricDefinitions.listAtSubscriptionScope - Added Interface AccessModeSettings - Added Interface AccessModeSettingsExclusion - Added Interface ActionGroup + - Added Interface ActionGroupPatchBodyAutoGenerated - Added Interface ActionGroupResource - Added Interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders - Added Interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams - - Added Interface ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders - - Added Interface ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - Added Interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams - - Added Interface ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams - - Added Interface ActionGroupsPostTestNotificationsHeaders - Added Interface ActionList - Added Interface Actions - Added Interface ActivityLogAlertResource @@ -50,6 +36,7 @@ - Added Interface AutoscaleErrorResponse - Added Interface AutoscaleErrorResponseError - Added Interface AutoscaleSettingResource + - Added Interface AzureAppPushReceiverAutoGenerated - Added Interface AzureMonitorPrivateLinkScope - Added Interface AzureMonitorWorkspace - Added Interface AzureMonitorWorkspaceDefaultIngestionSettings @@ -59,6 +46,7 @@ - Added Interface AzureMonitorWorkspaceResourceListResult - Added Interface AzureMonitorWorkspaceResourceProperties - Added Interface AzureMonitorWorkspacesCreateOptionalParams + - Added Interface AzureMonitorWorkspacesDeleteHeaders - Added Interface AzureMonitorWorkspacesDeleteOptionalParams - Added Interface AzureMonitorWorkspacesGetOptionalParams - Added Interface AzureMonitorWorkspacesListByResourceGroupNextOptionalParams @@ -71,8 +59,12 @@ - Added Interface Condition - Added Interface ConditionFailingPeriods - Added Interface DataCollectionEndpointConfigurationAccess + - Added Interface DataCollectionEndpointFailoverConfiguration - Added Interface DataCollectionEndpointLogsIngestion + - Added Interface DataCollectionEndpointMetadata + - Added Interface DataCollectionEndpointMetricsIngestion - Added Interface DataCollectionEndpointNetworkAcls + - Added Interface DataCollectionEndpointResourceIdentity - Added Interface DataCollectionEndpointResourceProperties - Added Interface DataCollectionEndpointResourceSystemData - Added Interface DataCollectionRuleAssociationMetadata @@ -83,21 +75,32 @@ - Added Interface DataCollectionRuleDataSources - Added Interface DataCollectionRuleDestinations - Added Interface DataCollectionRuleMetadata + - Added Interface DataCollectionRuleResourceIdentity - Added Interface DataCollectionRuleResourceProperties - Added Interface DataCollectionRuleResourceSystemData + - Added Interface DataImportSources + - Added Interface DataImportSourcesEventHub + - Added Interface DataSourcesSpecDataImports - Added Interface DefaultErrorResponse - Added Interface DestinationsSpecAzureMonitorMetrics - Added Interface DiagnosticSettingsCategoryResource - Added Interface DiagnosticSettingsResource - Added Interface DynamicMetricCriteria + - Added Interface EmailReceiverAutoGenerated + - Added Interface ErrorContractAutoGenerated - Added Interface ErrorDetailAutoGenerated - Added Interface ErrorResponseAdditionalInfo - Added Interface ErrorResponseAutoGenerated - Added Interface ErrorResponseAutoGenerated2 - Added Interface ErrorResponseDetails + - Added Interface EventHubDataSource + - Added Interface EventHubDestination + - Added Interface EventHubDirectDestination + - Added Interface FailoverConfigurationSpec - Added Interface Identity - Added Interface IisLogsDataSource - Added Interface IngestionSettings + - Added Interface LocationSpec - Added Interface LocationThresholdRuleCondition - Added Interface LogFilesDataSource - Added Interface LogFilesDataSourceSettings @@ -105,31 +108,44 @@ - Added Interface LogFileSettingsText - Added Interface LogFileTextSettings - Added Interface LogProfileResource + - Added Interface ManagedServiceIdentity - Added Interface ManagementEventRuleCondition - Added Interface Metadata - Added Interface MetricAlertMultipleResourceMultipleMetricCriteria - Added Interface MetricAlertResource - Added Interface MetricAlertSingleResourceMultipleMetricCriteria - Added Interface MetricCriteria + - Added Interface MetricDefinitionsListAtSubscriptionScopeOptionalParams - Added Interface Metrics + - Added Interface MetricsIngestionEndpointSpec + - Added Interface MetricsListAtSubscriptionScopeOptionalParams + - Added Interface MetricsListAtSubscriptionScopePostOptionalParams + - Added Interface MonitoringAccountDestination - Added Interface MonitorOperationsListNextOptionalParams - Added Interface MonitorOperationsListOptionalParams - Added Interface OperationAutoGenerated - Added Interface OperationDisplayAutoGenerated - Added Interface OperationListResultAutoGenerated + - Added Interface PlatformTelemetryDataSource - Added Interface PredictiveAutoscalePolicy - Added Interface PredictiveMetricGetOptionalParams - Added Interface PredictiveResponse - Added Interface PredictiveValue - Added Interface PrivateEndpoint + - Added Interface PrivateEndpointAutoGenerated - Added Interface PrivateEndpointConnection + - Added Interface PrivateEndpointConnectionAutoGenerated - Added Interface PrivateLinkResource + - Added Interface PrivateLinkScopedResource - Added Interface PrivateLinkServiceConnectionState + - Added Interface PrometheusForwarderDataSource - Added Interface ProxyResourceAutoGenerated - Added Interface ResourceAutoGenerated2 - Added Interface ResourceAutoGenerated3 - Added Interface ResourceAutoGenerated4 - Added Interface ResourceAutoGenerated5 + - Added Interface ResourceAutoGenerated6 + - Added Interface ResourceForUpdateIdentity - Added Interface RuleEmailAction - Added Interface RuleManagementEventDataSource - Added Interface RuleMetricDataSource @@ -142,22 +158,40 @@ - Added Interface ScheduledQueryRulesListByResourceGroupNextOptionalParams - Added Interface ScheduledQueryRulesListBySubscriptionNextOptionalParams - Added Interface ScopedResource + - Added Interface SmsReceiverAutoGenerated + - Added Interface StorageBlobDestination + - Added Interface StorageTableDestination - Added Interface StreamDeclaration + - Added Interface SubscriptionScopeMetric + - Added Interface SubscriptionScopeMetricDefinition + - Added Interface SubscriptionScopeMetricDefinitionCollection + - Added Interface SubscriptionScopeMetricResponse + - Added Interface SubscriptionScopeMetricsRequestBodyParameters + - Added Interface TenantActionGroupList + - Added Interface TenantActionGroupResource + - Added Interface TenantActionGroupsCreateOrUpdateOptionalParams + - Added Interface TenantActionGroupsDeleteOptionalParams + - Added Interface TenantActionGroupsGetOptionalParams + - Added Interface TenantActionGroupsListByManagementGroupIdOptionalParams + - Added Interface TenantActionGroupsUpdateOptionalParams - Added Interface ThresholdRuleCondition - Added Interface TrackedResource - Added Interface TrackedResourceAutoGenerated + - Added Interface UserAssignedIdentity - Added Interface UserIdentityProperties - Added Interface VMInsightsOnboardingStatus + - Added Interface VoiceReceiverAutoGenerated + - Added Interface WebhookReceiverAutoGenerated - Added Interface WebtestLocationAvailabilityCriteria + - Added Interface WindowsFirewallLogsDataSource - Added Type Alias AccessMode - Added Type Alias ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse - - Added Type Alias ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - Added Type Alias ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse - - Added Type Alias ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse - Added Type Alias ActionType - Added Type Alias ActivityLogAlertsListByResourceGroupNextResponse - Added Type Alias ActivityLogAlertsListBySubscriptionIdNextResponse - Added Type Alias AzureMonitorWorkspacesCreateResponse + - Added Type Alias AzureMonitorWorkspacesDeleteResponse - Added Type Alias AzureMonitorWorkspacesGetResponse - Added Type Alias AzureMonitorWorkspacesListByResourceGroupNextResponse - Added Type Alias AzureMonitorWorkspacesListByResourceGroupResponse @@ -170,8 +204,16 @@ - Added Type Alias IdentityType - Added Type Alias Kind - Added Type Alias KnownColumnDefinitionType + - Added Type Alias KnownLocationSpecProvisioningStatus - Added Type Alias KnownLogFilesDataSourceFormat - Added Type Alias KnownLogFileTextSettingsRecordStartTimestampFormat + - Added Type Alias KnownPrometheusForwarderDataSourceStreams + - Added Type Alias ManagedServiceIdentityType + - Added Type Alias MetricAggregationType + - Added Type Alias MetricDefinitionsListAtSubscriptionScopeResponse + - Added Type Alias MetricResultType + - Added Type Alias MetricsListAtSubscriptionScopePostResponse + - Added Type Alias MetricsListAtSubscriptionScopeResponse - Added Type Alias MonitorOperationsListNextResponse - Added Type Alias MonitorOperationsListResponse - Added Type Alias Origin @@ -182,35 +224,79 @@ - Added Type Alias PublicNetworkAccess - Added Type Alias ScheduledQueryRulesListByResourceGroupNextResponse - Added Type Alias ScheduledQueryRulesListBySubscriptionNextResponse + - Added Type Alias TenantActionGroupsCreateOrUpdateResponse + - Added Type Alias TenantActionGroupsGetResponse + - Added Type Alias TenantActionGroupsListByManagementGroupIdResponse + - Added Type Alias TenantActionGroupsUpdateResponse - Added Type Alias TimeAggregation + - Added Type Alias Unit - Interface AutoscaleSettingResourcePatch has a new optional parameter predictiveAutoscalePolicy + - Interface DataCollectionEndpoint has a new optional parameter failoverConfiguration + - Interface DataCollectionEndpoint has a new optional parameter metadata + - Interface DataCollectionEndpoint has a new optional parameter metricsIngestion + - Interface DataCollectionEndpoint has a new optional parameter privateLinkScopedResources + - Interface DataCollectionEndpointResource has a new optional parameter failoverConfiguration + - Interface DataCollectionEndpointResource has a new optional parameter identity + - Interface DataCollectionEndpointResource has a new optional parameter metadata + - Interface DataCollectionEndpointResource has a new optional parameter metricsIngestion + - Interface DataCollectionEndpointResource has a new optional parameter privateLinkScopedResources - Interface DataCollectionRule has a new optional parameter dataCollectionEndpointId - Interface DataCollectionRule has a new optional parameter metadata - Interface DataCollectionRule has a new optional parameter streamDeclarations - Interface DataCollectionRuleAssociation has a new optional parameter metadata - Interface DataCollectionRuleAssociationProxyOnlyResource has a new optional parameter metadata - Interface DataCollectionRuleResource has a new optional parameter dataCollectionEndpointId + - Interface DataCollectionRuleResource has a new optional parameter identity - Interface DataCollectionRuleResource has a new optional parameter metadata - Interface DataCollectionRuleResource has a new optional parameter streamDeclarations + - Interface DataFlow has a new optional parameter builtInTransform - Interface DataFlow has a new optional parameter outputStream - Interface DataFlow has a new optional parameter transformKql + - Interface DataSourcesSpec has a new optional parameter dataImports - Interface DataSourcesSpec has a new optional parameter iisLogs - Interface DataSourcesSpec has a new optional parameter logFiles + - Interface DataSourcesSpec has a new optional parameter platformTelemetry + - Interface DataSourcesSpec has a new optional parameter prometheusForwarder + - Interface DataSourcesSpec has a new optional parameter windowsFirewallLogs + - Interface DestinationsSpec has a new optional parameter eventHubs + - Interface DestinationsSpec has a new optional parameter eventHubsDirect + - Interface DestinationsSpec has a new optional parameter monitoringAccounts + - Interface DestinationsSpec has a new optional parameter storageAccounts + - Interface DestinationsSpec has a new optional parameter storageBlobsDirect + - Interface DestinationsSpec has a new optional parameter storageTablesDirect + - Interface ErrorResponse has a new optional parameter error - Interface LogSettings has a new optional parameter categoryGroup + - Interface MetricsListOptionalParams has a new optional parameter autoAdjustTimegrain + - Interface MetricsListOptionalParams has a new optional parameter validateDimensions + - Interface Operation has a new optional parameter actionType + - Interface Operation has a new optional parameter isDataAction + - Interface Operation has a new optional parameter origin + - Interface OperationDisplay has a new optional parameter description - Interface Resource has a new optional parameter systemData + - Interface ResourceAutoGenerated has a new optional parameter systemData + - Interface ResourceForUpdate has a new optional parameter identity - Added Enum KnownAccessMode - Added Enum KnownActionType - Added Enum KnownCategoryType - Added Enum KnownDimensionOperator - Added Enum KnownKind - Added Enum KnownKnownColumnDefinitionType + - Added Enum KnownKnownLocationSpecProvisioningStatus - Added Enum KnownKnownLogFilesDataSourceFormat - Added Enum KnownKnownLogFileTextSettingsRecordStartTimestampFormat + - Added Enum KnownKnownPrometheusForwarderDataSourceStreams + - Added Enum KnownManagedServiceIdentityType + - Added Enum KnownMetricAggregationType + - Added Enum KnownMetricResultType - Added Enum KnownOrigin - Added Enum KnownPrivateEndpointConnectionProvisioningState - Added Enum KnownPrivateEndpointServiceConnectionStatus - Added Enum KnownPublicNetworkAccess - Added Enum KnownTimeAggregation + - Enum KnownKnownDataCollectionEndpointProvisioningState has a new value Canceled + - Enum KnownKnownDataCollectionRuleAssociationProvisioningState has a new value Canceled + - Enum KnownKnownDataCollectionRuleProvisioningState has a new value Canceled + - Enum KnownKnownPublicNetworkAccessOptions has a new value SecuredByPerimeter - Enum KnownProvisioningState has a new value Creating - Enum KnownProvisioningState has a new value Deleting - Added function getContinuationToken @@ -218,23 +304,37 @@ **Breaking Changes** - Removed operation group Metrics + - Removed operation ActionGroups.beginPostTestNotifications + - Removed operation ActionGroups.beginPostTestNotificationsAndWait + - Removed operation ActionGroups.getTestNotifications - Operation ActivityLogAlerts.update has a new signature + - Operation PrivateEndpointConnections.beginCreateOrUpdate has a new signature + - Operation PrivateEndpointConnections.beginCreateOrUpdateAndWait has a new signature - Operation ScheduledQueryRules.createOrUpdate has a new signature - Operation ScheduledQueryRules.update has a new signature - Interface ActivityLogsListNextOptionalParams no longer has parameter select - Interface AzureResource no longer has parameter identity - Interface AzureResource no longer has parameter kind + - Interface ErrorResponse no longer has parameter code + - Interface ErrorResponse no longer has parameter message - Interface PrivateEndpointConnectionListResult no longer has parameter nextLink - Interface PrivateLinkResourceListResult no longer has parameter nextLink + - Interface Resource no longer has parameter location + - Interface Resource no longer has parameter tags - Interface ResourceAutoGenerated no longer has parameter etag - Interface ResourceAutoGenerated no longer has parameter kind + - Interface ResourceAutoGenerated no longer has parameter location + - Interface ResourceAutoGenerated no longer has parameter tags - Interface ScheduledQueryRulesListByResourceGroupOptionalParams no longer has parameter filter - Interface ScheduledQueryRulesListBySubscriptionOptionalParams no longer has parameter filter - Interface TenantActivityLogsListNextOptionalParams no longer has parameter filter - Interface TenantActivityLogsListNextOptionalParams no longer has parameter select - Type of parameter operator of interface Dimension is changed from Operator to DimensionOperator - - Type of parameter error of interface ErrorContract is changed from ErrorResponse to ErrorResponseDetails - - Type of parameter error of interface OperationStatus is changed from ErrorResponseCommon to ErrorDetail + - Type of parameter error of interface ErrorContract is changed from ErrorResponse to ErrorResponseAutoGenerated + - Type of parameter error of interface ErrorResponseCommonV2 is changed from ErrorDetail to ErrorDetailAutoGenerated + - Type of parameter unit of interface Metric is changed from MetricUnit to Unit + - Type of parameter error of interface OperationStatus is changed from ErrorResponseCommon to ErrorDetailAutoGenerated + - Type of parameter value of interface PrivateEndpointConnectionListResult is changed from PrivateEndpointConnection[] to PrivateEndpointConnectionAutoGenerated[] - Class MonitorClient no longer has parameter metrics - Removed Enum KnownConditionalOperator - Removed Enum KnownEnabled diff --git a/sdk/monitor/arm-monitor/_meta.json b/sdk/monitor/arm-monitor/_meta.json index 1a33dff7f205..78bb07a35916 100644 --- a/sdk/monitor/arm-monitor/_meta.json +++ b/sdk/monitor/arm-monitor/_meta.json @@ -1,8 +1,8 @@ { - "commit": "dcf548aea9f776d166e8c53f8ecb8eff9beef2a5", + "commit": "b4dbb9dc9483c70135d48457d906102296a00ed3", "readme": "specification/monitor/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\monitor\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.8 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/monitor/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.8" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/package.json b/sdk/monitor/arm-monitor/package.json index b5b8dae89660..6c6ec2fd1b12 100644 --- a/sdk/monitor/arm-monitor/package.json +++ b/sdk/monitor/arm-monitor/package.json @@ -29,9 +29,9 @@ "types": "./types/arm-monitor.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", - "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-multi-entry": "^4.1.0", + "@rollup/plugin-commonjs": "^24.0.0", + "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", "mkdirp": "^2.1.2", "rollup": "^2.66.1", @@ -48,11 +48,7 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-eventhub": "^5.0.0", - "@azure/arm-logic": "^8.0.0", - "@azure/arm-operationalinsights": "^8.0.0", - "@azure/arm-storage": "^17.0.0" + "@azure/dev-tool": "^1.0.0" }, "repository": { "type": "git", @@ -115,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-monitor?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor" +} \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_create_parameters_for_diagnosticsettings.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_create_parameters_for_diagnosticsettings.json deleted file mode 100644 index 76f9e271a65c..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_create_parameters_for_diagnosticsettings.json +++ /dev/null @@ -1,1915 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx?api-version=2019-05-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "252", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-logic/8.2.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "56ca967a-2729-4bda-a8f4-05e2f3bcdb1e" - }, - "RequestBody": { - "location": "eastus", - "properties": { - "definition": { - "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", - "contentVersion": "1.0.0.0", - "parameters": {}, - "triggers": {}, - "actions": {}, - "outputs": {} - } - } - }, - "StatusCode": 201, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "1816", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:16:40 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "f147f1ed-c6f7-4e64-bb02-f1c22ba3c207", - "x-ms-ratelimit-remaining-subscription-writes": "1199", - "x-ms-request-id": "eastus:7243b70f-732d-482f-83ab-8c1374bde91c", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031640Z:f147f1ed-c6f7-4e64-bb02-f1c22ba3c207" - }, - "ResponseBody": { - "properties": { - "provisioningState": "Succeeded", - "createdTime": "2023-02-13T03:16:39.1301561Z", - "changedTime": "2023-02-13T03:16:39.1160723Z", - "state": "Enabled", - "version": "08585253486863865397", - "accessEndpoint": "https://prod-30.eastus.logic.azure.com:443/workflows/a627cbb4679a4cec810ac2c6807ebf86", - "definition": { - "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", - "contentVersion": "1.0.0.0", - "parameters": {}, - "triggers": {}, - "actions": {}, - "outputs": {} - }, - "parameters": {}, - "endpointsConfiguration": { - "workflow": { - "outgoingIpAddresses": [ - { - "address": "13.92.98.111" - }, - { - "address": "40.121.91.41" - }, - { - "address": "40.114.82.191" - }, - { - "address": "23.101.139.153" - }, - { - "address": "23.100.29.190" - }, - { - "address": "23.101.136.201" - }, - { - "address": "104.45.153.81" - }, - { - "address": "23.101.132.208" - }, - { - "address": "52.226.216.197" - }, - { - "address": "52.226.216.187" - }, - { - "address": "40.76.151.25" - }, - { - "address": "40.76.148.50" - }, - { - "address": "20.84.29.29" - }, - { - "address": "20.84.29.18" - }, - { - "address": "40.76.174.83" - }, - { - "address": "40.76.174.39" - } - ], - "accessEndpointIpAddresses": [ - { - "address": "137.135.106.54" - }, - { - "address": "40.117.99.79" - }, - { - "address": "40.117.100.228" - }, - { - "address": "137.116.126.165" - }, - { - "address": "52.226.216.209" - }, - { - "address": "40.76.151.124" - }, - { - "address": "20.84.29.150" - }, - { - "address": "40.76.174.148" - } - ] - }, - "connector": { - "outgoingIpAddresses": [ - { - "address": "40.71.249.139" - }, - { - "address": "40.71.249.205" - }, - { - "address": "40.114.40.132" - }, - { - "address": "40.71.11.80/28" - }, - { - "address": "40.71.15.160/27" - }, - { - "address": "52.188.157.160" - }, - { - "address": "20.88.153.176/28" - }, - { - "address": "20.88.153.192/27" - }, - { - "address": "52.151.221.184" - }, - { - "address": "52.151.221.119" - } - ] - } - } - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx", - "name": "myworkflowxxx", - "type": "Microsoft.Logic/workflows", - "location": "eastus" - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy?api-version=2021-09-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "274", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "5e446ee7-aece-4840-89a2-751d67052638" - }, - "RequestBody": { - "sku": { - "name": "Standard_GRS" - }, - "kind": "StorageV2", - "location": "eastus", - "tags": { - "key1": "value1", - "key2": "value2" - }, - "properties": { - "encryption": { - "services": { - "blob": { - "enabled": true, - "keyType": "Account" - }, - "file": { - "enabled": true, - "keyType": "Account" - } - }, - "keySource": "Microsoft.Storage" - } - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:16:44 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/5e968ead-6e66-458b-b8fe-215019b94614?monitor=true\u0026api-version=2021-09-01", - "Pragma": "no-cache", - "Retry-After": "17", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "46c9ec00-ab3e-4fb3-9361-24a712ceff8f", - "x-ms-ratelimit-remaining-subscription-writes": "1198", - "x-ms-request-id": "5e968ead-6e66-458b-b8fe-215019b94614", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031644Z:46c9ec00-ab3e-4fb3-9361-24a712ceff8f" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/5e968ead-6e66-458b-b8fe-215019b94614?monitor=true\u0026api-version=2021-09-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "c5716e25-e038-455d-87cb-ff0955492efa" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:16:44 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/5e968ead-6e66-458b-b8fe-215019b94614?monitor=true\u0026api-version=2021-09-01", - "Pragma": "no-cache", - "Retry-After": "17", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "f4234993-c8b6-44c7-96a1-a76218b829e5", - "x-ms-ratelimit-remaining-subscription-reads": "11999", - "x-ms-request-id": "f1d2e956-4e7f-45e6-afd8-0db3682635e9", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031645Z:f4234993-c8b6-44c7-96a1-a76218b829e5" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/5e968ead-6e66-458b-b8fe-215019b94614?monitor=true\u0026api-version=2021-09-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "0de64294-43a4-4f06-a560-9d6df56c54f3" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:16:45 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/5e968ead-6e66-458b-b8fe-215019b94614?monitor=true\u0026api-version=2021-09-01", - "Pragma": "no-cache", - "Retry-After": "17", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "c3b8b52c-ee56-4912-84ba-5eb46cb4f5de", - "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "1807aa4a-1c94-4765-9d92-e56aff5a3d27", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031645Z:c3b8b52c-ee56-4912-84ba-5eb46cb4f5de" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/5e968ead-6e66-458b-b8fe-215019b94614?monitor=true\u0026api-version=2021-09-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "89772e35-1c7b-4fb4-bd0f-7d15ddb7702e" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json", - "Date": "Mon, 13 Feb 2023 03:17:02 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "11a1120c-8e0e-4ae2-b51d-2cfce555d578", - "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "270b4380-a5d0-4cf8-af31-8f436d6da493", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031702Z:11a1120c-8e0e-4ae2-b51d-2cfce555d578" - }, - "ResponseBody": { - "sku": { - "name": "Standard_GRS", - "tier": "Standard" - }, - "kind": "StorageV2", - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "name": "mystorageaccountyyy", - "type": "Microsoft.Storage/storageAccounts", - "location": "eastus", - "tags": { - "key1": "value1", - "key2": "value2" - }, - "properties": { - "keyCreationTime": { - "key1": "2023-02-13T03:16:43.1645826Z", - "key2": "2023-02-13T03:16:43.1645826Z" - }, - "privateEndpointConnections": [], - "minimumTlsVersion": "TLS1_0", - "allowBlobPublicAccess": true, - "networkAcls": { - "bypass": "AzureServices", - "virtualNetworkRules": [], - "ipRules": [], - "defaultAction": "Allow" - }, - "supportsHttpsTrafficOnly": true, - "encryption": { - "services": { - "file": { - "keyType": "Account", - "enabled": true, - "lastEnabledTime": "2023-02-13T03:16:43.1802245Z" - }, - "blob": { - "keyType": "Account", - "enabled": true, - "lastEnabledTime": "2023-02-13T03:16:43.1802245Z" - } - }, - "keySource": "Microsoft.Storage" - }, - "accessTier": "Hot", - "provisioningState": "Succeeded", - "creationTime": "2023-02-13T03:16:43.0083723Z", - "primaryEndpoints": { - "dfs": "https://mystorageaccountyyy.dfs.core.windows.net/", - "web": "https://mystorageaccountyyy.z13.web.core.windows.net/", - "blob": "https://mystorageaccountyyy.blob.core.windows.net/", - "queue": "https://mystorageaccountyyy.queue.core.windows.net/", - "table": "https://mystorageaccountyyy.table.core.windows.net/", - "file": "https://mystorageaccountyyy.file.core.windows.net/" - }, - "primaryLocation": "eastus", - "statusOfPrimary": "available", - "secondaryLocation": "westus", - "statusOfSecondary": "available" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "106", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "f1c38985-b1bd-4e24-bc56-9c2ef34b62a1" - }, - "RequestBody": { - "location": "eastus", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "sku": { - "name": "Standard", - "tier": "Standard" - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:07 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "95d26ac3-be68-4deb-a2b6-a48445b121ff", - "x-ms-ratelimit-remaining-subscription-resource-requests": "49", - "x-ms-request-id": "bac82c4c-1ee2-4020-b3af-a9ff7304ad47_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031707Z:95d26ac3-be68-4deb-a2b6-a48445b121ff" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "cdcfbd5c-c30a-4780-b06a-06493a83758d" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:07 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "94c0cec7-dc87-411c-80c9-b6376af0c686", - "x-ms-ratelimit-remaining-subscription-reads": "11996", - "x-ms-request-id": "dd140320-eb44-40dd-8e57-dbd8ecb753b4_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031708Z:94c0cec7-dc87-411c-80c9-b6376af0c686" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "79b0e41f-951d-4ebc-a84c-f2f78d1bcf33" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:08 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "e3c986af-d4b4-4463-8be9-b4b937454d1c", - "x-ms-ratelimit-remaining-subscription-reads": "11995", - "x-ms-request-id": "cf4b1c39-b934-4a8d-8e66-0356cc44ea54_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031709Z:e3c986af-d4b4-4463-8be9-b4b937454d1c" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "0974423b-c983-470f-82f9-b03fe72f4d8e" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:11 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "f3aa6707-31a1-4a51-9a2a-0a7f2a6b4693", - "x-ms-ratelimit-remaining-subscription-reads": "11994", - "x-ms-request-id": "611b28d1-9408-4925-a033-2bb758565b1d_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031711Z:f3aa6707-31a1-4a51-9a2a-0a7f2a6b4693" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "bdad2a96-8ba3-4da0-ba59-3867b345a8d4" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:13 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "c4606729-cf9a-4859-a2a2-2db5a6d5556b", - "x-ms-ratelimit-remaining-subscription-reads": "11993", - "x-ms-request-id": "d02a4cbf-c76e-4ebf-9643-a3bab181f96e_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031714Z:c4606729-cf9a-4859-a2a2-2db5a6d5556b" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "61da840c-7bfe-4f70-b2d3-ef04706c125f" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:16 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "4a988c8e-a8ad-44dc-814d-e4d2f6c8c2df", - "x-ms-ratelimit-remaining-subscription-reads": "11992", - "x-ms-request-id": "46d0e325-2048-403c-8c57-92ddc298dfd8_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031717Z:4a988c8e-a8ad-44dc-814d-e4d2f6c8c2df" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "cd3bd62e-b15e-4b1b-a22e-36d0c20b4f7c" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:19 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "d9515426-97ab-4a43-94c4-ab4d8ecac153", - "x-ms-ratelimit-remaining-subscription-reads": "11991", - "x-ms-request-id": "040937ca-e048-4e5f-91d1-059185be44da_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031719Z:d9515426-97ab-4a43-94c4-ab4d8ecac153" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "f95bf964-52bb-421a-afc1-bdf03c6f0050" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:21 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "4c1f5747-daee-43ce-ba21-7be85a1024ec", - "x-ms-ratelimit-remaining-subscription-reads": "11990", - "x-ms-request-id": "f2548ba3-4730-489d-add7-8341da9b5f98_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031722Z:4c1f5747-daee-43ce-ba21-7be85a1024ec" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "d28c36b2-06af-4741-a623-134eb4e65d43" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:25 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "e869c20f-ab6c-400b-93c9-2fbdfb66dc4f", - "x-ms-ratelimit-remaining-subscription-reads": "11989", - "x-ms-request-id": "3e56cc72-0a68-4b6c-bdbc-c0da90a55be6_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031726Z:e869c20f-ab6c-400b-93c9-2fbdfb66dc4f" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "8bb404ef-1151-4669-9e79-de91896cca89" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:27 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "c776e520-4421-4184-a848-4f5ceb9c0162", - "x-ms-ratelimit-remaining-subscription-reads": "11988", - "x-ms-request-id": "00b76657-0a26-429d-b863-58ba463716cd_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031728Z:c776e520-4421-4184-a848-4f5ceb9c0162" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "5453bb75-fc1a-42d7-8277-24c7ab77ad61" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:31 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "bd62a37d-e5f9-4bc1-84d5-3965962b95f3", - "x-ms-ratelimit-remaining-subscription-reads": "11987", - "x-ms-request-id": "2eac7144-92dd-4d0a-9076-127cfb85ec44_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031731Z:bd62a37d-e5f9-4bc1-84d5-3965962b95f3" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "ae526062-d6dd-43f4-b39b-7fae42e7083c" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:34 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "9cfb3df2-6eea-45b2-99cb-282acff59744", - "x-ms-ratelimit-remaining-subscription-reads": "11986", - "x-ms-request-id": "fb1fe79f-535e-4cf9-bbd0-69cc2a3411d4_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031734Z:9cfb3df2-6eea-45b2-99cb-282acff59744" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "7bf0881c-8269-4601-bb79-cfbd27bb4185" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:36 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "c7eb4b97-b4a9-4fc9-977a-8dbca7954a7e", - "x-ms-ratelimit-remaining-subscription-reads": "11985", - "x-ms-request-id": "9f421275-e304-4fa1-ae22-9a9efc4dfa97_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031736Z:c7eb4b97-b4a9-4fc9-977a-8dbca7954a7e" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "29218200-fc5b-4b42-b6d1-824f87c38877" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:39 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "fd305722-2793-4aa5-a86c-8b390d742b7f", - "x-ms-ratelimit-remaining-subscription-reads": "11984", - "x-ms-request-id": "cfa11e90-0e6d-477c-b5e5-4bba550f99b3_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031739Z:fd305722-2793-4aa5-a86c-8b390d742b7f" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "cd3df8b7-f5ad-459b-b855-5d68b69232cd" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:42 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "d6ea64ad-adf5-4ba7-8c26-c3ce51203bde", - "x-ms-ratelimit-remaining-subscription-reads": "11983", - "x-ms-request-id": "069fcfc4-56b1-420b-8bde-9d766979c3cd_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031742Z:d6ea64ad-adf5-4ba7-8c26-c3ce51203bde" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "de0f02d3-3867-4ecd-acc7-0e6fd3bdb742" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:44 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "7758da39-23e8-4926-b4a0-3448056a39c5", - "x-ms-ratelimit-remaining-subscription-reads": "11982", - "x-ms-request-id": "a0bfa0f1-a82c-467d-9d85-31e54f62c4d3_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031744Z:7758da39-23e8-4926-b4a0-3448056a39c5" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "93cb2887-186f-4b25-af1d-4fa7bf267fc5" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:47 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "d538fac9-b12f-43c4-b462-3a8ed8799d21", - "x-ms-ratelimit-remaining-subscription-reads": "11981", - "x-ms-request-id": "301d81ba-e9bd-4c78-8085-ac189d12889f_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031747Z:d538fac9-b12f-43c4-b462-3a8ed8799d21" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "a771f882-6814-44f9-a422-a05b1a4cc183" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:50 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0fd877cc-0ff9-4384-80d3-cbe479eb04db", - "x-ms-ratelimit-remaining-subscription-reads": "11980", - "x-ms-request-id": "a0f80110-97ee-4f9a-89b6-40c21d857c82_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031750Z:0fd877cc-0ff9-4384-80d3-cbe479eb04db" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "415ad79a-cdb1-442f-9916-ccc678bb7442" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:53 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "e9a3961c-12c0-4565-bd0c-b8675103828c", - "x-ms-ratelimit-remaining-subscription-reads": "11979", - "x-ms-request-id": "310c16bd-1e50-4a18-8e04-6251bb1b0798_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031753Z:e9a3961c-12c0-4565-bd0c-b8675103828c" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:05.337Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "32f5188f-2173-49d6-a652-56404d4dae98" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:17:55 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "46e587d8-578d-4bb1-b50f-2f0af3e4ecf2", - "x-ms-ratelimit-remaining-subscription-reads": "11978", - "x-ms-request-id": "826e04ba-7571-4cfa-a899-57623c9f76d3_M11SN1_M11SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031756Z:46e587d8-578d-4bb1-b50f-2f0af3e4ecf2" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Succeeded", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:17:54.25Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Active" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/authorizationRules/myauthorizationRulexxx?api-version=2021-11-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "52", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "3887e5c1-c542-402f-a47c-7fa982dc67a5" - }, - "RequestBody": { - "properties": { - "rights": [ - "Listen", - "Send", - "Manage" - ] - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:18:04 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "cf3857ac-d053-490d-86ef-1d052d594d1a", - "x-ms-ratelimit-remaining-subscription-writes": "1197", - "x-ms-request-id": "cf3857ac-d053-490d-86ef-1d052d594d1a", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031804Z:cf3857ac-d053-490d-86ef-1d052d594d1a" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/authorizationRules/myauthorizationRulexxx", - "name": "myauthorizationRulexxx", - "type": "Microsoft.EventHub/Namespaces/AuthorizationRules", - "location": "eastus", - "properties": { - "rights": [ - "Listen", - "Send", - "Manage" - ] - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/eventhubs/myeventhubxxx?api-version=2021-11-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "546", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "8c5880ea-1e52-4fcc-962d-ca243af8d372" - }, - "RequestBody": { - "properties": { - "messageRetentionInDays": 4, - "partitionCount": 4, - "status": "Active", - "captureDescription": { - "enabled": true, - "encoding": "Avro", - "intervalInSeconds": 120, - "sizeLimitInBytes": 10485763, - "destination": { - "name": "EventHubArchive.AzureBlockBlob", - "properties": { - "storageAccountResourceId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "blobContainer": "container", - "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}" - } - } - } - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:18:06 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "49501027-f9cf-46c2-9bc6-2735827c5042", - "x-ms-ratelimit-remaining-subscription-writes": "1196", - "x-ms-request-id": "49501027-f9cf-46c2-9bc6-2735827c5042", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031807Z:49501027-f9cf-46c2-9bc6-2735827c5042" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/eventhubs/myeventhubxxx", - "name": "myeventhubxxx", - "type": "Microsoft.EventHub/namespaces/eventhubs", - "location": "eastus", - "properties": { - "messageRetentionInDays": 4, - "partitionCount": 4, - "status": "Active", - "createdAt": "2023-02-13T03:18:06.607Z", - "updatedAt": "2023-02-13T03:18:06.95Z", - "partitionIds": [ - "0", - "1", - "2", - "3" - ], - "captureDescription": { - "enabled": true, - "encoding": "Avro", - "destination": { - "name": "EventHubArchive.AzureBlockBlob", - "properties": { - "storageAccountResourceId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "blobContainer": "container", - "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}" - } - }, - "intervalInSeconds": 120, - "sizeLimitInBytes": 10485763 - } - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/Microsoft.OperationalInsights/workspaces/myworkspacexxx?api-version=2021-06-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "107", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-operationalinsights/8.0.1 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "155a2358-ae16-4c5f-b9d6-d34a08525f42" - }, - "RequestBody": { - "tags": { - "tag1": "value1" - }, - "location": "eastus", - "properties": { - "sku": { - "name": "PerNode" - }, - "retentionInDays": 30 - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Allow-Origin": "*", - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json", - "Date": "Mon, 13 Feb 2023 03:18:12 GMT", - "Pragma": "no-cache", - "Request-Context": "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "a52b9f72-51a7-4a24-a57b-9a1d31f761d9", - "x-ms-ratelimit-remaining-subscription-writes": "1195", - "x-ms-request-id": "c285062f-78b8-431f-960c-5b6cfb2cd486", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031813Z:a52b9f72-51a7-4a24-a57b-9a1d31f761d9", - "X-Powered-By": [ - "ASP.NET", - "ASP.NET" - ] - }, - "ResponseBody": { - "properties": { - "source": "Azure", - "customerId": "fb7c7b05-2efb-4adf-b304-a6de55ef8436", - "provisioningState": "Succeeded", - "sku": { - "name": "pergb2018", - "lastSkuUpdate": "Sun, 29 Jan 2023 08:04:29 GMT" - }, - "retentionInDays": 30, - "features": { - "legacy": 0, - "searchVersion": 1, - "enableLogAccessUsingOnlyResourcePermissions": true - }, - "workspaceCapping": { - "dailyQuotaGb": -1.0, - "quotaNextResetTime": "Mon, 13 Feb 2023 12:00:00 GMT", - "dataIngestionStatus": "RespectQuota" - }, - "publicNetworkAccessForIngestion": "Enabled", - "publicNetworkAccessForQuery": "Enabled", - "createdDate": "Sun, 29 Jan 2023 08:04:29 GMT", - "modifiedDate": "Sun, 29 Jan 2023 08:25:39 GMT" - }, - "id": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.operationalinsights/workspaces/myworkspacexxx", - "name": "myworkspacexxx", - "type": "Microsoft.OperationalInsights/workspaces", - "location": "eastus", - "tags": { - "tag1": "value1" - } - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_delete_parameters_for_diagnosticsettings.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_delete_parameters_for_diagnosticsettings.json deleted file mode 100644 index 9f293af6f1f9..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_delete_parameters_for_diagnosticsettings.json +++ /dev/null @@ -1,289 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx?api-version=2019-05-01", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-logic/8.2.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "fe435ef1-7fe1-45a1-ad58-11838d2aa07a" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Mon, 13 Feb 2023 03:18:36 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "d58aedea-4983-4bc0-98fd-8b910d318449", - "x-ms-ratelimit-remaining-subscription-deletes": "14998", - "x-ms-request-id": "eastus:f206ede3-53ba-47fa-912f-286351e67353", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031837Z:d58aedea-4983-4bc0-98fd-8b910d318449" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy?api-version=2021-09-01", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "345a554e-8d4f-4721-a869-7afb90fdb0d4" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:18:43 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "14636c65-549c-40f0-9cae-65fbf679f03d", - "x-ms-ratelimit-remaining-subscription-deletes": "14997", - "x-ms-request-id": "00f8dbf1-1a34-42a6-8975-f0fa165cf7f0", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031843Z:14636c65-549c-40f0-9cae-65fbf679f03d" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "27af8b52-b47c-44f1-b97e-f6c3a5c677f4" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Mon, 13 Feb 2023 03:18:46 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2021-11-01", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0b86c4d5-7321-4587-a350-9d05f1379c6f", - "x-ms-ratelimit-remaining-subscription-deletes": "14996", - "x-ms-request-id": "be32b58b-54bc-45a7-9864-818b1b21ca54_M2CH3_M2CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031846Z:0b86c4d5-7321-4587-a350-9d05f1379c6f" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "f8b6eeca-7d5e-4ba0-868b-8d9dc7ae7360" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "698", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:18:47 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2021-11-01", - "Pragma": "no-cache", - "Retry-After": "48", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "9c6be69d-9dea-4924-871a-b6f1b2385cf4", - "x-ms-ratelimit-remaining-subscription-reads": "11973", - "x-ms-request-id": "50acf2a8-0d7c-4dea-81df-d86ba6a0c4d8_M2CH3_M2CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031847Z:9c6be69d-9dea-4924-871a-b6f1b2385cf4" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Succeeded", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:18:46.087Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Removing" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "08c543ed-9663-4060-a74c-a075cae91c75" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "698", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:18:47 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2021-11-01", - "Pragma": "no-cache", - "Retry-After": "34", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "3382234e-dd83-4f04-936f-002e5b23eb8b", - "x-ms-ratelimit-remaining-subscription-reads": "11972", - "x-ms-request-id": "fd79fd2e-ecd0-41e3-b6ae-f21f4b2c23da_M2CH3_M2CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031847Z:3382234e-dd83-4f04-936f-002e5b23eb8b" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Succeeded", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2023-02-13T03:17:05.337Z", - "updatedAt": "2023-02-13T03:18:46.087Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Removing" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-eventhub/5.1.1 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "dcd13a7e-99fb-4261-bdbc-fd39cfd15953" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Mon, 13 Feb 2023 03:19:21 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0cae64fb-e253-45bb-85b0-d9701458ff49", - "x-ms-ratelimit-remaining-subscription-reads": "11971", - "x-ms-request-id": "df85f407-6901-4a86-b058-16929d8482ae_M2CH3_M2CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031922Z:0cae64fb-e253-45bb-85b0-d9701458ff49" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/Microsoft.OperationalInsights/workspaces/myworkspacexxx?api-version=2021-06-01", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-operationalinsights/8.0.1 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "89f26b93-2dd8-4800-8ed2-06d10fd916ec" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Allow-Origin": "*", - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Mon, 13 Feb 2023 03:19:29 GMT", - "Pragma": "no-cache", - "Request-Context": "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "26c251b2-412f-4957-90b5-3a821cbc0efd", - "x-ms-ratelimit-remaining-subscription-deletes": "14995", - "x-ms-request-id": "910ba725-08ef-46d3-9bf5-59d6ea905c29", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031929Z:26c251b2-412f-4957-90b5-3a821cbc0efd", - "X-Powered-By": [ - "ASP.NET", - "ASP.NET" - ] - }, - "ResponseBody": null - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_create_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_create_test.json deleted file mode 100644 index e159382e12f2..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_create_test.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx/providers/Microsoft.Insights/diagnosticSettings/mydiagnosticxxxx?api-version=2021-05-01-preview", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "639", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "49e182b6-0c73-48da-b5ac-6baff34f63d3" - }, - "RequestBody": { - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "eventHubAuthorizationRuleId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/authorizationRules/myauthorizationRulexxx", - "eventHubName": "myeventhubxxx", - "metrics": [], - "logs": [ - { - "category": "WorkflowRuntime", - "enabled": true, - "retentionPolicy": { - "enabled": false, - "days": 0 - } - } - ], - "workspaceId": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.operationalinsights/workspaces/myworkspacexxx" - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:18:18 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "7fa5d1dd-d167-43b8-b43f-1e2d5c3b862b", - "x-ms-ratelimit-remaining-subscription-resource-requests": "149", - "x-ms-request-id": "24ba9da1-e808-49e6-a690-b9e42d68b681", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031819Z:7fa5d1dd-d167-43b8-b43f-1e2d5c3b862b" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.logic/workflows/myworkflowxxx/providers/microsoft.insights/diagnosticSettings/mydiagnosticxxxx", - "type": "Microsoft.Insights/diagnosticSettings", - "name": "mydiagnosticxxxx", - "location": null, - "kind": null, - "tags": null, - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "serviceBusRuleId": null, - "workspaceId": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.operationalinsights/workspaces/myworkspacexxx", - "eventHubAuthorizationRuleId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/authorizationRules/myauthorizationRulexxx", - "eventHubName": "myeventhubxxx", - "metrics": [], - "logs": [ - { - "category": "WorkflowRuntime", - "categoryGroup": null, - "enabled": true, - "retentionPolicy": { - "enabled": false, - "days": 0 - } - } - ], - "logAnalyticsDestinationType": null - }, - "identity": null - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_delete_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_delete_test.json deleted file mode 100644 index e50f9bb98f28..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_delete_test.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx/providers/Microsoft.Insights/diagnosticSettings/mydiagnosticxxxx?api-version=2021-05-01-preview", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "3baf1cd2-ce54-40a3-93e9-3838e8eb98f5" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Mon, 13 Feb 2023 03:18:22 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "51e56189-a0cd-4003-9e57-fe9d6cdc3a91", - "x-ms-ratelimit-remaining-subscription-deletes": "14999", - "x-ms-request-id": "9fd57e3e-c312-4b3c-a824-38ffe8fe1266", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031823Z:51e56189-a0cd-4003-9e57-fe9d6cdc3a91" - }, - "ResponseBody": null - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_get_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_get_test.json deleted file mode 100644 index 251c0aecc54f..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_get_test.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx/providers/Microsoft.Insights/diagnosticSettings/mydiagnosticxxxx?api-version=2021-05-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "7d7021a6-f73e-4094-af01-815c45a2b3b9" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:18:19 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "b09d9617-420a-4f9a-aeca-445b3e3e9749", - "x-ms-ratelimit-remaining-subscription-reads": "11977", - "x-ms-request-id": "fbf932d1-6e1b-4918-886a-375c5217a877", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031820Z:b09d9617-420a-4f9a-aeca-445b3e3e9749" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.logic/workflows/myworkflowxxx/providers/microsoft.insights/diagnosticSettings/mydiagnosticxxxx", - "type": "Microsoft.Insights/diagnosticSettings", - "name": "mydiagnosticxxxx", - "location": null, - "kind": null, - "tags": null, - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "serviceBusRuleId": null, - "workspaceId": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.operationalinsights/workspaces/myworkspacexxx", - "eventHubAuthorizationRuleId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/authorizationRules/myauthorizationRulexxx", - "eventHubName": "myeventhubxxx", - "metrics": [ - { - "category": "AllMetrics", - "enabled": false, - "retentionPolicy": { - "enabled": false, - "days": 0 - } - } - ], - "logs": [ - { - "category": "WorkflowRuntime", - "categoryGroup": null, - "enabled": true, - "retentionPolicy": { - "enabled": false, - "days": 0 - } - } - ], - "logAnalyticsDestinationType": null - }, - "identity": null - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_list_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_list_test.json deleted file mode 100644 index f721723386d8..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_list_test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Entries": [], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_create_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_create_test.json deleted file mode 100644 index dea762ce20c9..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_create_test.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Insights/logprofiles?api-version=2016-03-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "b2b0eed7-2bb0-4c9c-bfad-e1f220463244" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:18:23 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "ac92f551-8004-4efd-83a1-93db6948cdc3", - "x-ms-ratelimit-remaining-subscription-reads": "11976", - "x-ms-request-id": "0ac0e91f-3c34-454d-8246-98b08554727f", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031824Z:ac92f551-8004-4efd-83a1-93db6948cdc3" - }, - "ResponseBody": { - "value": [] - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Insights/logprofiles/mylogProfilexxx?api-version=2016-03-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "284", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "507c5992-e7d7-4c67-abe4-fa2a4ff826f3" - }, - "RequestBody": { - "location": "", - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "locations": [ - "global" - ], - "categories": [ - "Write", - "Delete", - "Action" - ], - "retentionPolicy": { - "enabled": true, - "days": 3 - } - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:18:26 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "061a1f29-aec7-43a6-9f4d-6b59f674136f", - "x-ms-ratelimit-remaining-subscription-writes": "1194", - "x-ms-request-id": "6fd43295-31de-4012-905b-284ace981681", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031827Z:061a1f29-aec7-43a6-9f4d-6b59f674136f" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/providers/microsoft.insights/logprofiles/mylogProfilexxx", - "type": null, - "name": "mylogProfilexxx", - "location": "", - "kind": null, - "tags": null, - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "serviceBusRuleId": null, - "locations": [ - "global" - ], - "categories": [ - "Write", - "Delete", - "Action" - ], - "retentionPolicy": { - "enabled": true, - "days": 3 - } - }, - "identity": null - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_delete_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_delete_test.json deleted file mode 100644 index 2c2f3ce9f963..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_delete_test.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Insights/logprofiles/mylogProfilexxx?api-version=2016-03-01", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "57cbd746-e85d-42aa-8d52-c598e1f39647" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Mon, 13 Feb 2023 03:19:31 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "bf9e98c7-5bde-4b42-bdc8-16ac2bdbfe16", - "x-ms-ratelimit-remaining-subscription-deletes": "14994", - "x-ms-request-id": "40a511e7-33ae-497e-a4d3-17fd8c4b0523", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031931Z:bf9e98c7-5bde-4b42-bdc8-16ac2bdbfe16" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Insights/logprofiles?api-version=2016-03-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "381b3d5e-9272-44dd-a7ec-6ebb782a5dfe" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:19:31 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "d14307b2-b8fe-4d6d-9b67-60c949fc8a6d", - "x-ms-ratelimit-remaining-subscription-reads": "11970", - "x-ms-request-id": "33412f1e-1bbe-4e1e-ba15-cbada8eb2c26", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031932Z:d14307b2-b8fe-4d6d-9b67-60c949fc8a6d" - }, - "ResponseBody": { - "value": [ - { - "id": "/subscriptions/azure_subscription_id/providers/microsoft.insights/logprofiles/mylogprofilexxx", - "type": null, - "name": "mylogprofilexxx", - "location": null, - "kind": null, - "tags": null, - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "serviceBusRuleId": null, - "locations": [ - "global" - ], - "categories": [ - "Write", - "Delete", - "Action" - ], - "retentionPolicy": { - "enabled": true, - "days": 3 - } - }, - "identity": null - } - ] - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_get_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_get_test.json deleted file mode 100644 index e6bed7f55b0f..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_get_test.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Insights/logprofiles/mylogProfilexxx?api-version=2016-03-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "fdb94995-94a8-4778-8f8f-2f40b941856e" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:18:27 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "2ae5a5a2-f472-46f1-9f04-00958a0e2e3d", - "x-ms-ratelimit-remaining-subscription-reads": "11975", - "x-ms-request-id": "d8256c6c-191f-4531-989a-dfd05ba85b07", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031828Z:2ae5a5a2-f472-46f1-9f04-00958a0e2e3d" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/providers/microsoft.insights/logprofiles/mylogProfilexxx", - "type": null, - "name": "mylogProfilexxx", - "location": null, - "kind": null, - "tags": null, - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "serviceBusRuleId": null, - "locations": [ - "global" - ], - "categories": [ - "Write", - "Delete", - "Action" - ], - "retentionPolicy": { - "enabled": true, - "days": 3 - } - }, - "identity": null - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_list_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_list_test.json deleted file mode 100644 index f89cc775519a..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_list_test.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Insights/logprofiles?api-version=2016-03-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.2 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "50a850fe-e8d4-48d9-a6e6-5be05c344748" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 13 Feb 2023 03:18:28 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "ca8dede3-34a8-4b84-90f4-eb4697bc8a1a", - "x-ms-ratelimit-remaining-subscription-reads": "11974", - "x-ms-request-id": "e35a0a72-3d6a-4fbf-83a8-968e19ef200c", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230213T031829Z:ca8dede3-34a8-4b84-90f4-eb4697bc8a1a" - }, - "ResponseBody": { - "value": [ - { - "id": "/subscriptions/azure_subscription_id/providers/microsoft.insights/logprofiles/mylogprofilexxx", - "type": null, - "name": "mylogprofilexxx", - "location": null, - "kind": null, - "tags": null, - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "serviceBusRuleId": null, - "locations": [ - "global" - ], - "categories": [ - "Write", - "Delete", - "Action" - ], - "retentionPolicy": { - "enabled": true, - "days": 3 - } - }, - "identity": null - } - ] - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_workspace_create_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_workspace_create_test.json deleted file mode 100644 index b31ab64df104..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_workspace_create_test.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Monitor/accounts/myAzureMonitorWorkspace?api-version=2021-06-03-preview", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "21", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "5c30bed4-7f27-45f8-84f0-6086b1d40e0e" - }, - "RequestBody": { - "location": "eastus" - }, - "StatusCode": 200, - "ResponseHeaders": { - "api-supported-versions": "2021-06-01-preview, 2021-06-03-preview", - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 07 Mar 2023 08:50:57 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Request-Context": "appId=cid-v1:74683e7d-3ee8-4856-bfe7-e63c83b6737e", - "Server": "Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": [ - "Accept-Encoding", - "Accept-Encoding" - ], - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "79de32e0-acf7-4b38-aa81-2ddd8fe9f597", - "x-ms-ratelimit-remaining-subscription-writes": "1199", - "x-ms-request-id": "79de32e0-acf7-4b38-aa81-2ddd8fe9f597", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230307T085057Z:79de32e0-acf7-4b38-aa81-2ddd8fe9f597" - }, - "ResponseBody": { - "properties": { - "accountId": "469d1399-c0ea-4aed-acca-a8d765eed6fa", - "metrics": { - "prometheusQueryEndpoint": "https://myazuremonitorworkspace-4thn.eastus.prometheus.monitor.azure.com", - "internalId": "mac_469d1399-c0ea-4aed-acca-a8d765eed6fa" - }, - "provisioningState": "Succeeded", - "defaultIngestionSettings": { - "dataCollectionRuleResourceId": "/subscriptions/azure_subscription_id/resourceGroups/MA_myazuremonitorworkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionRules/myazuremonitorworkspace", - "dataCollectionEndpointResourceId": "/subscriptions/azure_subscription_id/resourceGroups/MA_myazuremonitorworkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionEndpoints/myazuremonitorworkspace" - }, - "publicNetworkAccess": "Enabled" - }, - "location": "eastus", - "id": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.monitor/accounts/myazuremonitorworkspace", - "name": "myAzureMonitorWorkspace", - "type": "Microsoft.Monitor/accounts", - "etag": "\u0022c000066c-0000-0100-0000-6406faef0000\u0022", - "systemData": { - "createdBy": "azure_client_id", - "createdByType": "Application", - "createdAt": "2023-03-07T08:50:46.3984724Z", - "lastModifiedBy": "azure_client_id", - "lastModifiedByType": "Application", - "lastModifiedAt": "2023-03-07T08:50:46.3984724Z" - } - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_workspace_delete_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_workspace_delete_test.json deleted file mode 100644 index 1ef841df228f..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_workspace_delete_test.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Monitor/accounts/myAzureMonitorWorkspace?api-version=2021-06-03-preview", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "0b8ca247-0ce4-4527-a093-d4f1304388bc" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "api-supported-versions": "2021-06-01-preview, 2021-06-03-preview", - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Tue, 07 Mar 2023 08:52:26 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Request-Context": "appId=cid-v1:74683e7d-3ee8-4856-bfe7-e63c83b6737e", - "Server": "Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "828e09ae-b014-4cd2-8a4a-34792084ce66", - "x-ms-ratelimit-remaining-subscription-deletes": "14998", - "x-ms-request-id": "828e09ae-b014-4cd2-8a4a-34792084ce66", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230307T085226Z:828e09ae-b014-4cd2-8a4a-34792084ce66" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Monitor/accounts?api-version=2021-06-03-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "49931f00-9d74-4e0f-bcab-577536a1e440" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Length": "12", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 07 Mar 2023 08:52:26 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "61657585-eaca-4f45-87a6-5337130374b2", - "x-ms-ratelimit-remaining-subscription-reads": "11996", - "x-ms-request-id": "61657585-eaca-4f45-87a6-5337130374b2", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230307T085226Z:61657585-eaca-4f45-87a6-5337130374b2" - }, - "ResponseBody": { - "value": [] - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_workspace_get_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_workspace_get_test.json deleted file mode 100644 index ed42355ebcbe..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_workspace_get_test.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Monitor/accounts/myAzureMonitorWorkspace?api-version=2021-06-03-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "66b00649-81fc-47b1-81cc-19a2e854e5d5" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "api-supported-versions": "2021-06-01-preview, 2021-06-03-preview", - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 07 Mar 2023 08:50:58 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Request-Context": "appId=cid-v1:74683e7d-3ee8-4856-bfe7-e63c83b6737e", - "Server": "Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": [ - "Accept-Encoding", - "Accept-Encoding" - ], - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "b68b1484-c78e-457b-9a5e-fabe073b97e9", - "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "b68b1484-c78e-457b-9a5e-fabe073b97e9", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230307T085059Z:b68b1484-c78e-457b-9a5e-fabe073b97e9" - }, - "ResponseBody": { - "properties": { - "accountId": "469d1399-c0ea-4aed-acca-a8d765eed6fa", - "metrics": { - "prometheusQueryEndpoint": "https://myazuremonitorworkspace-4thn.eastus.prometheus.monitor.azure.com", - "internalId": "mac_469d1399-c0ea-4aed-acca-a8d765eed6fa" - }, - "provisioningState": "Succeeded", - "defaultIngestionSettings": { - "dataCollectionRuleResourceId": "/subscriptions/azure_subscription_id/resourceGroups/MA_myazuremonitorworkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionRules/myazuremonitorworkspace", - "dataCollectionEndpointResourceId": "/subscriptions/azure_subscription_id/resourceGroups/MA_myazuremonitorworkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionEndpoints/myazuremonitorworkspace" - }, - "publicNetworkAccess": "Enabled" - }, - "location": "eastus", - "id": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.monitor/accounts/myazuremonitorworkspace", - "name": "myAzureMonitorWorkspace", - "type": "Microsoft.Monitor/accounts", - "etag": "\u0022c000066c-0000-0100-0000-6406faef0000\u0022", - "systemData": { - "createdBy": "azure_client_id", - "createdByType": "Application", - "createdAt": "2023-03-07T08:50:46.3984724Z", - "lastModifiedBy": "azure_client_id", - "lastModifiedByType": "Application", - "lastModifiedAt": "2023-03-07T08:50:46.3984724Z" - } - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_workspace_list_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_workspace_list_test.json deleted file mode 100644 index 973b9ce40781..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_workspace_list_test.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Monitor/accounts?api-version=2021-06-03-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.4 core-rest-pipeline/1.10.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", - "x-ms-client-request-id": "906726e2-4e50-4d0c-a7b2-8f8d8bfa68b2" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "api-supported-versions": "2021-06-01-preview, 2021-06-03-preview", - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 07 Mar 2023 08:51:00 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Request-Context": "appId=cid-v1:74683e7d-3ee8-4856-bfe7-e63c83b6737e", - "Server": "Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": [ - "Accept-Encoding", - "Accept-Encoding" - ], - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "3935d163-7338-4d00-b876-3256e927749b", - "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "3935d163-7338-4d00-b876-3256e927749b", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230307T085100Z:3935d163-7338-4d00-b876-3256e927749b" - }, - "ResponseBody": { - "value": [ - { - "properties": { - "accountId": "469d1399-c0ea-4aed-acca-a8d765eed6fa", - "metrics": { - "prometheusQueryEndpoint": "https://myazuremonitorworkspace-4thn.eastus.prometheus.monitor.azure.com", - "internalId": "mac_469d1399-c0ea-4aed-acca-a8d765eed6fa" - }, - "provisioningState": "Succeeded", - "defaultIngestionSettings": { - "dataCollectionRuleResourceId": "/subscriptions/azure_subscription_id/resourceGroups/MA_myazuremonitorworkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionRules/myazuremonitorworkspace", - "dataCollectionEndpointResourceId": "/subscriptions/azure_subscription_id/resourceGroups/MA_myazuremonitorworkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionEndpoints/myazuremonitorworkspace" - }, - "publicNetworkAccess": "Enabled" - }, - "location": "eastus", - "id": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.monitor/accounts/myazuremonitorworkspace", - "name": "myAzureMonitorWorkspace", - "type": "Microsoft.Monitor/accounts", - "etag": "\u0022c000066c-0000-0100-0000-6406faef0000\u0022", - "systemData": { - "createdBy": "azure_client_id", - "createdByType": "Application", - "createdAt": "2023-03-07T08:50:46.3984724Z", - "lastModifiedBy": "azure_client_id", - "lastModifiedByType": "Application", - "lastModifiedAt": "2023-03-07T08:50:46.3984724Z" - } - } - ], - "nextLink": null - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/review/arm-monitor.api.md b/sdk/monitor/arm-monitor/review/arm-monitor.api.md index fd3bea84ffb9..838c3ebee57d 100644 --- a/sdk/monitor/arm-monitor/review/arm-monitor.api.md +++ b/sdk/monitor/arm-monitor/review/arm-monitor.api.md @@ -59,6 +59,14 @@ export interface ActionGroupPatchBody { }; } +// @public +export interface ActionGroupPatchBodyAutoGenerated { + enabled?: boolean; + tags?: { + [propertyName: string]: string; + }; +} + // @public export interface ActionGroupResource extends AzureResource { armRoleReceivers?: ArmRoleReceiver[]; @@ -80,17 +88,11 @@ export interface ActionGroupResource extends AzureResource { export interface ActionGroups { beginCreateNotificationsAtActionGroupResourceLevel(resourceGroupName: string, actionGroupName: string, notificationRequest: NotificationRequestBody, options?: ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams): Promise, ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse>>; beginCreateNotificationsAtActionGroupResourceLevelAndWait(resourceGroupName: string, actionGroupName: string, notificationRequest: NotificationRequestBody, options?: ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams): Promise; - beginCreateNotificationsAtResourceGroupLevel(resourceGroupName: string, notificationRequest: NotificationRequestBody, options?: ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams): Promise, ActionGroupsCreateNotificationsAtResourceGroupLevelResponse>>; - beginCreateNotificationsAtResourceGroupLevelAndWait(resourceGroupName: string, notificationRequest: NotificationRequestBody, options?: ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams): Promise; - beginPostTestNotifications(notificationRequest: NotificationRequestBody, options?: ActionGroupsPostTestNotificationsOptionalParams): Promise, ActionGroupsPostTestNotificationsResponse>>; - beginPostTestNotificationsAndWait(notificationRequest: NotificationRequestBody, options?: ActionGroupsPostTestNotificationsOptionalParams): Promise; createOrUpdate(resourceGroupName: string, actionGroupName: string, actionGroup: ActionGroupResource, options?: ActionGroupsCreateOrUpdateOptionalParams): Promise; delete(resourceGroupName: string, actionGroupName: string, options?: ActionGroupsDeleteOptionalParams): Promise; enableReceiver(resourceGroupName: string, actionGroupName: string, enableRequest: EnableRequest, options?: ActionGroupsEnableReceiverOptionalParams): Promise; get(resourceGroupName: string, actionGroupName: string, options?: ActionGroupsGetOptionalParams): Promise; - getTestNotifications(notificationId: string, options?: ActionGroupsGetTestNotificationsOptionalParams): Promise; getTestNotificationsAtActionGroupResourceLevel(resourceGroupName: string, actionGroupName: string, notificationId: string, options?: ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams): Promise; - getTestNotificationsAtResourceGroupLevel(resourceGroupName: string, notificationId: string, options?: ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: ActionGroupsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscriptionId(options?: ActionGroupsListBySubscriptionIdOptionalParams): PagedAsyncIterableIterator; update(resourceGroupName: string, actionGroupName: string, actionGroupPatch: ActionGroupPatchBody, options?: ActionGroupsUpdateOptionalParams): Promise; @@ -110,20 +112,6 @@ export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOption // @public export type ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse = TestNotificationDetailsResponse; -// @public -export interface ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders { - location?: string; -} - -// @public -export interface ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type ActionGroupsCreateNotificationsAtResourceGroupLevelResponse = TestNotificationDetailsResponse; - // @public export interface ActionGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { } @@ -153,20 +141,6 @@ export interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptio // @public export type ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse = TestNotificationDetailsResponse; -// @public -export interface ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse = TestNotificationDetailsResponse; - -// @public -export interface ActionGroupsGetTestNotificationsOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ActionGroupsGetTestNotificationsResponse = TestNotificationDetailsResponse; - // @public export interface ActionGroupsListByResourceGroupOptionalParams extends coreClient.OperationOptions { } @@ -181,20 +155,6 @@ export interface ActionGroupsListBySubscriptionIdOptionalParams extends coreClie // @public export type ActionGroupsListBySubscriptionIdResponse = ActionGroupList; -// @public -export interface ActionGroupsPostTestNotificationsHeaders { - location?: string; -} - -// @public -export interface ActionGroupsPostTestNotificationsOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type ActionGroupsPostTestNotificationsResponse = TestNotificationDetailsResponse; - // @public export interface ActionGroupsUpdateOptionalParams extends coreClient.OperationOptions { } @@ -368,7 +328,7 @@ export interface AlertRulePatchObject { } // @public -export interface AlertRuleResource extends ResourceAutoGenerated { +export interface AlertRuleResource extends ResourceAutoGenerated3 { action?: RuleActionUnion; actions?: RuleActionUnion[]; condition: RuleConditionUnion; @@ -500,7 +460,7 @@ export interface AutoscaleProfile { } // @public -export interface AutoscaleSettingResource extends Resource { +export interface AutoscaleSettingResource extends ResourceAutoGenerated2 { enabled?: boolean; namePropertiesName?: string; notifications?: AutoscaleNotification[]; @@ -599,6 +559,12 @@ export interface AzureAppPushReceiver { name: string; } +// @public +export interface AzureAppPushReceiverAutoGenerated { + emailAddress: string; + name: string; +} + // @public export interface AzureFunctionReceiver { functionAppResourceId: string; @@ -614,9 +580,9 @@ export interface AzureMonitorMetricsDestination { } // @public -export interface AzureMonitorPrivateLinkScope extends TrackedResource { +export interface AzureMonitorPrivateLinkScope extends TrackedResourceAutoGenerated { accessModeSettings: AccessModeSettings; - readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly privateEndpointConnections?: PrivateEndpointConnectionAutoGenerated[]; readonly provisioningState?: string; readonly systemData?: SystemData; } @@ -632,7 +598,9 @@ export interface AzureMonitorWorkspace { readonly accountId?: string; readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; readonly metrics?: AzureMonitorWorkspaceMetrics; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: ProvisioningState; + readonly publicNetworkAccess?: PublicNetworkAccess; } // @public @@ -644,12 +612,14 @@ export interface AzureMonitorWorkspaceMetrics extends Metrics { } // @public -export interface AzureMonitorWorkspaceResource extends TrackedResourceAutoGenerated { +export interface AzureMonitorWorkspaceResource extends TrackedResource { readonly accountId?: string; readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; readonly etag?: string; readonly metrics?: AzureMonitorWorkspaceMetrics; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: ProvisioningState; + readonly publicNetworkAccess?: PublicNetworkAccess; } // @public @@ -671,8 +641,9 @@ export interface AzureMonitorWorkspaceResourceProperties extends AzureMonitorWor // @public export interface AzureMonitorWorkspaces { + beginDelete(resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesDeleteOptionalParams): Promise, AzureMonitorWorkspacesDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesDeleteOptionalParams): Promise; create(resourceGroupName: string, azureMonitorWorkspaceName: string, azureMonitorWorkspaceProperties: AzureMonitorWorkspaceResource, options?: AzureMonitorWorkspacesCreateOptionalParams): Promise; - delete(resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesDeleteOptionalParams): Promise; get(resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesGetOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: AzureMonitorWorkspacesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: AzureMonitorWorkspacesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; @@ -686,10 +657,23 @@ export interface AzureMonitorWorkspacesCreateOptionalParams extends coreClient.O // @public export type AzureMonitorWorkspacesCreateResponse = AzureMonitorWorkspaceResource; +// @public +export interface AzureMonitorWorkspacesDeleteHeaders { + // (undocumented) + azureAsyncOperation?: string; + // (undocumented) + location?: string; +} + // @public export interface AzureMonitorWorkspacesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } +// @public +export type AzureMonitorWorkspacesDeleteResponse = AzureMonitorWorkspacesDeleteHeaders; + // @public export interface AzureMonitorWorkspacesGetOptionalParams extends coreClient.OperationOptions { } @@ -839,9 +823,13 @@ export type CriterionType = string; export interface DataCollectionEndpoint { configurationAccess?: DataCollectionEndpointConfigurationAccess; description?: string; + readonly failoverConfiguration?: DataCollectionEndpointFailoverConfiguration; immutableId?: string; logsIngestion?: DataCollectionEndpointLogsIngestion; + readonly metadata?: DataCollectionEndpointMetadata; + metricsIngestion?: DataCollectionEndpointMetricsIngestion; networkAcls?: DataCollectionEndpointNetworkAcls; + readonly privateLinkScopedResources?: PrivateLinkScopedResource[]; readonly provisioningState?: KnownDataCollectionEndpointProvisioningState; } @@ -849,10 +837,22 @@ export interface DataCollectionEndpoint { export interface DataCollectionEndpointConfigurationAccess extends ConfigurationAccessEndpointSpec { } +// @public +export interface DataCollectionEndpointFailoverConfiguration extends FailoverConfigurationSpec { +} + // @public export interface DataCollectionEndpointLogsIngestion extends LogsIngestionEndpointSpec { } +// @public +export interface DataCollectionEndpointMetadata extends Metadata { +} + +// @public +export interface DataCollectionEndpointMetricsIngestion extends MetricsIngestionEndpointSpec { +} + // @public export interface DataCollectionEndpointNetworkAcls extends NetworkRuleSet { } @@ -862,13 +862,18 @@ export interface DataCollectionEndpointResource { configurationAccess?: DataCollectionEndpointConfigurationAccess; description?: string; readonly etag?: string; + readonly failoverConfiguration?: DataCollectionEndpointFailoverConfiguration; readonly id?: string; + identity?: DataCollectionEndpointResourceIdentity; immutableId?: string; kind?: KnownDataCollectionEndpointResourceKind; location: string; logsIngestion?: DataCollectionEndpointLogsIngestion; + readonly metadata?: DataCollectionEndpointMetadata; + metricsIngestion?: DataCollectionEndpointMetricsIngestion; readonly name?: string; networkAcls?: DataCollectionEndpointNetworkAcls; + readonly privateLinkScopedResources?: PrivateLinkScopedResource[]; readonly provisioningState?: KnownDataCollectionEndpointProvisioningState; readonly systemData?: DataCollectionEndpointResourceSystemData; tags?: { @@ -877,6 +882,10 @@ export interface DataCollectionEndpointResource { readonly type?: string; } +// @public +export interface DataCollectionEndpointResourceIdentity extends ManagedServiceIdentity { +} + // @public export interface DataCollectionEndpointResourceListResult { nextLink?: string; @@ -1104,6 +1113,7 @@ export interface DataCollectionRuleResource { destinations?: DataCollectionRuleDestinations; readonly etag?: string; readonly id?: string; + identity?: DataCollectionRuleResourceIdentity; readonly immutableId?: string; kind?: KnownDataCollectionRuleResourceKind; location: string; @@ -1120,6 +1130,10 @@ export interface DataCollectionRuleResource { readonly type?: string; } +// @public +export interface DataCollectionRuleResourceIdentity extends ManagedServiceIdentity { +} + // @public export interface DataCollectionRuleResourceListResult { nextLink?: string; @@ -1206,20 +1220,38 @@ export interface DataContainer { // @public export interface DataFlow { + builtInTransform?: string; destinations?: string[]; outputStream?: string; streams?: KnownDataFlowStreams[]; transformKql?: string; } +// @public (undocumented) +export interface DataImportSources { + eventHub?: DataImportSourcesEventHub; +} + +// @public +export interface DataImportSourcesEventHub extends EventHubDataSource { +} + // @public export interface DataSourcesSpec { + dataImports?: DataSourcesSpecDataImports; extensions?: ExtensionDataSource[]; iisLogs?: IisLogsDataSource[]; logFiles?: LogFilesDataSource[]; performanceCounters?: PerfCounterDataSource[]; + platformTelemetry?: PlatformTelemetryDataSource[]; + prometheusForwarder?: PrometheusForwarderDataSource[]; syslog?: SyslogDataSource[]; windowsEventLogs?: WindowsEventLogDataSource[]; + windowsFirewallLogs?: WindowsFirewallLogsDataSource[]; +} + +// @public +export interface DataSourcesSpecDataImports extends DataImportSources { } // @public @@ -1227,13 +1259,19 @@ export type DataStatus = string; // @public export interface DefaultErrorResponse { - error?: ErrorDetail; + error?: ErrorDetailAutoGenerated; } // @public export interface DestinationsSpec { azureMonitorMetrics?: DestinationsSpecAzureMonitorMetrics; + eventHubs?: EventHubDestination[]; + eventHubsDirect?: EventHubDirectDestination[]; logAnalytics?: LogAnalyticsDestination[]; + monitoringAccounts?: MonitoringAccountDestination[]; + storageAccounts?: StorageBlobDestination[]; + storageBlobsDirect?: StorageBlobDestination[]; + storageTablesDirect?: StorageTableDestination[]; } // @public @@ -1269,7 +1307,7 @@ export interface DiagnosticSettingsCategoryListOptionalParams extends coreClient export type DiagnosticSettingsCategoryListResponse = DiagnosticSettingsCategoryResourceCollection; // @public -export interface DiagnosticSettingsCategoryResource extends ResourceAutoGenerated3 { +export interface DiagnosticSettingsCategoryResource extends ResourceAutoGenerated5 { categoryGroups?: string[]; categoryType?: CategoryType; readonly systemData?: SystemData; @@ -1306,7 +1344,7 @@ export interface DiagnosticSettingsListOptionalParams extends coreClient.Operati export type DiagnosticSettingsListResponse = DiagnosticSettingsResourceCollection; // @public -export interface DiagnosticSettingsResource extends ResourceAutoGenerated3 { +export interface DiagnosticSettingsResource extends ResourceAutoGenerated5 { eventHubAuthorizationRuleId?: string; eventHubName?: string; logAnalyticsDestinationType?: string; @@ -1370,6 +1408,14 @@ export interface EmailReceiver { useCommonAlertSchema?: boolean; } +// @public +export interface EmailReceiverAutoGenerated { + emailAddress: string; + name: string; + readonly status?: ReceiverStatus; + useCommonAlertSchema?: boolean; +} + // @public export interface EnableRequest { receiverName: string; @@ -1383,6 +1429,11 @@ export interface ErrorAdditionalInfo { // @public export interface ErrorContract { + error?: ErrorResponseAutoGenerated; +} + +// @public +export interface ErrorContractAutoGenerated { error?: ErrorResponseDetails; } @@ -1412,8 +1463,7 @@ export interface ErrorModel { // @public export interface ErrorResponse { - code?: string; - message?: string; + error?: ErrorDetail; } // @public @@ -1424,18 +1474,19 @@ export interface ErrorResponseAdditionalInfo { // @public export interface ErrorResponseAutoGenerated { - readonly code?: string; - readonly message?: string; + code?: string; + message?: string; } // @public export interface ErrorResponseAutoGenerated2 { - error?: ErrorDetailAutoGenerated; + readonly code?: string; + readonly message?: string; } // @public export interface ErrorResponseCommonV2 { - error?: ErrorDetail; + error?: ErrorDetailAutoGenerated; } // @public @@ -1502,6 +1553,25 @@ export interface EventDataCollection { value: EventData[]; } +// @public (undocumented) +export interface EventHubDataSource { + consumerGroup?: string; + name?: string; + stream?: string; +} + +// @public (undocumented) +export interface EventHubDestination { + eventHubResourceId?: string; + name?: string; +} + +// @public (undocumented) +export interface EventHubDirectDestination { + eventHubResourceId?: string; + name?: string; +} + // @public export interface EventHubReceiver { eventHubName: string; @@ -1524,6 +1594,12 @@ export interface ExtensionDataSource { streams?: KnownExtensionDataSourceStreams[]; } +// @public (undocumented) +export interface FailoverConfigurationSpec { + activeLocation?: string; + locations?: LocationSpec[]; +} + // @public export function getContinuationToken(page: unknown): string | undefined; @@ -1712,6 +1788,7 @@ export enum KnownKnownColumnDefinitionType { // @public export enum KnownKnownDataCollectionEndpointProvisioningState { + Canceled = "Canceled", Creating = "Creating", Deleting = "Deleting", Failed = "Failed", @@ -1727,6 +1804,7 @@ export enum KnownKnownDataCollectionEndpointResourceKind { // @public export enum KnownKnownDataCollectionRuleAssociationProvisioningState { + Canceled = "Canceled", Creating = "Creating", Deleting = "Deleting", Failed = "Failed", @@ -1736,6 +1814,7 @@ export enum KnownKnownDataCollectionRuleAssociationProvisioningState { // @public export enum KnownKnownDataCollectionRuleProvisioningState { + Canceled = "Canceled", Creating = "Creating", Deleting = "Deleting", Failed = "Failed", @@ -1767,6 +1846,16 @@ export enum KnownKnownExtensionDataSourceStreams { MicrosoftWindowsEvent = "Microsoft-WindowsEvent" } +// @public +export enum KnownKnownLocationSpecProvisioningStatus { + Canceled = "Canceled", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + // @public export enum KnownKnownLogFilesDataSourceFormat { Text = "text" @@ -1791,10 +1880,16 @@ export enum KnownKnownPerfCounterDataSourceStreams { MicrosoftPerf = "Microsoft-Perf" } +// @public +export enum KnownKnownPrometheusForwarderDataSourceStreams { + MicrosoftPrometheusMetrics = "Microsoft-PrometheusMetrics" +} + // @public export enum KnownKnownPublicNetworkAccessOptions { Disabled = "Disabled", - Enabled = "Enabled" + Enabled = "Enabled", + SecuredByPerimeter = "SecuredByPerimeter" } // @public @@ -1846,12 +1941,33 @@ export enum KnownKnownWindowsEventLogDataSourceStreams { MicrosoftWindowsEvent = "Microsoft-WindowsEvent" } +// @public +export type KnownLocationSpecProvisioningStatus = string; + // @public export type KnownLogFilesDataSourceFormat = string; // @public export type KnownLogFileTextSettingsRecordStartTimestampFormat = string; +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownMetricAggregationType { + Average = "Average", + Count = "Count", + Maximum = "Maximum", + Minimum = "Minimum", + None = "None", + Total = "Total" +} + // @public export enum KnownMetricClass { Availability = "Availability", @@ -1861,6 +1977,12 @@ export enum KnownMetricClass { Transactions = "Transactions" } +// @public +export enum KnownMetricResultType { + Data = "Data", + Metadata = "Metadata" +} + // @public export enum KnownMetricUnit { BitsPerSecond = "BitsPerSecond", @@ -1933,6 +2055,9 @@ export enum KnownPrivateEndpointServiceConnectionStatus { Rejected = "Rejected" } +// @public +export type KnownPrometheusForwarderDataSourceStreams = string; + // @public export enum KnownProvisioningState { Canceled = "Canceled", @@ -1985,6 +2110,12 @@ export interface LocalizableString { value: string; } +// @public (undocumented) +export interface LocationSpec { + location?: string; + provisioningStatus?: KnownLocationSpecProvisioningStatus; +} + // @public export interface LocationThresholdRuleCondition extends RuleCondition { failedLocationCount: number; @@ -2040,7 +2171,7 @@ export interface LogProfileCollection { } // @public -export interface LogProfileResource extends ResourceAutoGenerated2 { +export interface LogProfileResource extends ResourceAutoGenerated4 { categories: string[]; locations: string[]; retentionPolicy: RetentionPolicy; @@ -2114,6 +2245,19 @@ export interface LogsIngestionEndpointSpec { readonly endpoint?: string; } +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity | null; + }; +} + +// @public +export type ManagedServiceIdentityType = string; + // @public export interface ManagementEventAggregationCondition { operator?: ConditionOperator; @@ -2130,6 +2274,7 @@ export interface ManagementEventRuleCondition extends RuleCondition { // @public export interface Metadata { readonly provisionedBy?: string; + readonly provisionedByResourceId?: string; } // @public @@ -2147,9 +2292,12 @@ export interface Metric { name: LocalizableString; timeseries: TimeSeriesElement[]; type: string; - unit: MetricUnit; + unit: Unit; } +// @public +export type MetricAggregationType = string; + // @public export interface MetricAlertAction { actionGroupId?: string; @@ -2174,7 +2322,7 @@ export interface MetricAlertMultipleResourceMultipleMetricCriteria extends Metri } // @public -export interface MetricAlertResource extends ResourceAutoGenerated4 { +export interface MetricAlertResource extends ResourceAutoGenerated6 { actions?: MetricAlertAction[]; autoMitigate?: boolean; criteria: MetricAlertCriteriaUnion; @@ -2358,8 +2506,17 @@ export interface MetricDefinitionCollection { // @public export interface MetricDefinitions { list(resourceUri: string, options?: MetricDefinitionsListOptionalParams): PagedAsyncIterableIterator; + listAtSubscriptionScope(region: string, options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface MetricDefinitionsListAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { + metricnamespace?: string; +} + +// @public +export type MetricDefinitionsListAtSubscriptionScopeResponse = SubscriptionScopeMetricDefinitionCollection; + // @public export interface MetricDefinitionsListOptionalParams extends coreClient.OperationOptions { metricnamespace?: string; @@ -2407,6 +2564,9 @@ export interface MetricNamespacesListOptionalParams extends coreClient.Operation // @public export type MetricNamespacesListResponse = MetricNamespaceCollection; +// @public +export type MetricResultType = string; + // @public export interface Metrics { readonly internalId?: string; @@ -2421,15 +2581,58 @@ export interface MetricSettings { timeGrain?: string; } +// @public +export interface MetricsIngestionEndpointSpec { + readonly endpoint?: string; +} + // @public export interface MetricSingleDimension { name: string; value: string; } +// @public +export interface MetricsListAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { + aggregation?: string; + autoAdjustTimegrain?: boolean; + filter?: string; + interval?: string; + metricnames?: string; + metricnamespace?: string; + orderby?: string; + resultType?: MetricResultType; + timespan?: string; + top?: number; + validateDimensions?: boolean; +} + +// @public +export interface MetricsListAtSubscriptionScopePostOptionalParams extends coreClient.OperationOptions { + aggregation?: string; + autoAdjustTimegrain?: boolean; + body?: SubscriptionScopeMetricsRequestBodyParameters; + filter?: string; + interval?: string; + metricnames?: string; + metricnamespace?: string; + orderby?: string; + resultType?: MetricResultType; + timespan?: string; + top?: number; + validateDimensions?: boolean; +} + +// @public +export type MetricsListAtSubscriptionScopePostResponse = SubscriptionScopeMetricResponse; + +// @public +export type MetricsListAtSubscriptionScopeResponse = SubscriptionScopeMetricResponse; + // @public export interface MetricsListOptionalParams extends coreClient.OperationOptions { aggregation?: string; + autoAdjustTimegrain?: boolean; filter?: string; interval?: string; metricnames?: string; @@ -2438,6 +2641,7 @@ export interface MetricsListOptionalParams extends coreClient.OperationOptions { resultType?: ResultType; timespan?: string; top?: number; + validateDimensions?: boolean; } // @public @@ -2446,6 +2650,8 @@ export type MetricsListResponse = Response_2; // @public export interface MetricsOperations { list(resourceUri: string, options?: MetricsListOptionalParams): Promise; + listAtSubscriptionScope(region: string, options?: MetricsListAtSubscriptionScopeOptionalParams): Promise; + listAtSubscriptionScopePost(region: string, options?: MetricsListAtSubscriptionScopePostOptionalParams): Promise; } // @public @@ -2546,6 +2752,8 @@ export class MonitorClient extends coreClient.ServiceClient { // (undocumented) subscriptionId: string; // (undocumented) + tenantActionGroups: TenantActionGroups; + // (undocumented) tenantActivityLogs: TenantActivityLogs; // (undocumented) vMInsights: VMInsights; @@ -2557,9 +2765,16 @@ export interface MonitorClientOptionalParams extends coreClient.ServiceClientOpt endpoint?: string; } +// @public +export interface MonitoringAccountDestination { + readonly accountId?: string; + accountResourceId?: string; + name?: string; +} + // @public export interface MonitorOperations { - list(options?: MonitorOperationsListOptionalParams): PagedAsyncIterableIterator; + list(options?: MonitorOperationsListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -2567,14 +2782,14 @@ export interface MonitorOperationsListNextOptionalParams extends coreClient.Oper } // @public -export type MonitorOperationsListNextResponse = OperationListResultAutoGenerated; +export type MonitorOperationsListNextResponse = OperationListResult; // @public export interface MonitorOperationsListOptionalParams extends coreClient.OperationOptions { } // @public -export type MonitorOperationsListResponse = OperationListResultAutoGenerated; +export type MonitorOperationsListResponse = OperationListResult; // @public export interface MultiMetricCriteria { @@ -2623,44 +2838,44 @@ export type OnboardingStatus = string; // @public export interface Operation { - display?: OperationDisplay; - name?: string; -} - -// @public -export interface OperationAutoGenerated { readonly actionType?: ActionType; - display?: OperationDisplayAutoGenerated; + display?: OperationDisplay; readonly isDataAction?: boolean; readonly name?: string; readonly origin?: Origin; } // @public -export interface OperationDisplay { - operation?: string; - provider?: string; - resource?: string; +export interface OperationAutoGenerated { + display?: OperationDisplayAutoGenerated; + name?: string; } // @public -export interface OperationDisplayAutoGenerated { +export interface OperationDisplay { readonly description?: string; readonly operation?: string; readonly provider?: string; readonly resource?: string; } +// @public +export interface OperationDisplayAutoGenerated { + operation?: string; + provider?: string; + resource?: string; +} + // @public export interface OperationListResult { - nextLink?: string; - value?: Operation[]; + readonly nextLink?: string; + readonly value?: Operation[]; } // @public export interface OperationListResultAutoGenerated { - readonly nextLink?: string; - readonly value?: OperationAutoGenerated[]; + nextLink?: string; + value?: OperationAutoGenerated[]; } // @public @@ -2673,12 +2888,12 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption } // @public -export type OperationsListResponse = OperationListResult; +export type OperationsListResponse = OperationListResultAutoGenerated; // @public export interface OperationStatus { endTime?: Date; - error?: ErrorDetail; + error?: ErrorDetailAutoGenerated; id?: string; name?: string; startTime?: Date; @@ -2699,6 +2914,12 @@ export interface PerfCounterDataSource { streams?: KnownPerfCounterDataSourceStreams[]; } +// @public +export interface PlatformTelemetryDataSource { + name?: string; + streams: string[]; +} + // @public export interface PredictiveAutoscalePolicy { scaleLookAheadTime?: string; @@ -2741,15 +2962,28 @@ export interface PrivateEndpoint { } // @public -export interface PrivateEndpointConnection extends ResourceAutoGenerated3 { +export interface PrivateEndpointAutoGenerated { + readonly id?: string; +} + +// @public +export interface PrivateEndpointConnection extends Resource { + readonly groupIds?: string[]; privateEndpoint?: PrivateEndpoint; privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - readonly provisioningState?: PrivateEndpointConnectionProvisioningState; + provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +// @public +export interface PrivateEndpointConnectionAutoGenerated extends ResourceAutoGenerated5 { + privateEndpoint?: PrivateEndpointAutoGenerated; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + provisioningState?: PrivateEndpointConnectionProvisioningState; } // @public export interface PrivateEndpointConnectionListResult { - value?: PrivateEndpointConnection[]; + value?: PrivateEndpointConnectionAutoGenerated[]; } // @public @@ -2757,8 +2991,8 @@ export type PrivateEndpointConnectionProvisioningState = string; // @public export interface PrivateEndpointConnections { - beginCreateOrUpdate(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise, PrivateEndpointConnectionsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnectionAutoGenerated, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise, PrivateEndpointConnectionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnectionAutoGenerated, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise; beginDelete(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; get(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; @@ -2772,7 +3006,7 @@ export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams extends } // @public -export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnectionAutoGenerated; // @public export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { @@ -2785,7 +3019,7 @@ export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient. } // @public -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnectionAutoGenerated; // @public export interface PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams extends coreClient.OperationOptions { @@ -2798,7 +3032,7 @@ export type PrivateEndpointConnectionsListByPrivateLinkScopeResponse = PrivateEn export type PrivateEndpointServiceConnectionStatus = string; // @public -export interface PrivateLinkResource extends ResourceAutoGenerated3 { +export interface PrivateLinkResource extends ResourceAutoGenerated5 { readonly groupId?: string; readonly requiredMembers?: string[]; requiredZoneNames?: string[]; @@ -2829,6 +3063,12 @@ export interface PrivateLinkResourcesListByPrivateLinkScopeOptionalParams extend // @public export type PrivateLinkResourcesListByPrivateLinkScopeResponse = PrivateLinkResourceListResult; +// @public (undocumented) +export interface PrivateLinkScopedResource { + resourceId?: string; + scopeId?: string; +} + // @public export interface PrivateLinkScopedResources { beginCreateOrUpdate(resourceGroupName: string, scopeName: string, name: string, parameters: ScopedResource, options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams): Promise, PrivateLinkScopedResourcesCreateOrUpdateResponse>>; @@ -2960,6 +3200,15 @@ export interface PrivateLinkServiceConnectionState { status?: PrivateEndpointServiceConnectionStatus; } +// @public +export interface PrometheusForwarderDataSource { + labelIncludeFilter?: { + [propertyName: string]: string; + }; + name?: string; + streams?: KnownPrometheusForwarderDataSourceStreams[]; +} + // @public export type ProvisioningState = string; @@ -2971,7 +3220,7 @@ export interface ProxyResource { } // @public -export interface ProxyResourceAutoGenerated extends ResourceAutoGenerated3 { +export interface ProxyResourceAutoGenerated extends ResourceAutoGenerated5 { } // @public @@ -3000,23 +3249,16 @@ export interface RecurrentSchedule { // @public export interface Resource { readonly id?: string; - location: string; readonly name?: string; readonly systemData?: SystemData; - tags?: { - [propertyName: string]: string; - }; readonly type?: string; } // @public export interface ResourceAutoGenerated { readonly id?: string; - location: string; readonly name?: string; - tags?: { - [propertyName: string]: string; - }; + readonly systemData?: SystemData; readonly type?: string; } @@ -3025,6 +3267,7 @@ export interface ResourceAutoGenerated2 { readonly id?: string; location: string; readonly name?: string; + readonly systemData?: SystemData; tags?: { [propertyName: string]: string; }; @@ -3034,7 +3277,11 @@ export interface ResourceAutoGenerated2 { // @public export interface ResourceAutoGenerated3 { readonly id?: string; + location: string; readonly name?: string; + tags?: { + [propertyName: string]: string; + }; readonly type?: string; } @@ -3053,17 +3300,32 @@ export interface ResourceAutoGenerated4 { export interface ResourceAutoGenerated5 { readonly id?: string; readonly name?: string; - readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ResourceAutoGenerated6 { + readonly id?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; readonly type?: string; } // @public export interface ResourceForUpdate { + identity?: ResourceForUpdateIdentity; tags?: { [propertyName: string]: string; }; } +// @public +export interface ResourceForUpdateIdentity extends ManagedServiceIdentity { +} + // @public interface Response_2 { cost?: number; @@ -3385,11 +3647,93 @@ export interface SmsReceiver { readonly status?: ReceiverStatus; } +// @public +export interface SmsReceiverAutoGenerated { + countryCode: string; + name: string; + phoneNumber: string; + readonly status?: ReceiverStatus; +} + +// @public (undocumented) +export interface StorageBlobDestination { + containerName?: string; + name?: string; + storageAccountResourceId?: string; +} + +// @public (undocumented) +export interface StorageTableDestination { + name?: string; + storageAccountResourceId?: string; + tableName?: string; +} + // @public export interface StreamDeclaration { columns?: ColumnDefinition[]; } +// @public +export interface SubscriptionScopeMetric { + displayDescription?: string; + errorCode?: string; + errorMessage?: string; + id: string; + name: LocalizableString; + timeseries: TimeSeriesElement[]; + type: string; + unit: MetricUnit; +} + +// @public +export interface SubscriptionScopeMetricDefinition { + category?: string; + dimensions?: LocalizableString[]; + displayDescription?: string; + id?: string; + isDimensionRequired?: boolean; + metricAvailabilities?: MetricAvailability[]; + metricClass?: MetricClass; + name?: LocalizableString; + namespace?: string; + primaryAggregationType?: MetricAggregationType; + resourceId?: string; + supportedAggregationTypes?: MetricAggregationType[]; + unit?: MetricUnit; +} + +// @public +export interface SubscriptionScopeMetricDefinitionCollection { + value: SubscriptionScopeMetricDefinition[]; +} + +// @public +export interface SubscriptionScopeMetricResponse { + cost?: number; + interval?: string; + namespace?: string; + resourceregion?: string; + timespan: string; + value: SubscriptionScopeMetric[]; +} + +// @public +export interface SubscriptionScopeMetricsRequestBodyParameters { + aggregation?: string; + autoAdjustTimegrain?: boolean; + filter?: string; + interval?: string; + metricNames?: string; + metricNamespace?: string; + orderBy?: string; + resultType?: MetricResultType; + rollUpBy?: string; + timespan?: string; + top?: number; + validateDimensions?: boolean; +} + // @public export interface SyslogDataSource { facilityNames?: KnownSyslogDataSourceFacilityNames[]; @@ -3415,6 +3759,64 @@ export interface TagsResource { }; } +// @public +export interface TenantActionGroupList { + nextLink?: string; + value?: TenantActionGroupResource[]; +} + +// @public +export interface TenantActionGroupResource extends AzureResource { + azureAppPushReceivers?: AzureAppPushReceiverAutoGenerated[]; + emailReceivers?: EmailReceiverAutoGenerated[]; + enabled?: boolean; + groupShortName?: string; + smsReceivers?: SmsReceiverAutoGenerated[]; + voiceReceivers?: VoiceReceiverAutoGenerated[]; + webhookReceivers?: WebhookReceiverAutoGenerated[]; +} + +// @public +export interface TenantActionGroups { + createOrUpdate(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, actionGroup: TenantActionGroupResource, options?: TenantActionGroupsCreateOrUpdateOptionalParams): Promise; + delete(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, options?: TenantActionGroupsDeleteOptionalParams): Promise; + get(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, options?: TenantActionGroupsGetOptionalParams): Promise; + listByManagementGroupId(managementGroupId: string, xMsClientTenantId: string, options?: TenantActionGroupsListByManagementGroupIdOptionalParams): PagedAsyncIterableIterator; + update(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, tenantActionGroupPatch: ActionGroupPatchBodyAutoGenerated, options?: TenantActionGroupsUpdateOptionalParams): Promise; +} + +// @public +export interface TenantActionGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TenantActionGroupsCreateOrUpdateResponse = TenantActionGroupResource; + +// @public +export interface TenantActionGroupsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface TenantActionGroupsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TenantActionGroupsGetResponse = TenantActionGroupResource; + +// @public +export interface TenantActionGroupsListByManagementGroupIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TenantActionGroupsListByManagementGroupIdResponse = TenantActionGroupList; + +// @public +export interface TenantActionGroupsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TenantActionGroupsUpdateResponse = TenantActionGroupResource; + // @public export interface TenantActivityLogs { list(options?: TenantActivityLogsListOptionalParams): PagedAsyncIterableIterator; @@ -3486,7 +3888,7 @@ export interface TimeWindow { } // @public -export interface TrackedResource extends ResourceAutoGenerated3 { +export interface TrackedResource extends ResourceAutoGenerated { location: string; tags?: { [propertyName: string]: string; @@ -3501,6 +3903,15 @@ export interface TrackedResourceAutoGenerated extends ResourceAutoGenerated5 { }; } +// @public +export type Unit = "Count" | "Bytes" | "Seconds" | "CountPerSecond" | "BytesPerSecond" | "Percent" | "MilliSeconds" | "ByteSeconds" | "Unspecified" | "Cores" | "MilliCores" | "NanoCores" | "BitsPerSecond"; + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + // @public export interface UserIdentityProperties { readonly clientId?: string; @@ -3534,6 +3945,13 @@ export interface VoiceReceiver { phoneNumber: string; } +// @public +export interface VoiceReceiverAutoGenerated { + countryCode: string; + name: string; + phoneNumber: string; +} + // @public export interface WebhookNotification { properties?: { @@ -3553,6 +3971,17 @@ export interface WebhookReceiver { useCommonAlertSchema?: boolean; } +// @public +export interface WebhookReceiverAutoGenerated { + identifierUri?: string; + name: string; + objectId?: string; + serviceUri: string; + tenantId?: string; + useAadAuth?: boolean; + useCommonAlertSchema?: boolean; +} + // @public export interface WebtestLocationAvailabilityCriteria extends MetricAlertCriteria { componentId: string; @@ -3568,6 +3997,12 @@ export interface WindowsEventLogDataSource { xPathQueries?: string[]; } +// @public +export interface WindowsFirewallLogsDataSource { + name?: string; + streams: string[]; +} + // @public export interface WorkspaceInfo { customerId: string; diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts deleted file mode 100644 index f675456f49f4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestRgName"; - const actionGroupName = "TestAgName"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait( - resourceGroupName, - actionGroupName, - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts deleted file mode 100644 index ef9f52b11f34..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-TestNotifications"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName, - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateOrUpdateSample.ts deleted file mode 100644 index 0d8f5181c84d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ActionGroupResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a new action group or update an existing one. - * - * @summary Create a new action group or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json - */ -async function createOrUpdateAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const actionGroup: ActionGroupResource = { - armRoleReceivers: [ - { - name: "Sample armRole", - roleId: "8e3af657-a8ff-443c-a75c-2fe8c4bcb635", - useCommonAlertSchema: true - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - enabled: true, - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - groupShortName: "sample", - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - location: "Global", - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - tags: {}, - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.createOrUpdate( - resourceGroupName, - actionGroupName, - actionGroup - ); - console.log(result); -} - -async function main() { - createOrUpdateAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsDeleteSample.ts deleted file mode 100644 index 7b955a5715d2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete an action group. - * - * @summary Delete an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json - */ -async function deleteAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.delete( - resourceGroupName, - actionGroupName - ); - console.log(result); -} - -async function main() { - deleteAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsEnableReceiverSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsEnableReceiverSample.ts deleted file mode 100644 index cff901ba8be7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsEnableReceiverSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { EnableRequest, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * - * @summary Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json - */ -async function enableTheReceiver() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const enableRequest: EnableRequest = { receiverName: "John Doe's mobile" }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.enableReceiver( - resourceGroupName, - actionGroupName, - enableRequest - ); - console.log(result); -} - -async function main() { - enableTheReceiver(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetSample.ts deleted file mode 100644 index 39fe3b9fca0a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get an action group. - * - * @summary Get an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json - */ -async function getAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.get( - resourceGroupName, - actionGroupName - ); - console.log(result); -} - -async function main() { - getAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts deleted file mode 100644 index cf60c919b027..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestRgName"; - const actionGroupName = "TestAgName"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtActionGroupResourceLevel( - resourceGroupName, - actionGroupName, - notificationId - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts deleted file mode 100644 index 2d98821e1de7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-TestNotifications"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtResourceGroupLevel( - resourceGroupName, - notificationId - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsSample.ts deleted file mode 100644 index 25cd9a72018c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsSample.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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json - */ -async function getNotificationDetailsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotifications(notificationId); - console.log(result); -} - -async function main() { - getNotificationDetailsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsListByResourceGroupSample.ts deleted file mode 100644 index 505dc900d581..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all action groups in a resource group. - * - * @summary Get a list of all action groups in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.actionGroups.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActionGroupsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsListBySubscriptionIdSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsListBySubscriptionIdSample.ts deleted file mode 100644 index 1b40a18b9ef0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all action groups in a subscription. - * - * @summary Get a list of all action groups in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.actionGroups.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActionGroupsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsPostTestNotificationsSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsPostTestNotificationsSample.ts deleted file mode 100644 index 153ade7de654..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsPostTestNotificationsSample.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json - */ -async function createNotificationsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginPostTestNotificationsAndWait( - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsUpdateSample.ts deleted file mode 100644 index 80b2b49eabac..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsUpdateSample.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. -import { ActionGroupPatchBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json - */ -async function patchAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const actionGroupPatch: ActionGroupPatchBody = { - enabled: false, - tags: { key1: "value1", key2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.update( - resourceGroupName, - actionGroupName, - actionGroupPatch - ); - console.log(result); -} - -async function main() { - patchAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsCreateOrUpdateSample.ts deleted file mode 100644 index b3c9a4e2f415..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ActivityLogAlertResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json - */ -async function createOrUpdateAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const activityLogAlertRule: ActivityLogAlertResource = { - description: "Description of sample Activity Log Alert rule.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" } - } - ] - }, - condition: { - allOf: [ - { equals: "Administrative", field: "category" }, - { equals: "Error", field: "level" } - ] - }, - enabled: true, - location: "Global", - scopes: ["/subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithAnyOfCondition.json - */ -async function createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRuleWithAnyOfCondition"; - const activityLogAlertRule: ActivityLogAlertResource = { - description: - "Description of sample Activity Log Alert rule with 'anyOf' condition.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" } - } - ] - }, - condition: { - allOf: [ - { equals: "ServiceHealth", field: "category" }, - { - anyOf: [ - { equals: "Incident", field: "properties.incidentType" }, - { equals: "Maintenance", field: "properties.incidentType" } - ] - } - ] - }, - enabled: true, - location: "Global", - scopes: ["subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithContainsAny.json - */ -async function createOrUpdateAnActivityLogAlertRuleWithContainsAny() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRuleWithContainsAny"; - const activityLogAlertRule: ActivityLogAlertResource = { - description: - "Description of sample Activity Log Alert rule with 'containsAny'.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" } - } - ] - }, - condition: { - allOf: [ - { equals: "ServiceHealth", field: "category" }, - { - containsAny: ["North Europe", "West Europe"], - field: "properties.impactedServices[*].ImpactedRegions[*].RegionName" - } - ] - }, - enabled: true, - location: "Global", - scopes: ["subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -async function main() { - createOrUpdateAnActivityLogAlertRule(); - createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition(); - createOrUpdateAnActivityLogAlertRuleWithContainsAny(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsDeleteSample.ts deleted file mode 100644 index 15271385aee4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete an Activity Log Alert rule. - * - * @summary Delete an Activity Log Alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json - */ -async function deleteAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.delete( - resourceGroupName, - activityLogAlertName - ); - console.log(result); -} - -async function main() { - deleteAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsGetSample.ts deleted file mode 100644 index 9e1909525bc2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get an Activity Log Alert rule. - * - * @summary Get an Activity Log Alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json - */ -async function getAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.get( - resourceGroupName, - activityLogAlertName - ); - console.log(result); -} - -async function main() { - getAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListByResourceGroupSample.ts deleted file mode 100644 index a198638e54b2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all Activity Log Alert rules in a resource group. - * - * @summary Get a list of all Activity Log Alert rules in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json - */ -async function listActivityLogAlerts() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogAlerts.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActivityLogAlerts(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListBySubscriptionIdSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListBySubscriptionIdSample.ts deleted file mode 100644 index 173f96e013a3..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all Activity Log Alert rules in a subscription. - * - * @summary Get a list of all Activity Log Alert rules in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json - */ -async function getListOfAllActivityLogAlertRulesUnderASubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogAlerts.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getListOfAllActivityLogAlertRulesUnderASubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsUpdateSample.ts deleted file mode 100644 index 54bd68fc2c84..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsUpdateSample.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. -import { AlertRulePatchObject, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. - * - * @summary Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json - */ -async function patchAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const activityLogAlertRulePatch: AlertRulePatchObject = { - enabled: false, - tags: { key1: "value1", key2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.update( - resourceGroupName, - activityLogAlertName, - activityLogAlertRulePatch - ); - console.log(result); -} - -async function main() { - patchAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogsListSample.ts deleted file mode 100644 index d58594916b8c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogsListSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ActivityLogsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Provides the list of records from the activity logs. - * - * @summary Provides the list of records from the activity logs. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json - */ -async function getActivityLogsWithFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogs.list(filter)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Provides the list of records from the activity logs. - * - * @summary Provides the list of records from the activity logs. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFilteredAndSelected.json - */ -async function getActivityLogsWithFilterAndSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: ActivityLogsListOptionalParams = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogs.list(filter, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getActivityLogsWithFilter(); - getActivityLogsWithFilterAndSelect(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsGetSample.ts deleted file mode 100644 index fb92424c0220..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets an incident associated to an alert rule - * - * @summary Gets an incident associated to an alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json - */ -async function getASingleAlertRuleIncident() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "myRuleName"; - const incidentName = "Website_started"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRuleIncidents.get( - resourceGroupName, - ruleName, - incidentName - ); - console.log(result); -} - -async function main() { - getASingleAlertRuleIncident(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsListByAlertRuleSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsListByAlertRuleSample.ts deleted file mode 100644 index 0dc8d87947d2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsListByAlertRuleSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of incidents associated to an alert rule - * - * @summary Gets a list of incidents associated to an alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json - */ -async function listAlertRuleIncidents() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "myRuleName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRuleIncidents.listByAlertRule( - resourceGroupName, - ruleName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRuleIncidents(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRulesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRulesCreateOrUpdateSample.ts deleted file mode 100644 index dfe78856925c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a classic metric alert rule. - * - * @summary Creates or updates a classic metric alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json - */ -async function createOrUpdateAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const parameters: AlertRuleResource = { - namePropertiesName: "chiricutin", - description: "Pura Vida", - actions: [], - condition: { - dataSource: { - metricName: "Requests", - odataType: - "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - resourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest" - }, - odataType: - "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - operator: "GreaterThan", - threshold: 3, - timeAggregation: "Total", - windowSize: "PT5M" - }, - isEnabled: true, - location: "West US", - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRulesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRulesDeleteSample.ts deleted file mode 100644 index 6bd0b7f8913b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a classic metric alert rule - * - * @summary Deletes a classic metric alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json - */ -async function deleteAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRulesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRulesGetSample.ts deleted file mode 100644 index 1eed90dfd819..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a classic metric alert rule - * - * @summary Gets a classic metric alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json - */ -async function getAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRulesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRulesListByResourceGroupSample.ts deleted file mode 100644 index 3b5450f105b0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the classic metric alert rules within a resource group. - * - * @summary List the classic metric alert rules within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json - */ -async function listAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRules.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRulesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRulesListBySubscriptionSample.ts deleted file mode 100644 index 04a8b5846cd7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the classic metric alert rules within a subscription. - * - * @summary List the classic metric alert rules within a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json - */ -async function listAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRulesUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRulesUpdateSample.ts deleted file mode 100644 index 5096a58eb37f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesUpdateSample.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRuleResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json - */ -async function patchAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const alertRulesResource: AlertRuleResourcePatch = { - name: "chiricutin", - description: "Pura Vida", - actions: [], - condition: { - dataSource: { - metricName: "Requests", - odataType: - "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - resourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest" - }, - odataType: - "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - operator: "GreaterThan", - threshold: 3, - timeAggregation: "Total", - windowSize: "PT5M" - }, - isEnabled: true, - tags: { - $type: - "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary" - } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.update( - resourceGroupName, - ruleName, - alertRulesResource - ); - console.log(result); -} - -async function main() { - patchAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsCreateOrUpdateSample.ts deleted file mode 100644 index 9c9021581f86..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AutoscaleSettingResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an autoscale setting. - * - * @summary Creates or updates an autoscale setting. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json - */ -async function createOrUpdateAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const parameters: AutoscaleSettingResource = { - enabled: true, - location: "West US", - notifications: [ - { - email: { - customEmails: ["gu@ms.com", "ge@ns.net"], - sendToSubscriptionAdministrator: true, - sendToSubscriptionCoAdministrators: true - }, - operation: "Scale", - webhooks: [{ properties: {}, serviceUri: "http://myservice.com" }] - } - ], - predictiveAutoscalePolicy: { scaleMode: "Enabled" }, - profiles: [ - { - name: "adios", - capacity: { default: "1", maximum: "10", minimum: "1" }, - fixedDate: { - end: new Date("2015-03-05T14:30:00Z"), - start: new Date("2015-03-05T14:00:00Z"), - timeZone: "UTC" - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - }, - { - name: "saludos", - capacity: { default: "1", maximum: "10", minimum: "1" }, - recurrence: { - frequency: "Week", - schedule: { days: ["1"], hours: [5], minutes: [15], timeZone: "UTC" } - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - } - ], - tags: { key1: "value1", key2: "value2" }, - targetResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.createOrUpdate( - resourceGroupName, - autoscaleSettingName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsDeleteSample.ts deleted file mode 100644 index d40921fc31be..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes and autoscale setting - * - * @summary Deletes and autoscale setting - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json - */ -async function deleteAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.delete( - resourceGroupName, - autoscaleSettingName - ); - console.log(result); -} - -async function main() { - deleteAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsGetSample.ts deleted file mode 100644 index 8d41ae5c506b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets an autoscale setting - * - * @summary Gets an autoscale setting - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json - */ -async function getAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.get( - resourceGroupName, - autoscaleSettingName - ); - console.log(result); -} - -async function main() { - getAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListByResourceGroupSample.ts deleted file mode 100644 index 27a63fcea6f6..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the autoscale settings for a resource group - * - * @summary Lists the autoscale settings for a resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json - */ -async function listAutoscaleSettings() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.autoscaleSettings.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAutoscaleSettings(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListBySubscriptionSample.ts deleted file mode 100644 index 726e2114046d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the autoscale settings for a subscription - * - * @summary Lists the autoscale settings for a subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json - */ -async function listAutoscaleSettingsBySubs() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.autoscaleSettings.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAutoscaleSettingsBySubs(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsUpdateSample.ts deleted file mode 100644 index 5b30e31e28df..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsUpdateSample.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AutoscaleSettingResourcePatch, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json - */ -async function patchAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const autoscaleSettingResource: AutoscaleSettingResourcePatch = { - enabled: true, - notifications: [ - { - email: { - customEmails: ["gu@ms.com", "ge@ns.net"], - sendToSubscriptionAdministrator: true, - sendToSubscriptionCoAdministrators: true - }, - operation: "Scale", - webhooks: [{ properties: {}, serviceUri: "http://myservice.com" }] - } - ], - predictiveAutoscalePolicy: { scaleMode: "Enabled" }, - profiles: [ - { - name: "adios", - capacity: { default: "1", maximum: "10", minimum: "1" }, - fixedDate: { - end: new Date("2015-03-05T14:30:00Z"), - start: new Date("2015-03-05T14:00:00Z"), - timeZone: "UTC" - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - }, - { - name: "saludos", - capacity: { default: "1", maximum: "10", minimum: "1" }, - recurrence: { - frequency: "Week", - schedule: { days: ["1"], hours: [5], minutes: [15], timeZone: "UTC" } - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - } - ], - tags: { key1: "value1" }, - targetResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.update( - resourceGroupName, - autoscaleSettingName, - autoscaleSettingResource - ); - console.log(result); -} - -async function main() { - patchAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesCreateSample.ts b/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesCreateSample.ts deleted file mode 100644 index cd950812a39c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesCreateSample.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. -import { - AzureMonitorWorkspaceResource, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update a workspace - * - * @summary Create or update a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesCreate.json - */ -async function createOrUpdateWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const azureMonitorWorkspaceProperties: AzureMonitorWorkspaceResource = { - location: "eastus" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.create( - resourceGroupName, - azureMonitorWorkspaceName, - azureMonitorWorkspaceProperties - ); - console.log(result); -} - -async function main() { - createOrUpdateWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesDeleteSample.ts deleted file mode 100644 index 540b8c1a8c3e..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a workspace - * - * @summary Delete a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesDelete.json - */ -async function deleteWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.delete( - resourceGroupName, - azureMonitorWorkspaceName - ); - console.log(result); -} - -async function main() { - deleteWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesGetSample.ts deleted file mode 100644 index 9d42224702c5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specific Azure Monitor workspace - * - * @summary Returns the specific Azure Monitor workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesGet.json - */ -async function getWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.get( - resourceGroupName, - azureMonitorWorkspaceName - ); - console.log(result); -} - -async function main() { - getWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListByResourceGroupSample.ts deleted file mode 100644 index d33e9e1033e5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all workspaces in the specified resource group - * - * @summary Lists all workspaces in the specified resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json - */ -async function listMonitorWorkspacesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMonitorWorkspacesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListBySubscriptionSample.ts deleted file mode 100644 index 67073eac8ea5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all workspaces in the specified subscription - * - * @summary Lists all workspaces in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListBySubscription.json - */ -async function listWorkspacesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listWorkspacesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesUpdateSample.ts deleted file mode 100644 index 16f3bf41e057..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesUpdateSample.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AzureMonitorWorkspaceResourceForUpdate, - AzureMonitorWorkspacesUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates part of a workspace - * - * @summary Updates part of a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesUpdate.json - */ -async function updateWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const azureMonitorWorkspaceProperties: AzureMonitorWorkspaceResourceForUpdate = { - tags: { tag1: "A", tag2: "B", tag3: "C" } - }; - const options: AzureMonitorWorkspacesUpdateOptionalParams = { - azureMonitorWorkspaceProperties - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.update( - resourceGroupName, - azureMonitorWorkspaceName, - options - ); - console.log(result); -} - -async function main() { - updateWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/baselinesListSample.ts b/sdk/monitor/arm-monitor/samples-dev/baselinesListSample.ts deleted file mode 100644 index 14eb069dd324..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/baselinesListSample.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. -import { BaselinesListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to **Lists the metric baseline values for a resource**. - * - * @summary **Lists the metric baseline values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json - */ -async function getMetricBaselines() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1"; - const timespan = "2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z"; - const interval = "PT1H"; - const aggregation = "average"; - const sensitivities = "Low,Medium"; - const options: BaselinesListOptionalParams = { - timespan, - interval, - aggregation, - sensitivities - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.baselines.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getMetricBaselines(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsCreateSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsCreateSample.ts deleted file mode 100644 index 519b967cab5f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DataCollectionEndpointResource, - DataCollectionEndpointsCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a data collection endpoint. - * - * @summary Creates or updates a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json - */ -async function createOrUpdateDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const body: DataCollectionEndpointResource = { - location: "eastus", - networkAcls: { publicNetworkAccess: "Enabled" } - }; - const options: DataCollectionEndpointsCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.create( - resourceGroupName, - dataCollectionEndpointName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsDeleteSample.ts deleted file mode 100644 index 7a0edbdcc6fb..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a data collection endpoint. - * - * @summary Deletes a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json - */ -async function deleteDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.delete( - resourceGroupName, - dataCollectionEndpointName - ); - console.log(result); -} - -async function main() { - deleteDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsGetSample.ts deleted file mode 100644 index 8b65d70d4b9f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specified data collection endpoint. - * - * @summary Returns the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json - */ -async function getDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.get( - resourceGroupName, - dataCollectionEndpointName - ); - console.log(result); -} - -async function main() { - getDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListByResourceGroupSample.ts deleted file mode 100644 index 733401f8e149..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified resource group. - * - * @summary Lists all data collection endpoints in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json - */ -async function listDataCollectionEndpointsByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionEndpoints.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionEndpointsByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListBySubscriptionSample.ts deleted file mode 100644 index f9a0d214965b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified subscription - * - * @summary Lists all data collection endpoints in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json - */ -async function listDataCollectionEndpointsBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionEndpoints.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionEndpointsBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsUpdateSample.ts deleted file mode 100644 index b0b5564c3a59..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsUpdateSample.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. -import { - ResourceForUpdate, - DataCollectionEndpointsUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates part of a data collection endpoint. - * - * @summary Updates part of a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json - */ -async function updateDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const body: ResourceForUpdate = { tags: { tag1: "A", tag2: "B", tag3: "C" } }; - const options: DataCollectionEndpointsUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.update( - resourceGroupName, - dataCollectionEndpointName, - options - ); - console.log(result); -} - -async function main() { - updateDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsCreateSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsCreateSample.ts deleted file mode 100644 index 758df428def8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DataCollectionRuleAssociationProxyOnlyResource, - DataCollectionRuleAssociationsCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an association. - * - * @summary Creates or updates an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json - */ -async function createOrUpdateAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const body: DataCollectionRuleAssociationProxyOnlyResource = { - dataCollectionRuleId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule" - }; - const options: DataCollectionRuleAssociationsCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.create( - resourceUri, - associationName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsDeleteSample.ts deleted file mode 100644 index 1034e30e337a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes an association. - * - * @summary Deletes an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json - */ -async function deleteAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.delete( - resourceUri, - associationName - ); - console.log(result); -} - -async function main() { - deleteAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsGetSample.ts deleted file mode 100644 index 35540040a92e..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specified association. - * - * @summary Returns the specified association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json - */ -async function getAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.get( - resourceUri, - associationName - ); - console.log(result); -} - -async function main() { - getAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts deleted file mode 100644 index 6d97bace404b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists associations for the specified data collection endpoint. - * - * @summary Lists associations for the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json - */ -async function listAssociationsForSpecifiedDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myDataCollectionEndpointName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByDataCollectionEndpoint( - resourceGroupName, - dataCollectionEndpointName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByResourceSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByResourceSample.ts deleted file mode 100644 index 11ffcd21d8f5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByResourceSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists associations for the specified resource. - * - * @summary Lists associations for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json - */ -async function listAssociationsForSpecifiedResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByResource( - resourceUri - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByRuleSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByRuleSample.ts deleted file mode 100644 index 6cccd9d83a75..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByRuleSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists associations for the specified data collection rule. - * - * @summary Lists associations for the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json - */ -async function listAssociationsForSpecifiedDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByRule( - resourceGroupName, - dataCollectionRuleName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesCreateSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesCreateSample.ts deleted file mode 100644 index db801c866f14..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesCreateSample.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DataCollectionRuleResource, - DataCollectionRulesCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a data collection rule. - * - * @summary Creates or updates a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json - */ -async function createOrUpdateDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const body: DataCollectionRuleResource = { - dataFlows: [ - { - destinations: ["centralWorkspace"], - streams: [ - "Microsoft-Perf", - "Microsoft-Syslog", - "Microsoft-WindowsEvent" - ] - } - ], - dataSources: { - performanceCounters: [ - { - name: "cloudTeamCoreCounters", - counterSpecifiers: [ - "\\Processor(_Total)\\% Processor Time", - "\\Memory\\Committed Bytes", - "\\LogicalDisk(_Total)\\Free Megabytes", - "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length" - ], - samplingFrequencyInSeconds: 15, - streams: ["Microsoft-Perf"] - }, - { - name: "appTeamExtraCounters", - counterSpecifiers: ["\\Process(_Total)\\Thread Count"], - samplingFrequencyInSeconds: 30, - streams: ["Microsoft-Perf"] - } - ], - syslog: [ - { - name: "cronSyslog", - facilityNames: ["cron"], - logLevels: ["Debug", "Critical", "Emergency"], - streams: ["Microsoft-Syslog"] - }, - { - name: "syslogBase", - facilityNames: ["syslog"], - logLevels: ["Alert", "Critical", "Emergency"], - streams: ["Microsoft-Syslog"] - } - ], - windowsEventLogs: [ - { - name: "cloudSecurityTeamEvents", - streams: ["Microsoft-WindowsEvent"], - xPathQueries: ["Security!"] - }, - { - name: "appTeam1AppEvents", - streams: ["Microsoft-WindowsEvent"], - xPathQueries: [ - "System![System[(Level = 1 or Level = 2 or Level = 3)]]", - "Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]" - ] - } - ] - }, - destinations: { - logAnalytics: [ - { - name: "centralWorkspace", - workspaceResourceId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace" - } - ] - }, - location: "eastus" - }; - const options: DataCollectionRulesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.create( - resourceGroupName, - dataCollectionRuleName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesDeleteSample.ts deleted file mode 100644 index 4becc7faf8c8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a data collection rule. - * - * @summary Deletes a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json - */ -async function deleteDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.delete( - resourceGroupName, - dataCollectionRuleName - ); - console.log(result); -} - -async function main() { - deleteDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesGetSample.ts deleted file mode 100644 index 833b20532bdb..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specified data collection rule. - * - * @summary Returns the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json - */ -async function getDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.get( - resourceGroupName, - dataCollectionRuleName - ); - console.log(result); -} - -async function main() { - getDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListByResourceGroupSample.ts deleted file mode 100644 index 3a5ad5f3084a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified resource group. - * - * @summary Lists all data collection rules in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json - */ -async function listDataCollectionRulesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRules.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionRulesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListBySubscriptionSample.ts deleted file mode 100644 index 509f9ffdb351..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified subscription. - * - * @summary Lists all data collection rules in the specified subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json - */ -async function listDataCollectionRulesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionRulesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesUpdateSample.ts deleted file mode 100644 index 3cedeb4a88a2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesUpdateSample.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. -import { - ResourceForUpdate, - DataCollectionRulesUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates part of a data collection rule. - * - * @summary Updates part of a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json - */ -async function updateDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const body: ResourceForUpdate = { tags: { tag1: "A", tag2: "B", tag3: "C" } }; - const options: DataCollectionRulesUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.update( - resourceGroupName, - dataCollectionRuleName, - options - ); - console.log(result); -} - -async function main() { - updateDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryGetSample.ts deleted file mode 100644 index 769917b066a8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the diagnostic settings category for the specified resource. - * - * @summary Gets the diagnostic settings category for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "WorkflowRuntime"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettingsCategory.get(resourceUri, name); - console.log(result); -} - -async function main() { - getsTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryListSample.ts b/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryListSample.ts deleted file mode 100644 index a7d2472c1194..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryListSample.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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the diagnostic settings categories for the specified resource. - * - * @summary Lists the diagnostic settings categories for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettingsCategory.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCreateOrUpdateSample.ts deleted file mode 100644 index 31843adcbddf..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DiagnosticSettingsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json - */ -async function createsOrUpdatesTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters: DiagnosticSettingsResource = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - categoryGroup: "allLogs", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSettingCategory.json - */ -async function createsOrUpdatesTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters: DiagnosticSettingsResource = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters - ); - console.log(result); -} - -async function main() { - createsOrUpdatesTheDiagnosticSetting(); - createsOrUpdatesTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsDeleteSample.ts deleted file mode 100644 index d99ca747b606..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes existing diagnostic settings for the specified resource. - * - * @summary Deletes existing diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json - */ -async function deletesTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.delete(resourceUri, name); - console.log(result); -} - -async function main() { - deletesTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsGetSample.ts deleted file mode 100644 index 51552f38193b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsGetSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -async function main() { - getsTheDiagnosticSetting(); - getsTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsListSample.ts deleted file mode 100644 index 0927d272c404..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsListSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsTheDiagnosticSetting(); - getsTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/eventCategoriesListSample.ts b/sdk/monitor/arm-monitor/samples-dev/eventCategoriesListSample.ts deleted file mode 100644 index 43a5ac1c8845..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/eventCategoriesListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @summary Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json - */ -async function getEventCategories() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.eventCategories.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getEventCategories(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/logProfilesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/logProfilesCreateOrUpdateSample.ts deleted file mode 100644 index ace58a8b0b8e..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesCreateOrUpdateSample.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. -import { LogProfileResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update a log profile in Azure Monitoring REST API. - * - * @summary Create or update a log profile in Azure Monitoring REST API. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json - */ -async function createOrUpdateALogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "Rac46PostSwapRG"; - const parameters: LogProfileResource = { - categories: ["Write", "Delete", "Action"], - location: "", - locations: ["global"], - retentionPolicy: { days: 3, enabled: true }, - serviceBusRuleId: "", - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162", - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.createOrUpdate( - logProfileName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateALogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/logProfilesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/logProfilesDeleteSample.ts deleted file mode 100644 index c264d326b6a3..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesDeleteSample.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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes the log profile. - * - * @summary Deletes the log profile. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json - */ -async function deleteLogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const logProfileName = "Rac46PostSwapRG"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.delete(logProfileName); - console.log(result); -} - -async function main() { - deleteLogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/logProfilesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/logProfilesGetSample.ts deleted file mode 100644 index 9e2f9f31105a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesGetSample.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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the log profile. - * - * @summary Gets the log profile. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json - */ -async function getLogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "default"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.get(logProfileName); - console.log(result); -} - -async function main() { - getLogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/logProfilesListSample.ts b/sdk/monitor/arm-monitor/samples-dev/logProfilesListSample.ts deleted file mode 100644 index 717850be0c5a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the log profiles. - * - * @summary List the log profiles. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json - */ -async function listLogProfiles() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listLogProfiles(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/logProfilesUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/logProfilesUpdateSample.ts deleted file mode 100644 index 32c9825f24f7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesUpdateSample.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. -import { LogProfileResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json - */ -async function patchALogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "Rac46PostSwapRG"; - const logProfilesResource: LogProfileResourcePatch = { - categories: ["Write", "Delete", "Action"], - locations: ["global"], - retentionPolicy: { days: 3, enabled: true }, - serviceBusRuleId: "", - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162", - tags: { key1: "value1" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.update( - logProfileName, - logProfilesResource - ); - console.log(result); -} - -async function main() { - patchALogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsCreateOrUpdateSample.ts deleted file mode 100644 index d609df81bd95..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,504 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricAlertResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json - */ -async function createOrUpdateADynamicAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - alertSensitivity: "Medium", - criterionType: "DynamicThresholdCriterion", - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 4, - numberOfEvaluationPeriods: 4 - }, - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterOrLessThan", - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2" - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertSingleResource.json - */ -async function createOrUpdateADynamicAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - alertSensitivity: "Medium", - criterionType: "DynamicThresholdCriterion", - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 4, - numberOfEvaluationPeriods: 4 - }, - ignoreDataBefore: new Date("2019-04-04T21:00:00.000Z"), - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterOrLessThan", - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - severity: 3, - tags: {}, - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateWebTestMetricAlert.json - */ -async function createOrUpdateAWebTestAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "rg-example"; - const ruleName = "webtest-name-example"; - const parameters: MetricAlertResource = { - description: - 'Automatically created alert rule for availability test "component-example" a', - actions: [], - criteria: { - componentId: - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", - failedLocationCount: 2, - odataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", - webTestId: - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example" - ], - severity: 4, - tags: { - "hiddenLink:/subscriptions/12345678123412341234123456789101/resourcegroups/rgExample/providers/microsoftInsights/components/webtestNameExample": - "Resource", - "hiddenLink:/subscriptions/12345678123412341234123456789101/resourcegroups/rgExample/providers/microsoftInsights/webtests/componentExample": - "Resource" - }, - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertMultipleResource.json - */ -async function createOrUpdateAnAlertRuleForMultipleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1", - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2" - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSingleResource.json - */ -async function createOrUpdateAnAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "\\Processor(_Total)\\% Processor Time", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "Pt1m", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - severity: 3, - tags: {}, - windowSize: "Pt15m" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertResourceGroup.json - */ -async function createOrUpdateAnAlertRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest1"; - const ruleName = "MetricAlertAtResourceGroupLevel"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1", - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2" - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSubscription.json - */ -async function createOrUpdateAnAlertRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertAtSubscriptionLevel"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: ["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertWithDimensions.json - */ -async function createOrUpdateAnAlertRulesWithDimensions() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleDimensions"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "Metric1", - criterionType: "StaticThresholdCriterion", - dimensions: [ - { name: "ActivityName", operator: "Include", values: ["*"] }, - { name: "StatusCode", operator: "Include", values: ["200"] } - ], - metricName: "Availability", - metricNamespace: "Microsoft.KeyVault/vaults", - operator: "GreaterThan", - threshold: 55, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1H", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource" - ], - severity: 3, - tags: {}, - windowSize: "P1D" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateADynamicAlertRuleForMultipleResources(); - createOrUpdateADynamicAlertRuleForSingleResource(); - createOrUpdateAWebTestAlertRule(); - createOrUpdateAnAlertRuleForMultipleResource(); - createOrUpdateAnAlertRuleForSingleResource(); - createOrUpdateAnAlertRuleOnResourceGroupS(); - createOrUpdateAnAlertRuleOnSubscription(); - createOrUpdateAnAlertRulesWithDimensions(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsDeleteSample.ts deleted file mode 100644 index 30628e3520d6..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsDeleteSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete an alert rule definition. - * - * @summary Delete an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json - */ -async function deleteAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsGetSample.ts deleted file mode 100644 index c1b733567e66..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsGetSample.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json - */ -async function getADynamicAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertSingleResource.json - */ -async function getADynamicAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getWebTestMetricAlert.json - */ -async function getAWebTestAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "rg-example"; - const ruleName = "webtest-name-example"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertMultipleResource.json - */ -async function getAnAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSingleResource.json - */ -async function getAnAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertResourceGroup.json - */ -async function getAnAlertRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest1"; - const ruleName = "MetricAlertAtResourceGroupLevel"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSubscription.json - */ -async function getAnAlertRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertAtSubscriptionLevel"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getADynamicAlertRuleForMultipleResources(); - getADynamicAlertRuleForSingleResource(); - getAWebTestAlertRule(); - getAnAlertRuleForMultipleResources(); - getAnAlertRuleForSingleResource(); - getAnAlertRuleOnResourceGroupS(); - getAnAlertRuleOnSubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsListByResourceGroupSample.ts deleted file mode 100644 index 3396a7fc63bf..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve alert rule definitions in a resource group. - * - * @summary Retrieve alert rule definitions in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json - */ -async function listMetricAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricAlerts.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMetricAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsListBySubscriptionSample.ts deleted file mode 100644 index 8e5e162a5570..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve alert rule definitions in a subscription. - * - * @summary Retrieve alert rule definitions in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json - */ -async function listMetricAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricAlerts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMetricAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListByNameSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListByNameSample.ts deleted file mode 100644 index 37c18dacacb1..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListByNameSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an alert rule status. - * - * @summary Retrieve an alert rule status. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json - */ -async function getAnAlertRuleStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "009f6022-67ec-423e-9aa7-691182870588"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "EastUs"; - const ruleName = "custom1"; - const statusName = - "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlertsStatus.listByName( - resourceGroupName, - ruleName, - statusName - ); - console.log(result); -} - -async function main() { - getAnAlertRuleStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListSample.ts deleted file mode 100644 index 250b43d4748c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListSample.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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an alert rule status. - * - * @summary Retrieve an alert rule status. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json - */ -async function getAnAlertRuleStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlertsStatus.list( - resourceGroupName, - ruleName - ); - console.log(result); -} - -async function main() { - getAnAlertRuleStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsUpdateSample.ts deleted file mode 100644 index 28c118771553..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsUpdateSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricAlertResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update an metric alert definition. - * - * @summary Update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json - */ -async function createOrUpdateAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters: MetricAlertResourcePatch = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "\\Processor(_Total)\\% Processor Time", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "Pt1m", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - severity: 3, - tags: {}, - windowSize: "Pt15m" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.update( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricDefinitionsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricDefinitionsListSample.ts deleted file mode 100644 index db4ec4a363d5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricDefinitionsListSample.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricDefinitionsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json - */ -async function getApplicationInsightsMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions"; - const metricnamespace = "microsoft.insights/components"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitions.json - */ -async function getMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricDefinitions"; - const metricnamespace = "Microsoft.Web/sites"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsMetricClass.json - */ -async function getStorageCacheMetricDefinitionsWithMetricClass() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"; - const metricnamespace = "microsoft.storagecache/caches"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getApplicationInsightsMetricDefinitionsWithoutFilter(); - getMetricDefinitionsWithoutFilter(); - getStorageCacheMetricDefinitionsWithMetricClass(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricNamespacesListSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricNamespacesListSample.ts deleted file mode 100644 index 3df200d50713..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricNamespacesListSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricNamespacesListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the metric namespaces for the resource. - * - * @summary Lists the metric namespaces for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json - */ -async function getMetricNamespacesWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"; - const startTime = "2020-08-31T15:53:00Z"; - const options: MetricNamespacesListOptionalParams = { startTime }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricNamespaces.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getMetricNamespacesWithoutFilter(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricsListSample.ts deleted file mode 100644 index de1242962f04..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricsListSample.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricsListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json - */ -async function getMetricForData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricMetadata.json - */ -async function getMetricForMetadata() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricError.json - */ -async function getMetricWithError() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo"; - const timespan = "2021-06-07T21:51:00Z/2021-06-08T01:51:00Z"; - const interval = "FULL"; - const metricnames = "MongoRequestsCount,MongoRequests"; - const aggregation = "average"; - const metricnamespace = "microsoft.documentdb/databaseaccounts"; - const options: MetricsListOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -async function main() { - getMetricForData(); - getMetricForMetadata(); - getMetricWithError(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/monitorOperationsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/monitorOperationsListSample.ts deleted file mode 100644 index c39df4e1ffa2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/monitorOperationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists available Operations for this Resource Provider - * - * @summary Lists available Operations for this Resource Provider - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/OperationsGet.json - */ -async function getOperationsList() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitorOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getOperationsList(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/operationsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/operationsListSample.ts deleted file mode 100644 index b286ddbb34f4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all of the available operations from Microsoft.Insights provider. - * - * @summary Lists all of the available operations from Microsoft.Insights provider. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/OperationList.json - */ -async function getAListOfOperationsForAResourceProvider() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.operations.list(); - console.log(result); -} - -async function main() { - getAListOfOperationsForAResourceProvider(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/predictiveMetricGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/predictiveMetricGetSample.ts deleted file mode 100644 index 46141b8812d7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/predictiveMetricGetSample.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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to get predictive autoscale metric future data - * - * @summary get predictive autoscale metric future data - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/GetPredictiveMetric.json - */ -async function getMetricForData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myRG"; - const autoscaleSettingName = "vmss1-Autoscale-775"; - const timespan = "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z"; - const interval = "PT1H"; - const metricNamespace = "Microsoft.Compute/virtualMachineScaleSets"; - const metricName = "PercentageCPU"; - const aggregation = "Total"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.predictiveMetric.get( - resourceGroupName, - autoscaleSettingName, - timespan, - interval, - metricNamespace, - metricName, - aggregation - ); - console.log(result); -} - -async function main() { - getMetricForData(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts deleted file mode 100644 index 58c9ae6e5230..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.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. -import { PrivateEndpointConnection, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. - * - * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionUpdate.json - */ -async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const parameters: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Approved by johndoe@contoso.com", - status: "Approved" - } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName, - parameters - ); - console.log(result); -} - -async function main() { - approveOrRejectAPrivateEndpointConnectionWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsDeleteSample.ts deleted file mode 100644 index 3328788b882d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a private endpoint connection with a given name. - * - * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionDelete.json - */ -async function deletesAPrivateEndpointConnectionWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - deletesAPrivateEndpointConnectionWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsGetSample.ts deleted file mode 100644 index 61b6812cba6a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a private endpoint connection. - * - * @summary Gets a private endpoint connection. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - scopeName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsListByPrivateLinkScopeSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsListByPrivateLinkScopeSample.ts deleted file mode 100644 index 3ad2bbb647f0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets all private endpoint connections on a private link scope. - * - * @summary Gets all private endpoint connections on a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionList.json - */ -async function getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.listByPrivateLinkScope( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesGetSample.ts deleted file mode 100644 index a44ca23c11f4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @summary Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const groupName = "azuremonitor"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkResources.get( - resourceGroupName, - scopeName, - groupName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesListByPrivateLinkScopeSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesListByPrivateLinkScopeSample.ts deleted file mode 100644 index b2d1f95086c2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @summary Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopeOperationStatusGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopeOperationStatusGetSample.ts deleted file mode 100644 index 8f40d8c5a8f5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopeOperationStatusGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @summary Get the status of an azure asynchronous operation associated with a private link scope operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/privateLinkScopeOperationStatuses.json - */ -async function getSpecificOperationStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "613192d7-503f-477a-9cfe-4efc3ee2bd60"; - const asyncOperationId = "713192d7-503f-477a-9cfe-4efc3ee2bd11"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopeOperationStatus.get( - asyncOperationId, - resourceGroupName - ); - console.log(result); -} - -async function main() { - getSpecificOperationStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesCreateOrUpdateSample.ts deleted file mode 100644 index c0e06fc98bfb..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesCreateOrUpdateSample.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. -import { ScopedResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. - * - * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceUpdate.json - */ -async function updateAScopedResourceInAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const parameters: ScopedResource = { - linkedResourceId: - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/my-component" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - name, - parameters - ); - console.log(result); -} - -async function main() { - updateAScopedResourceInAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesDeleteSample.ts deleted file mode 100644 index da8128cf28d5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a private endpoint connection with a given name. - * - * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceDelete.json - */ -async function deletesAScopedResourceWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.beginDeleteAndWait( - resourceGroupName, - scopeName, - name - ); - console.log(result); -} - -async function main() { - deletesAScopedResourceWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesGetSample.ts deleted file mode 100644 index 248dc344aea7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a scoped resource in a private link scope. - * - * @summary Gets a scoped resource in a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceGet.json - */ -async function getsPrivateLinkScopedResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.get( - resourceGroupName, - scopeName, - name - ); - console.log(result); -} - -async function main() { - getsPrivateLinkScopedResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts deleted file mode 100644 index 2157e3c141ff..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets all private endpoint connections on a private link scope. - * - * @summary Gets all private endpoint connections on a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceList.json - */ -async function getsListOfScopedResourcesInAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopedResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsListOfScopedResourcesInAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesCreateOrUpdateSample.ts deleted file mode 100644 index 484867612812..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesCreateOrUpdateSample.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AzureMonitorPrivateLinkScope, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * - * @summary Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesCreate.json - */ -async function privateLinkScopeCreate() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope = { - accessModeSettings: { - exclusions: [], - ingestionAccessMode: "Open", - queryAccessMode: "Open" - }, - location: "Global" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.createOrUpdate( - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * - * @summary Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdate.json - */ -async function privateLinkScopeUpdate() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope = { - accessModeSettings: { - exclusions: [], - ingestionAccessMode: "Open", - queryAccessMode: "Open" - }, - location: "Global", - tags: { tag1: "Value1" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.createOrUpdate( - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload - ); - console.log(result); -} - -async function main() { - privateLinkScopeCreate(); - privateLinkScopeUpdate(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesDeleteSample.ts deleted file mode 100644 index 72fa958e3561..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a Azure Monitor PrivateLinkScope. - * - * @summary Deletes a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesDelete.json - */ -async function privateLinkScopesDelete() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.beginDeleteAndWait( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - privateLinkScopesDelete(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesGetSample.ts deleted file mode 100644 index bc31e306902a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns a Azure Monitor PrivateLinkScope. - * - * @summary Returns a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesGet.json - */ -async function privateLinkScopeGet() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.get( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - privateLinkScopeGet(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListByResourceGroupSample.ts deleted file mode 100644 index e5c093f8e3de..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @summary Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesListByResourceGroup.json - */ -async function privateLinkScopeListByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopes.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateLinkScopeListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListSample.ts deleted file mode 100644 index 47d4083d2f79..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @summary Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesList.json - */ -async function privateLinkScopesListJson() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopes.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateLinkScopesListJson(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesUpdateTagsSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesUpdateTagsSample.ts deleted file mode 100644 index d6956ec9e02c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesUpdateTagsSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { TagsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json - */ -async function privateLinkScopeUpdateTagsOnly() { - const subscriptionId = process.env["MONITOR_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const privateLinkScopeTags: TagsResource = { - tags: { tag1: "Value1", tag2: "Value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.updateTags( - resourceGroupName, - scopeName, - privateLinkScopeTags - ); - console.log(result); -} - -async function main() { - privateLinkScopeUpdateTagsOnly(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesCreateOrUpdateSample.ts deleted file mode 100644 index c22ab70cb00b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ScheduledQueryRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const parameters: ScheduledQueryRuleResource = { - description: "Performance rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" - ], - customProperties: { key11: "value11", key12: "value12" } - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [ - { - name: "ComputerIp", - operator: "Exclude", - values: ["192.168.1.1"] - }, - { name: "OSType", operator: "Include", values: ["*"] } - ], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1 - }, - metricMeasureColumn: "% Processor Time", - operator: "GreaterThan", - query: 'Perf | where ObjectName == "Processor"', - resourceIdColumn: "resourceId", - threshold: 70, - timeAggregation: "Average" - } - ] - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: [ - "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1" - ], - severity: 4, - skipQueryValidation: true, - windowSize: "PT10M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleResourceGroup.json - */ -async function createOrUpdateAScheduledQueryRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const parameters: ScheduledQueryRuleResource = { - description: "Health check rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" - ], - customProperties: { key11: "value11", key12: "value12" } - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1 - }, - operator: "GreaterThan", - query: "Heartbeat", - threshold: 360, - timeAggregation: "Count" - } - ] - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: [ - "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1" - ], - severity: 4, - skipQueryValidation: true, - targetResourceTypes: ["Microsoft.Compute/virtualMachines"], - windowSize: "PT10M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleSubscription.json - */ -async function createOrUpdateAScheduledQueryRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const parameters: ScheduledQueryRuleResource = { - description: "Performance rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" - ], - customProperties: { key11: "value11", key12: "value12" } - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [ - { - name: "ComputerIp", - operator: "Exclude", - values: ["192.168.1.1"] - }, - { name: "OSType", operator: "Include", values: ["*"] } - ], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1 - }, - metricMeasureColumn: "% Processor Time", - operator: "GreaterThan", - query: 'Perf | where ObjectName == "Processor"', - resourceIdColumn: "resourceId", - threshold: 70, - timeAggregation: "Average" - } - ] - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: ["/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"], - severity: 4, - skipQueryValidation: true, - targetResourceTypes: ["Microsoft.Compute/virtualMachines"], - windowSize: "PT10M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAScheduledQueryRuleForSingleResource(); - createOrUpdateAScheduledQueryRuleOnResourceGroupS(); - createOrUpdateAScheduledQueryRuleOnSubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesDeleteSample.ts deleted file mode 100644 index 9e34f0b8d669..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a scheduled query rule. - * - * @summary Deletes a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/deleteScheduledQueryRule.json - */ -async function deleteAScheduledQueryRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.delete( - resourceGroupName, - ruleName - ); - console.log(result); -} - -async function main() { - deleteAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesGetSample.ts deleted file mode 100644 index e77734253abe..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an scheduled query rule definition. - * - * @summary Retrieve an scheduled query rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/getScheduledQueryRule.json - */ -async function getAScheduledQueryRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.get( - resourceGroupName, - ruleName - ); - console.log(result); -} - -async function main() { - getAScheduledQueryRuleForSingleResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListByResourceGroupSample.ts deleted file mode 100644 index f474165d969b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve scheduled query rule definitions in a resource group. - * - * @summary Retrieve scheduled query rule definitions in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesByResourceGroup.json - */ -async function listScheduledQueryRulesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.scheduledQueryRules.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listScheduledQueryRulesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListBySubscriptionSample.ts deleted file mode 100644 index ec1cce5bfe7b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve a scheduled query rule definitions in a subscription. - * - * @summary Retrieve a scheduled query rule definitions in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesBySubscription.json - */ -async function listScheduledQueryRulesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.scheduledQueryRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listScheduledQueryRulesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesUpdateSample.ts deleted file mode 100644 index ccadc3a95389..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesUpdateSample.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. -import { - ScheduledQueryRuleResourcePatch, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a scheduled query rule. - * - * @summary Update a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/patchScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const parameters: ScheduledQueryRuleResourcePatch = { enabled: false }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.update( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/tenantActivityLogsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/tenantActivityLogsListSample.ts deleted file mode 100644 index 519961fabae5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/tenantActivityLogsListSample.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TenantActivityLogsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json - */ -async function getTenantActivityLogsWithFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const options: TenantActivityLogsListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFilteredAndSelected.json - */ -async function getTenantActivityLogsWithFilterAndSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: TenantActivityLogsListOptionalParams = { filter, select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsSelected.json - */ -async function getTenantActivityLogsWithSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: TenantActivityLogsListOptionalParams = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsNoParams.json - */ -async function getTenantActivityLogsWithoutFilterOrSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getTenantActivityLogsWithFilter(); - getTenantActivityLogsWithFilterAndSelect(); - getTenantActivityLogsWithSelect(); - getTenantActivityLogsWithoutFilterOrSelect(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/vmInsightsGetOnboardingStatusSample.ts b/sdk/monitor/arm-monitor/samples-dev/vmInsightsGetOnboardingStatusSample.ts deleted file mode 100644 index 96e4892e9ecc..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/vmInsightsGetOnboardingStatusSample.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json - */ -async function getStatusForAVMScaleSetThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVMUnknown.json - */ -async function getStatusForAVMThatHasNotYetReportedData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVM.json - */ -async function getStatusForAVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusResourceGroup.json - */ -async function getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSubscription.json - */ -async function getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -async function main() { - getStatusForAVMScaleSetThatIsActivelyReportingData(); - getStatusForAVMThatHasNotYetReportedData(); - getStatusForAVMThatIsActivelyReportingData(); - getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData(); - getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/README.md b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/README.md deleted file mode 100644 index 64bef40833fb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/README.md +++ /dev/null @@ -1,268 +0,0 @@ -# client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js][actiongroupscreatenotificationsatactiongroupresourcelevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json | -| [actionGroupsCreateNotificationsAtResourceGroupLevelSample.js][actiongroupscreatenotificationsatresourcegrouplevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json | -| [actionGroupsCreateOrUpdateSample.js][actiongroupscreateorupdatesample] | Create a new action group or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json | -| [actionGroupsDeleteSample.js][actiongroupsdeletesample] | Delete an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json | -| [actionGroupsEnableReceiverSample.js][actiongroupsenablereceiversample] | Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json | -| [actionGroupsGetSample.js][actiongroupsgetsample] | Get an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json | -| [actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js][actiongroupsgettestnotificationsatactiongroupresourcelevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json | -| [actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js][actiongroupsgettestnotificationsatresourcegrouplevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json | -| [actionGroupsGetTestNotificationsSample.js][actiongroupsgettestnotificationssample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json | -| [actionGroupsListByResourceGroupSample.js][actiongroupslistbyresourcegroupsample] | Get a list of all action groups in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json | -| [actionGroupsListBySubscriptionIdSample.js][actiongroupslistbysubscriptionidsample] | Get a list of all action groups in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json | -| [actionGroupsPostTestNotificationsSample.js][actiongroupsposttestnotificationssample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json | -| [actionGroupsUpdateSample.js][actiongroupsupdatesample] | Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json | -| [activityLogAlertsCreateOrUpdateSample.js][activitylogalertscreateorupdatesample] | Create a new Activity Log Alert rule or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json | -| [activityLogAlertsDeleteSample.js][activitylogalertsdeletesample] | Delete an Activity Log Alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json | -| [activityLogAlertsGetSample.js][activitylogalertsgetsample] | Get an Activity Log Alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json | -| [activityLogAlertsListByResourceGroupSample.js][activitylogalertslistbyresourcegroupsample] | Get a list of all Activity Log Alert rules in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json | -| [activityLogAlertsListBySubscriptionIdSample.js][activitylogalertslistbysubscriptionidsample] | Get a list of all Activity Log Alert rules in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json | -| [activityLogAlertsUpdateSample.js][activitylogalertsupdatesample] | Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json | -| [activityLogsListSample.js][activitylogslistsample] | Provides the list of records from the activity logs. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json | -| [alertRuleIncidentsGetSample.js][alertruleincidentsgetsample] | Gets an incident associated to an alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json | -| [alertRuleIncidentsListByAlertRuleSample.js][alertruleincidentslistbyalertrulesample] | Gets a list of incidents associated to an alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json | -| [alertRulesCreateOrUpdateSample.js][alertrulescreateorupdatesample] | Creates or updates a classic metric alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json | -| [alertRulesDeleteSample.js][alertrulesdeletesample] | Deletes a classic metric alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json | -| [alertRulesGetSample.js][alertrulesgetsample] | Gets a classic metric alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json | -| [alertRulesListByResourceGroupSample.js][alertruleslistbyresourcegroupsample] | List the classic metric alert rules within a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json | -| [alertRulesListBySubscriptionSample.js][alertruleslistbysubscriptionsample] | List the classic metric alert rules within a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json | -| [alertRulesUpdateSample.js][alertrulesupdatesample] | Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json | -| [autoscaleSettingsCreateOrUpdateSample.js][autoscalesettingscreateorupdatesample] | Creates or updates an autoscale setting. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json | -| [autoscaleSettingsDeleteSample.js][autoscalesettingsdeletesample] | Deletes and autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json | -| [autoscaleSettingsGetSample.js][autoscalesettingsgetsample] | Gets an autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json | -| [autoscaleSettingsListByResourceGroupSample.js][autoscalesettingslistbyresourcegroupsample] | Lists the autoscale settings for a resource group x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json | -| [autoscaleSettingsListBySubscriptionSample.js][autoscalesettingslistbysubscriptionsample] | Lists the autoscale settings for a subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json | -| [autoscaleSettingsUpdateSample.js][autoscalesettingsupdatesample] | Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json | -| [azureMonitorWorkspacesCreateSample.js][azuremonitorworkspacescreatesample] | Create or update a workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesCreate.json | -| [azureMonitorWorkspacesDeleteSample.js][azuremonitorworkspacesdeletesample] | Delete a workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesDelete.json | -| [azureMonitorWorkspacesGetSample.js][azuremonitorworkspacesgetsample] | Returns the specific Azure Monitor workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesGet.json | -| [azureMonitorWorkspacesListByResourceGroupSample.js][azuremonitorworkspaceslistbyresourcegroupsample] | Lists all workspaces in the specified resource group x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json | -| [azureMonitorWorkspacesListBySubscriptionSample.js][azuremonitorworkspaceslistbysubscriptionsample] | Lists all workspaces in the specified subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListBySubscription.json | -| [azureMonitorWorkspacesUpdateSample.js][azuremonitorworkspacesupdatesample] | Updates part of a workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesUpdate.json | -| [baselinesListSample.js][baselineslistsample] | **Lists the metric baseline values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json | -| [dataCollectionEndpointsCreateSample.js][datacollectionendpointscreatesample] | Creates or updates a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json | -| [dataCollectionEndpointsDeleteSample.js][datacollectionendpointsdeletesample] | Deletes a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json | -| [dataCollectionEndpointsGetSample.js][datacollectionendpointsgetsample] | Returns the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json | -| [dataCollectionEndpointsListByResourceGroupSample.js][datacollectionendpointslistbyresourcegroupsample] | Lists all data collection endpoints in the specified resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json | -| [dataCollectionEndpointsListBySubscriptionSample.js][datacollectionendpointslistbysubscriptionsample] | Lists all data collection endpoints in the specified subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json | -| [dataCollectionEndpointsUpdateSample.js][datacollectionendpointsupdatesample] | Updates part of a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json | -| [dataCollectionRuleAssociationsCreateSample.js][datacollectionruleassociationscreatesample] | Creates or updates an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json | -| [dataCollectionRuleAssociationsDeleteSample.js][datacollectionruleassociationsdeletesample] | Deletes an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json | -| [dataCollectionRuleAssociationsGetSample.js][datacollectionruleassociationsgetsample] | Returns the specified association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json | -| [dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js][datacollectionruleassociationslistbydatacollectionendpointsample] | Lists associations for the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json | -| [dataCollectionRuleAssociationsListByResourceSample.js][datacollectionruleassociationslistbyresourcesample] | Lists associations for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json | -| [dataCollectionRuleAssociationsListByRuleSample.js][datacollectionruleassociationslistbyrulesample] | Lists associations for the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json | -| [dataCollectionRulesCreateSample.js][datacollectionrulescreatesample] | Creates or updates a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json | -| [dataCollectionRulesDeleteSample.js][datacollectionrulesdeletesample] | Deletes a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json | -| [dataCollectionRulesGetSample.js][datacollectionrulesgetsample] | Returns the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json | -| [dataCollectionRulesListByResourceGroupSample.js][datacollectionruleslistbyresourcegroupsample] | Lists all data collection rules in the specified resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json | -| [dataCollectionRulesListBySubscriptionSample.js][datacollectionruleslistbysubscriptionsample] | Lists all data collection rules in the specified subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json | -| [dataCollectionRulesUpdateSample.js][datacollectionrulesupdatesample] | Updates part of a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json | -| [diagnosticSettingsCategoryGetSample.js][diagnosticsettingscategorygetsample] | Gets the diagnostic settings category for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json | -| [diagnosticSettingsCategoryListSample.js][diagnosticsettingscategorylistsample] | Lists the diagnostic settings categories for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json | -| [diagnosticSettingsCreateOrUpdateSample.js][diagnosticsettingscreateorupdatesample] | Creates or updates diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json | -| [diagnosticSettingsDeleteSample.js][diagnosticsettingsdeletesample] | Deletes existing diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json | -| [diagnosticSettingsGetSample.js][diagnosticsettingsgetsample] | Gets the active diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json | -| [diagnosticSettingsListSample.js][diagnosticsettingslistsample] | Gets the active diagnostic settings list for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json | -| [eventCategoriesListSample.js][eventcategorieslistsample] | Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json | -| [logProfilesCreateOrUpdateSample.js][logprofilescreateorupdatesample] | Create or update a log profile in Azure Monitoring REST API. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json | -| [logProfilesDeleteSample.js][logprofilesdeletesample] | Deletes the log profile. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json | -| [logProfilesGetSample.js][logprofilesgetsample] | Gets the log profile. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json | -| [logProfilesListSample.js][logprofileslistsample] | List the log profiles. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json | -| [logProfilesUpdateSample.js][logprofilesupdatesample] | Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json | -| [metricAlertsCreateOrUpdateSample.js][metricalertscreateorupdatesample] | Create or update an metric alert definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json | -| [metricAlertsDeleteSample.js][metricalertsdeletesample] | Delete an alert rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json | -| [metricAlertsGetSample.js][metricalertsgetsample] | Retrieve an alert rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json | -| [metricAlertsListByResourceGroupSample.js][metricalertslistbyresourcegroupsample] | Retrieve alert rule definitions in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json | -| [metricAlertsListBySubscriptionSample.js][metricalertslistbysubscriptionsample] | Retrieve alert rule definitions in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json | -| [metricAlertsStatusListByNameSample.js][metricalertsstatuslistbynamesample] | Retrieve an alert rule status. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json | -| [metricAlertsStatusListSample.js][metricalertsstatuslistsample] | Retrieve an alert rule status. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json | -| [metricAlertsUpdateSample.js][metricalertsupdatesample] | Update an metric alert definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json | -| [metricDefinitionsListSample.js][metricdefinitionslistsample] | Lists the metric definitions for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json | -| [metricNamespacesListSample.js][metricnamespaceslistsample] | Lists the metric namespaces for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json | -| [metricsListSample.js][metricslistsample] | **Lists the metric values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json | -| [monitorOperationsListSample.js][monitoroperationslistsample] | Lists available Operations for this Resource Provider x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/OperationsGet.json | -| [operationsListSample.js][operationslistsample] | Lists all of the available operations from Microsoft.Insights provider. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/OperationList.json | -| [predictiveMetricGetSample.js][predictivemetricgetsample] | get predictive autoscale metric future data x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/GetPredictiveMetric.json | -| [privateEndpointConnectionsCreateOrUpdateSample.js][privateendpointconnectionscreateorupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionUpdate.json | -| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionDelete.json | -| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets a private endpoint connection. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionGet.json | -| [privateEndpointConnectionsListByPrivateLinkScopeSample.js][privateendpointconnectionslistbyprivatelinkscopesample] | Gets all private endpoint connections on a private link scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionList.json | -| [privateLinkResourcesGetSample.js][privatelinkresourcesgetsample] | Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json | -| [privateLinkResourcesListByPrivateLinkScopeSample.js][privatelinkresourceslistbyprivatelinkscopesample] | Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json | -| [privateLinkScopeOperationStatusGetSample.js][privatelinkscopeoperationstatusgetsample] | Get the status of an azure asynchronous operation associated with a private link scope operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/privateLinkScopeOperationStatuses.json | -| [privateLinkScopedResourcesCreateOrUpdateSample.js][privatelinkscopedresourcescreateorupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceUpdate.json | -| [privateLinkScopedResourcesDeleteSample.js][privatelinkscopedresourcesdeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceDelete.json | -| [privateLinkScopedResourcesGetSample.js][privatelinkscopedresourcesgetsample] | Gets a scoped resource in a private link scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceGet.json | -| [privateLinkScopedResourcesListByPrivateLinkScopeSample.js][privatelinkscopedresourceslistbyprivatelinkscopesample] | Gets all private endpoint connections on a private link scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceList.json | -| [privateLinkScopesCreateOrUpdateSample.js][privatelinkscopescreateorupdatesample] | Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesCreate.json | -| [privateLinkScopesDeleteSample.js][privatelinkscopesdeletesample] | Deletes a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesDelete.json | -| [privateLinkScopesGetSample.js][privatelinkscopesgetsample] | Returns a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesGet.json | -| [privateLinkScopesListByResourceGroupSample.js][privatelinkscopeslistbyresourcegroupsample] | Gets a list of Azure Monitor PrivateLinkScopes within a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesListByResourceGroup.json | -| [privateLinkScopesListSample.js][privatelinkscopeslistsample] | Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesList.json | -| [privateLinkScopesUpdateTagsSample.js][privatelinkscopesupdatetagssample] | Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json | -| [scheduledQueryRulesCreateOrUpdateSample.js][scheduledqueryrulescreateorupdatesample] | Creates or updates a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRule.json | -| [scheduledQueryRulesDeleteSample.js][scheduledqueryrulesdeletesample] | Deletes a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/deleteScheduledQueryRule.json | -| [scheduledQueryRulesGetSample.js][scheduledqueryrulesgetsample] | Retrieve an scheduled query rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/getScheduledQueryRule.json | -| [scheduledQueryRulesListByResourceGroupSample.js][scheduledqueryruleslistbyresourcegroupsample] | Retrieve scheduled query rule definitions in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesByResourceGroup.json | -| [scheduledQueryRulesListBySubscriptionSample.js][scheduledqueryruleslistbysubscriptionsample] | Retrieve a scheduled query rule definitions in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesBySubscription.json | -| [scheduledQueryRulesUpdateSample.js][scheduledqueryrulesupdatesample] | Update a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/patchScheduledQueryRule.json | -| [tenantActivityLogsListSample.js][tenantactivitylogslistsample] | Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does _not_ retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json | -| [vmInsightsGetOnboardingStatusSample.js][vminsightsgetonboardingstatussample] | Retrieves the VM Insights onboarding status for the specified resource or resource scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env MONITOR_SUBSCRIPTION_ID="" MONITOR_RESOURCE_GROUP="" node actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[actiongroupscreatenotificationsatactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -[actiongroupscreatenotificationsatresourcegrouplevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js -[actiongroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateOrUpdateSample.js -[actiongroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsDeleteSample.js -[actiongroupsenablereceiversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsEnableReceiverSample.js -[actiongroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetSample.js -[actiongroupsgettestnotificationsatactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js -[actiongroupsgettestnotificationsatresourcegrouplevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js -[actiongroupsgettestnotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.js -[actiongroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListByResourceGroupSample.js -[actiongroupslistbysubscriptionidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListBySubscriptionIdSample.js -[actiongroupsposttestnotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js -[actiongroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsUpdateSample.js -[activitylogalertscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsCreateOrUpdateSample.js -[activitylogalertsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsDeleteSample.js -[activitylogalertsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsGetSample.js -[activitylogalertslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListByResourceGroupSample.js -[activitylogalertslistbysubscriptionidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListBySubscriptionIdSample.js -[activitylogalertsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsUpdateSample.js -[activitylogslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogsListSample.js -[alertruleincidentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsGetSample.js -[alertruleincidentslistbyalertrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsListByAlertRuleSample.js -[alertrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesCreateOrUpdateSample.js -[alertrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesDeleteSample.js -[alertrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesGetSample.js -[alertruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListByResourceGroupSample.js -[alertruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListBySubscriptionSample.js -[alertrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesUpdateSample.js -[autoscalesettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsCreateOrUpdateSample.js -[autoscalesettingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsDeleteSample.js -[autoscalesettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsGetSample.js -[autoscalesettingslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListByResourceGroupSample.js -[autoscalesettingslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListBySubscriptionSample.js -[autoscalesettingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsUpdateSample.js -[azuremonitorworkspacescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesCreateSample.js -[azuremonitorworkspacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesDeleteSample.js -[azuremonitorworkspacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesGetSample.js -[azuremonitorworkspaceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListByResourceGroupSample.js -[azuremonitorworkspaceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListBySubscriptionSample.js -[azuremonitorworkspacesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesUpdateSample.js -[baselineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/baselinesListSample.js -[datacollectionendpointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsCreateSample.js -[datacollectionendpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsDeleteSample.js -[datacollectionendpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsGetSample.js -[datacollectionendpointslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListByResourceGroupSample.js -[datacollectionendpointslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListBySubscriptionSample.js -[datacollectionendpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsUpdateSample.js -[datacollectionruleassociationscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsCreateSample.js -[datacollectionruleassociationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsDeleteSample.js -[datacollectionruleassociationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsGetSample.js -[datacollectionruleassociationslistbydatacollectionendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js -[datacollectionruleassociationslistbyresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByResourceSample.js -[datacollectionruleassociationslistbyrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByRuleSample.js -[datacollectionrulescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesCreateSample.js -[datacollectionrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesDeleteSample.js -[datacollectionrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesGetSample.js -[datacollectionruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListByResourceGroupSample.js -[datacollectionruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListBySubscriptionSample.js -[datacollectionrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesUpdateSample.js -[diagnosticsettingscategorygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryGetSample.js -[diagnosticsettingscategorylistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.js -[diagnosticsettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.js -[diagnosticsettingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsDeleteSample.js -[diagnosticsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.js -[diagnosticsettingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.js -[eventcategorieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/eventCategoriesListSample.js -[logprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesCreateOrUpdateSample.js -[logprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesDeleteSample.js -[logprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesGetSample.js -[logprofileslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesListSample.js -[logprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesUpdateSample.js -[metricalertscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsCreateOrUpdateSample.js -[metricalertsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsDeleteSample.js -[metricalertsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsGetSample.js -[metricalertslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListByResourceGroupSample.js -[metricalertslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListBySubscriptionSample.js -[metricalertsstatuslistbynamesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListByNameSample.js -[metricalertsstatuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListSample.js -[metricalertsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsUpdateSample.js -[metricdefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListSample.js -[metricnamespaceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricNamespacesListSample.js -[metricslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListSample.js -[monitoroperationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/monitorOperationsListSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/operationsListSample.js -[predictivemetricgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.js -[privateendpointconnectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js -[privateendpointconnectionslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsListByPrivateLinkScopeSample.js -[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesGetSample.js -[privatelinkresourceslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesListByPrivateLinkScopeSample.js -[privatelinkscopeoperationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopeOperationStatusGetSample.js -[privatelinkscopedresourcescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesCreateOrUpdateSample.js -[privatelinkscopedresourcesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesDeleteSample.js -[privatelinkscopedresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesGetSample.js -[privatelinkscopedresourceslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesListByPrivateLinkScopeSample.js -[privatelinkscopescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesCreateOrUpdateSample.js -[privatelinkscopesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesDeleteSample.js -[privatelinkscopesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesGetSample.js -[privatelinkscopeslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListByResourceGroupSample.js -[privatelinkscopeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListSample.js -[privatelinkscopesupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesUpdateTagsSample.js -[scheduledqueryrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesCreateOrUpdateSample.js -[scheduledqueryrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesDeleteSample.js -[scheduledqueryrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesGetSample.js -[scheduledqueryruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListByResourceGroupSample.js -[scheduledqueryruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListBySubscriptionSample.js -[scheduledqueryrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesUpdateSample.js -[tenantactivitylogslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActivityLogsListSample.js -[vminsightsgetonboardingstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/vmInsightsGetOnboardingStatusSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-monitor?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor/README.md diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js deleted file mode 100644 index 5a52f596baa0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestRgName"; - const actionGroupName = "TestAgName"; - const notificationRequest = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true, - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false, - }, - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084", - }, - ], - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true, - }, - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - }, - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c", - }, - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false, - }, - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - voiceReceivers: [{ name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" }], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true, - }, - { - name: "Sample webhook 2", - identifierUri: "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true, - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = - await client.actionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait( - resourceGroupName, - actionGroupName, - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js deleted file mode 100644 index 992bd6331cb6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-TestNotifications"; - const notificationRequest = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true, - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false, - }, - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084", - }, - ], - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true, - }, - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - }, - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c", - }, - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false, - }, - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - voiceReceivers: [{ name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" }], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true, - }, - { - name: "Sample webhook 2", - identifierUri: "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true, - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName, - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateOrUpdateSample.js deleted file mode 100644 index a68ac594d015..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateOrUpdateSample.js +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a new action group or update an existing one. - * - * @summary Create a new action group or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json - */ -async function createOrUpdateAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const actionGroup = { - armRoleReceivers: [ - { - name: "Sample armRole", - roleId: "8e3af657-a8ff-443c-a75c-2fe8c4bcb635", - useCommonAlertSchema: true, - }, - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084", - }, - ], - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true, - }, - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - enabled: true, - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - }, - ], - groupShortName: "sample", - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c", - }, - ], - location: "Global", - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false, - }, - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - tags: {}, - voiceReceivers: [{ name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" }], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true, - }, - { - name: "Sample webhook 2", - identifierUri: "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true, - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.createOrUpdate( - resourceGroupName, - actionGroupName, - actionGroup - ); - console.log(result); -} - -async function main() { - createOrUpdateAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsDeleteSample.js deleted file mode 100644 index 7050154bbdf0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete an action group. - * - * @summary Delete an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json - */ -async function deleteAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.delete(resourceGroupName, actionGroupName); - console.log(result); -} - -async function main() { - deleteAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsEnableReceiverSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsEnableReceiverSample.js deleted file mode 100644 index 880102065bb6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsEnableReceiverSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * - * @summary Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json - */ -async function enableTheReceiver() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const enableRequest = { receiverName: "John Doe's mobile" }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.enableReceiver( - resourceGroupName, - actionGroupName, - enableRequest - ); - console.log(result); -} - -async function main() { - enableTheReceiver(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetSample.js deleted file mode 100644 index 93291912836d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get an action group. - * - * @summary Get an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json - */ -async function getAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.get(resourceGroupName, actionGroupName); - console.log(result); -} - -async function main() { - getAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js deleted file mode 100644 index 662e75a83b77..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestRgName"; - const actionGroupName = "TestAgName"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtActionGroupResourceLevel( - resourceGroupName, - actionGroupName, - notificationId - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js deleted file mode 100644 index 79dd880f282a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-TestNotifications"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtResourceGroupLevel( - resourceGroupName, - notificationId - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.js deleted file mode 100644 index 0e15f0c99d7c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json - */ -async function getNotificationDetailsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotifications(notificationId); - console.log(result); -} - -async function main() { - getNotificationDetailsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListByResourceGroupSample.js deleted file mode 100644 index c9e459c348ca..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a list of all action groups in a resource group. - * - * @summary Get a list of all action groups in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.actionGroups.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActionGroupsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListBySubscriptionIdSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListBySubscriptionIdSample.js deleted file mode 100644 index 4086184a645d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListBySubscriptionIdSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a list of all action groups in a subscription. - * - * @summary Get a list of all action groups in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.actionGroups.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActionGroupsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js deleted file mode 100644 index a8301d68eff0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json - */ -async function createNotificationsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const notificationRequest = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true, - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false, - }, - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084", - }, - ], - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true, - }, - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - }, - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c", - }, - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false, - }, - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - voiceReceivers: [{ name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" }], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true, - }, - { - name: "Sample webhook 2", - identifierUri: "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true, - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginPostTestNotificationsAndWait(notificationRequest); - console.log(result); -} - -async function main() { - createNotificationsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsUpdateSample.js deleted file mode 100644 index bca93894e7bd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsUpdateSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json - */ -async function patchAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const actionGroupPatch = { - enabled: false, - tags: { key1: "value1", key2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.update( - resourceGroupName, - actionGroupName, - actionGroupPatch - ); - console.log(result); -} - -async function main() { - patchAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsCreateOrUpdateSample.js deleted file mode 100644 index 75b001a678b6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsCreateOrUpdateSample.js +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json - */ -async function createOrUpdateAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const activityLogAlertRule = { - description: "Description of sample Activity Log Alert rule.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" }, - }, - ], - }, - condition: { - allOf: [ - { equals: "Administrative", field: "category" }, - { equals: "Error", field: "level" }, - ], - }, - enabled: true, - location: "Global", - scopes: ["/subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithAnyOfCondition.json - */ -async function createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRuleWithAnyOfCondition"; - const activityLogAlertRule = { - description: "Description of sample Activity Log Alert rule with 'anyOf' condition.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" }, - }, - ], - }, - condition: { - allOf: [ - { equals: "ServiceHealth", field: "category" }, - { - anyOf: [ - { equals: "Incident", field: "properties.incidentType" }, - { equals: "Maintenance", field: "properties.incidentType" }, - ], - }, - ], - }, - enabled: true, - location: "Global", - scopes: ["subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithContainsAny.json - */ -async function createOrUpdateAnActivityLogAlertRuleWithContainsAny() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRuleWithContainsAny"; - const activityLogAlertRule = { - description: "Description of sample Activity Log Alert rule with 'containsAny'.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" }, - }, - ], - }, - condition: { - allOf: [ - { equals: "ServiceHealth", field: "category" }, - { - containsAny: ["North Europe", "West Europe"], - field: "properties.impactedServices[*].ImpactedRegions[*].RegionName", - }, - ], - }, - enabled: true, - location: "Global", - scopes: ["subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -async function main() { - createOrUpdateAnActivityLogAlertRule(); - createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition(); - createOrUpdateAnActivityLogAlertRuleWithContainsAny(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsDeleteSample.js deleted file mode 100644 index 0006ad81aeab..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete an Activity Log Alert rule. - * - * @summary Delete an Activity Log Alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json - */ -async function deleteAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.delete(resourceGroupName, activityLogAlertName); - console.log(result); -} - -async function main() { - deleteAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsGetSample.js deleted file mode 100644 index e2c065808c39..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get an Activity Log Alert rule. - * - * @summary Get an Activity Log Alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json - */ -async function getAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.get(resourceGroupName, activityLogAlertName); - console.log(result); -} - -async function main() { - getAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListByResourceGroupSample.js deleted file mode 100644 index c79f88066689..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a list of all Activity Log Alert rules in a resource group. - * - * @summary Get a list of all Activity Log Alert rules in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json - */ -async function listActivityLogAlerts() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogAlerts.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActivityLogAlerts(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListBySubscriptionIdSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListBySubscriptionIdSample.js deleted file mode 100644 index 88aa27771f6e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListBySubscriptionIdSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a list of all Activity Log Alert rules in a subscription. - * - * @summary Get a list of all Activity Log Alert rules in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json - */ -async function getListOfAllActivityLogAlertRulesUnderASubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogAlerts.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getListOfAllActivityLogAlertRulesUnderASubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsUpdateSample.js deleted file mode 100644 index 3cc897148665..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsUpdateSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. - * - * @summary Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json - */ -async function patchAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const activityLogAlertRulePatch = { - enabled: false, - tags: { key1: "value1", key2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.update( - resourceGroupName, - activityLogAlertName, - activityLogAlertRulePatch - ); - console.log(result); -} - -async function main() { - patchAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogsListSample.js deleted file mode 100644 index 25c6022d9e77..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogsListSample.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Provides the list of records from the activity logs. - * - * @summary Provides the list of records from the activity logs. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json - */ -async function getActivityLogsWithFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogs.list(filter)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Provides the list of records from the activity logs. - * - * @summary Provides the list of records from the activity logs. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFilteredAndSelected.json - */ -async function getActivityLogsWithFilterAndSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogs.list(filter, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getActivityLogsWithFilter(); - getActivityLogsWithFilterAndSelect(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsGetSample.js deleted file mode 100644 index 27878c579b1b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsGetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets an incident associated to an alert rule - * - * @summary Gets an incident associated to an alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json - */ -async function getASingleAlertRuleIncident() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "myRuleName"; - const incidentName = "Website_started"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRuleIncidents.get(resourceGroupName, ruleName, incidentName); - console.log(result); -} - -async function main() { - getASingleAlertRuleIncident(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsListByAlertRuleSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsListByAlertRuleSample.js deleted file mode 100644 index 998d1a36e388..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsListByAlertRuleSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of incidents associated to an alert rule - * - * @summary Gets a list of incidents associated to an alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json - */ -async function listAlertRuleIncidents() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "myRuleName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRuleIncidents.listByAlertRule(resourceGroupName, ruleName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRuleIncidents(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesCreateOrUpdateSample.js deleted file mode 100644 index cff5b1937bbf..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesCreateOrUpdateSample.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a classic metric alert rule. - * - * @summary Creates or updates a classic metric alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json - */ -async function createOrUpdateAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const parameters = { - namePropertiesName: "chiricutin", - description: "Pura Vida", - actions: [], - condition: { - dataSource: { - metricName: "Requests", - odataType: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - resourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest", - }, - odataType: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - operator: "GreaterThan", - threshold: 3, - timeAggregation: "Total", - windowSize: "PT5M", - }, - isEnabled: true, - location: "West US", - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -async function main() { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesDeleteSample.js deleted file mode 100644 index 86473357c892..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a classic metric alert rule - * - * @summary Deletes a classic metric alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json - */ -async function deleteAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesGetSample.js deleted file mode 100644 index 286f6d1533cc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a classic metric alert rule - * - * @summary Gets a classic metric alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json - */ -async function getAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListByResourceGroupSample.js deleted file mode 100644 index 9cd4c2966d03..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the classic metric alert rules within a resource group. - * - * @summary List the classic metric alert rules within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json - */ -async function listAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRules.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListBySubscriptionSample.js deleted file mode 100644 index b3d78051e5e8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the classic metric alert rules within a subscription. - * - * @summary List the classic metric alert rules within a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json - */ -async function listAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesUpdateSample.js deleted file mode 100644 index 083f758ac6db..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesUpdateSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json - */ -async function patchAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const alertRulesResource = { - name: "chiricutin", - description: "Pura Vida", - actions: [], - condition: { - dataSource: { - metricName: "Requests", - odataType: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - resourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest", - }, - odataType: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - operator: "GreaterThan", - threshold: 3, - timeAggregation: "Total", - windowSize: "PT5M", - }, - isEnabled: true, - tags: { - $type: "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.update(resourceGroupName, ruleName, alertRulesResource); - console.log(result); -} - -async function main() { - patchAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsCreateOrUpdateSample.js deleted file mode 100644 index 966be13fce90..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsCreateOrUpdateSample.js +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates an autoscale setting. - * - * @summary Creates or updates an autoscale setting. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json - */ -async function createOrUpdateAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const parameters = { - enabled: true, - location: "West US", - notifications: [ - { - email: { - customEmails: ["gu@ms.com", "ge@ns.net"], - sendToSubscriptionAdministrator: true, - sendToSubscriptionCoAdministrators: true, - }, - operation: "Scale", - webhooks: [{ properties: {}, serviceUri: "http://myservice.com" }], - }, - ], - predictiveAutoscalePolicy: { scaleMode: "Enabled" }, - profiles: [ - { - name: "adios", - capacity: { default: "1", maximum: "10", minimum: "1" }, - fixedDate: { - end: new Date("2015-03-05T14:30:00Z"), - start: new Date("2015-03-05T14:00:00Z"), - timeZone: "UTC", - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1", - }, - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2", - }, - }, - ], - }, - { - name: "saludos", - capacity: { default: "1", maximum: "10", minimum: "1" }, - recurrence: { - frequency: "Week", - schedule: { days: ["1"], hours: [5], minutes: [15], timeZone: "UTC" }, - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1", - }, - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2", - }, - }, - ], - }, - ], - tags: { key1: "value1", key2: "value2" }, - targetResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.createOrUpdate( - resourceGroupName, - autoscaleSettingName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsDeleteSample.js deleted file mode 100644 index 851e06221fb8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes and autoscale setting - * - * @summary Deletes and autoscale setting - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json - */ -async function deleteAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.delete(resourceGroupName, autoscaleSettingName); - console.log(result); -} - -async function main() { - deleteAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsGetSample.js deleted file mode 100644 index a401a3786e53..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets an autoscale setting - * - * @summary Gets an autoscale setting - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json - */ -async function getAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.get(resourceGroupName, autoscaleSettingName); - console.log(result); -} - -async function main() { - getAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListByResourceGroupSample.js deleted file mode 100644 index 0cab2c2f0e83..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the autoscale settings for a resource group - * - * @summary Lists the autoscale settings for a resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json - */ -async function listAutoscaleSettings() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.autoscaleSettings.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAutoscaleSettings(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListBySubscriptionSample.js deleted file mode 100644 index 22063de883c5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the autoscale settings for a subscription - * - * @summary Lists the autoscale settings for a subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json - */ -async function listAutoscaleSettingsBySubs() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.autoscaleSettings.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAutoscaleSettingsBySubs(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsUpdateSample.js deleted file mode 100644 index 1b33cd3aee5a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsUpdateSample.js +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json - */ -async function patchAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const autoscaleSettingResource = { - enabled: true, - notifications: [ - { - email: { - customEmails: ["gu@ms.com", "ge@ns.net"], - sendToSubscriptionAdministrator: true, - sendToSubscriptionCoAdministrators: true, - }, - operation: "Scale", - webhooks: [{ properties: {}, serviceUri: "http://myservice.com" }], - }, - ], - predictiveAutoscalePolicy: { scaleMode: "Enabled" }, - profiles: [ - { - name: "adios", - capacity: { default: "1", maximum: "10", minimum: "1" }, - fixedDate: { - end: new Date("2015-03-05T14:30:00Z"), - start: new Date("2015-03-05T14:00:00Z"), - timeZone: "UTC", - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1", - }, - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2", - }, - }, - ], - }, - { - name: "saludos", - capacity: { default: "1", maximum: "10", minimum: "1" }, - recurrence: { - frequency: "Week", - schedule: { days: ["1"], hours: [5], minutes: [15], timeZone: "UTC" }, - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1", - }, - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2", - }, - }, - ], - }, - ], - tags: { key1: "value1" }, - targetResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.update( - resourceGroupName, - autoscaleSettingName, - autoscaleSettingResource - ); - console.log(result); -} - -async function main() { - patchAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesCreateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesCreateSample.js deleted file mode 100644 index 6ccbaf2fc0b0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesCreateSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create or update a workspace - * - * @summary Create or update a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesCreate.json - */ -async function createOrUpdateWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const azureMonitorWorkspaceProperties = { - location: "eastus", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.create( - resourceGroupName, - azureMonitorWorkspaceName, - azureMonitorWorkspaceProperties - ); - console.log(result); -} - -async function main() { - createOrUpdateWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesDeleteSample.js deleted file mode 100644 index f2c4c975135a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesDeleteSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a workspace - * - * @summary Delete a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesDelete.json - */ -async function deleteWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.delete( - resourceGroupName, - azureMonitorWorkspaceName - ); - console.log(result); -} - -async function main() { - deleteWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesGetSample.js deleted file mode 100644 index 4c02337ca6eb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesGetSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns the specific Azure Monitor workspace - * - * @summary Returns the specific Azure Monitor workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesGet.json - */ -async function getWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.get( - resourceGroupName, - azureMonitorWorkspaceName - ); - console.log(result); -} - -async function main() { - getWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListByResourceGroupSample.js deleted file mode 100644 index 15f6de20ae33..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all workspaces in the specified resource group - * - * @summary Lists all workspaces in the specified resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json - */ -async function listMonitorWorkspacesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMonitorWorkspacesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListBySubscriptionSample.js deleted file mode 100644 index cab701fb9827..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all workspaces in the specified subscription - * - * @summary Lists all workspaces in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListBySubscription.json - */ -async function listWorkspacesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listWorkspacesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesUpdateSample.js deleted file mode 100644 index c11397f1c433..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesUpdateSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates part of a workspace - * - * @summary Updates part of a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesUpdate.json - */ -async function updateWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const azureMonitorWorkspaceProperties = { - tags: { tag1: "A", tag2: "B", tag3: "C" }, - }; - const options = { - azureMonitorWorkspaceProperties, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.update( - resourceGroupName, - azureMonitorWorkspaceName, - options - ); - console.log(result); -} - -async function main() { - updateWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/baselinesListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/baselinesListSample.js deleted file mode 100644 index 25a1d22f7f6d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/baselinesListSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to **Lists the metric baseline values for a resource**. - * - * @summary **Lists the metric baseline values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json - */ -async function getMetricBaselines() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1"; - const timespan = "2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z"; - const interval = "PT1H"; - const aggregation = "average"; - const sensitivities = "Low,Medium"; - const options = { - timespan, - interval, - aggregation, - sensitivities, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.baselines.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getMetricBaselines(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsCreateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsCreateSample.js deleted file mode 100644 index 685c3cbc4d21..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsCreateSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a data collection endpoint. - * - * @summary Creates or updates a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json - */ -async function createOrUpdateDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const body = { - location: "eastus", - networkAcls: { publicNetworkAccess: "Enabled" }, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.create( - resourceGroupName, - dataCollectionEndpointName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsDeleteSample.js deleted file mode 100644 index b77db1b10795..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsDeleteSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a data collection endpoint. - * - * @summary Deletes a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json - */ -async function deleteDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.delete( - resourceGroupName, - dataCollectionEndpointName - ); - console.log(result); -} - -async function main() { - deleteDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsGetSample.js deleted file mode 100644 index 0641017adb1b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsGetSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns the specified data collection endpoint. - * - * @summary Returns the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json - */ -async function getDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.get( - resourceGroupName, - dataCollectionEndpointName - ); - console.log(result); -} - -async function main() { - getDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListByResourceGroupSample.js deleted file mode 100644 index eaf0afdf4fbb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified resource group. - * - * @summary Lists all data collection endpoints in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json - */ -async function listDataCollectionEndpointsByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionEndpoints.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionEndpointsByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListBySubscriptionSample.js deleted file mode 100644 index e53b5d2310e3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified subscription - * - * @summary Lists all data collection endpoints in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json - */ -async function listDataCollectionEndpointsBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionEndpoints.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionEndpointsBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsUpdateSample.js deleted file mode 100644 index d7eea337ea7f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsUpdateSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates part of a data collection endpoint. - * - * @summary Updates part of a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json - */ -async function updateDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const body = { tags: { tag1: "A", tag2: "B", tag3: "C" } }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.update( - resourceGroupName, - dataCollectionEndpointName, - options - ); - console.log(result); -} - -async function main() { - updateDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsCreateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsCreateSample.js deleted file mode 100644 index a2b198184204..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsCreateSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates an association. - * - * @summary Creates or updates an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json - */ -async function createOrUpdateAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const body = { - dataCollectionRuleId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule", - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.create( - resourceUri, - associationName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsDeleteSample.js deleted file mode 100644 index f73ee007dfc0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsDeleteSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes an association. - * - * @summary Deletes an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json - */ -async function deleteAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.delete(resourceUri, associationName); - console.log(result); -} - -async function main() { - deleteAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsGetSample.js deleted file mode 100644 index d81af97194cf..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsGetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns the specified association. - * - * @summary Returns the specified association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json - */ -async function getAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.get(resourceUri, associationName); - console.log(result); -} - -async function main() { - getAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js deleted file mode 100644 index d8f9017cd175..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists associations for the specified data collection endpoint. - * - * @summary Lists associations for the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json - */ -async function listAssociationsForSpecifiedDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myDataCollectionEndpointName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByDataCollectionEndpoint( - resourceGroupName, - dataCollectionEndpointName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByResourceSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByResourceSample.js deleted file mode 100644 index d86b92317542..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByResourceSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists associations for the specified resource. - * - * @summary Lists associations for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json - */ -async function listAssociationsForSpecifiedResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByResource(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByRuleSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByRuleSample.js deleted file mode 100644 index c630ec190d02..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByRuleSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists associations for the specified data collection rule. - * - * @summary Lists associations for the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json - */ -async function listAssociationsForSpecifiedDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByRule( - resourceGroupName, - dataCollectionRuleName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesCreateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesCreateSample.js deleted file mode 100644 index 5df61b374364..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesCreateSample.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a data collection rule. - * - * @summary Creates or updates a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json - */ -async function createOrUpdateDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const body = { - dataFlows: [ - { - destinations: ["centralWorkspace"], - streams: ["Microsoft-Perf", "Microsoft-Syslog", "Microsoft-WindowsEvent"], - }, - ], - dataSources: { - performanceCounters: [ - { - name: "cloudTeamCoreCounters", - counterSpecifiers: [ - "\\Processor(_Total)\\% Processor Time", - "\\Memory\\Committed Bytes", - "\\LogicalDisk(_Total)\\Free Megabytes", - "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length", - ], - samplingFrequencyInSeconds: 15, - streams: ["Microsoft-Perf"], - }, - { - name: "appTeamExtraCounters", - counterSpecifiers: ["\\Process(_Total)\\Thread Count"], - samplingFrequencyInSeconds: 30, - streams: ["Microsoft-Perf"], - }, - ], - syslog: [ - { - name: "cronSyslog", - facilityNames: ["cron"], - logLevels: ["Debug", "Critical", "Emergency"], - streams: ["Microsoft-Syslog"], - }, - { - name: "syslogBase", - facilityNames: ["syslog"], - logLevels: ["Alert", "Critical", "Emergency"], - streams: ["Microsoft-Syslog"], - }, - ], - windowsEventLogs: [ - { - name: "cloudSecurityTeamEvents", - streams: ["Microsoft-WindowsEvent"], - xPathQueries: ["Security!"], - }, - { - name: "appTeam1AppEvents", - streams: ["Microsoft-WindowsEvent"], - xPathQueries: [ - "System![System[(Level = 1 or Level = 2 or Level = 3)]]", - "Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]", - ], - }, - ], - }, - destinations: { - logAnalytics: [ - { - name: "centralWorkspace", - workspaceResourceId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace", - }, - ], - }, - location: "eastus", - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.create( - resourceGroupName, - dataCollectionRuleName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesDeleteSample.js deleted file mode 100644 index fb6b05bd317c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a data collection rule. - * - * @summary Deletes a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json - */ -async function deleteDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.delete(resourceGroupName, dataCollectionRuleName); - console.log(result); -} - -async function main() { - deleteDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesGetSample.js deleted file mode 100644 index 134660caeb4f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns the specified data collection rule. - * - * @summary Returns the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json - */ -async function getDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.get(resourceGroupName, dataCollectionRuleName); - console.log(result); -} - -async function main() { - getDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListByResourceGroupSample.js deleted file mode 100644 index b34207695013..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified resource group. - * - * @summary Lists all data collection rules in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json - */ -async function listDataCollectionRulesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRules.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionRulesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListBySubscriptionSample.js deleted file mode 100644 index 486b8a7f2e7e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified subscription. - * - * @summary Lists all data collection rules in the specified subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json - */ -async function listDataCollectionRulesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionRulesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesUpdateSample.js deleted file mode 100644 index ac743821267d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesUpdateSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates part of a data collection rule. - * - * @summary Updates part of a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json - */ -async function updateDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const body = { tags: { tag1: "A", tag2: "B", tag3: "C" } }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.update( - resourceGroupName, - dataCollectionRuleName, - options - ); - console.log(result); -} - -async function main() { - updateDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryGetSample.js deleted file mode 100644 index 8065784f4508..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryGetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the diagnostic settings category for the specified resource. - * - * @summary Gets the diagnostic settings category for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "WorkflowRuntime"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettingsCategory.get(resourceUri, name); - console.log(result); -} - -async function main() { - getsTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.js deleted file mode 100644 index d84db57d6349..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the diagnostic settings categories for the specified resource. - * - * @summary Lists the diagnostic settings categories for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettingsCategory.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.js deleted file mode 100644 index 53ea6c13e1b3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json - */ -async function createsOrUpdatesTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - categoryGroup: "allLogs", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate(resourceUri, name, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSettingCategory.json - */ -async function createsOrUpdatesTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate(resourceUri, name, parameters); - console.log(result); -} - -async function main() { - createsOrUpdatesTheDiagnosticSetting(); - createsOrUpdatesTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsDeleteSample.js deleted file mode 100644 index dbb827119fbf..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsDeleteSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes existing diagnostic settings for the specified resource. - * - * @summary Deletes existing diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json - */ -async function deletesTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.delete(resourceUri, name); - console.log(result); -} - -async function main() { - deletesTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.js deleted file mode 100644 index dc2e6a87f1c9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -async function main() { - getsTheDiagnosticSetting(); - getsTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.js deleted file mode 100644 index 363dc3eb43dc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsTheDiagnosticSetting(); - getsTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/eventCategoriesListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/eventCategoriesListSample.js deleted file mode 100644 index eec32d8f4f43..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/eventCategoriesListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @summary Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json - */ -async function getEventCategories() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.eventCategories.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getEventCategories(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesCreateOrUpdateSample.js deleted file mode 100644 index da226d6f0f13..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesCreateOrUpdateSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create or update a log profile in Azure Monitoring REST API. - * - * @summary Create or update a log profile in Azure Monitoring REST API. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json - */ -async function createOrUpdateALogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "Rac46PostSwapRG"; - const parameters = { - categories: ["Write", "Delete", "Action"], - location: "", - locations: ["global"], - retentionPolicy: { days: 3, enabled: true }, - serviceBusRuleId: "", - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162", - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.createOrUpdate(logProfileName, parameters); - console.log(result); -} - -async function main() { - createOrUpdateALogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesDeleteSample.js deleted file mode 100644 index 71389d1376de..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesDeleteSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes the log profile. - * - * @summary Deletes the log profile. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json - */ -async function deleteLogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const logProfileName = "Rac46PostSwapRG"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.delete(logProfileName); - console.log(result); -} - -async function main() { - deleteLogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesGetSample.js deleted file mode 100644 index 9e9a7ec58562..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesGetSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the log profile. - * - * @summary Gets the log profile. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json - */ -async function getLogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "default"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.get(logProfileName); - console.log(result); -} - -async function main() { - getLogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesListSample.js deleted file mode 100644 index b2b9b1ed3472..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the log profiles. - * - * @summary List the log profiles. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json - */ -async function listLogProfiles() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listLogProfiles(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesUpdateSample.js deleted file mode 100644 index 102f0534f03e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesUpdateSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json - */ -async function patchALogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "Rac46PostSwapRG"; - const logProfilesResource = { - categories: ["Write", "Delete", "Action"], - locations: ["global"], - retentionPolicy: { days: 3, enabled: true }, - serviceBusRuleId: "", - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162", - tags: { key1: "value1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.update(logProfileName, logProfilesResource); - console.log(result); -} - -async function main() { - patchALogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsCreateOrUpdateSample.js deleted file mode 100644 index 66374555c535..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsCreateOrUpdateSample.js +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json - */ -async function createOrUpdateADynamicAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - alertSensitivity: "Medium", - criterionType: "DynamicThresholdCriterion", - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 4, - numberOfEvaluationPeriods: 4, - }, - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterOrLessThan", - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2", - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertSingleResource.json - */ -async function createOrUpdateADynamicAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - alertSensitivity: "Medium", - criterionType: "DynamicThresholdCriterion", - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 4, - numberOfEvaluationPeriods: 4, - }, - ignoreDataBefore: new Date("2019-04-04T21:00:00.000Z"), - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterOrLessThan", - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme", - ], - severity: 3, - tags: {}, - windowSize: "PT15M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateWebTestMetricAlert.json - */ -async function createOrUpdateAWebTestAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "rg-example"; - const ruleName = "webtest-name-example"; - const parameters = { - description: 'Automatically created alert rule for availability test "component-example" a', - actions: [], - criteria: { - componentId: - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", - failedLocationCount: 2, - odataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", - webTestId: - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", - ], - severity: 4, - tags: { - "hiddenLink:/subscriptions/12345678123412341234123456789101/resourcegroups/rgExample/providers/microsoftInsights/components/webtestNameExample": - "Resource", - "hiddenLink:/subscriptions/12345678123412341234123456789101/resourcegroups/rgExample/providers/microsoftInsights/webtests/componentExample": - "Resource", - }, - windowSize: "PT15M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertMultipleResource.json - */ -async function createOrUpdateAnAlertRuleForMultipleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1", - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2", - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSingleResource.json - */ -async function createOrUpdateAnAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "\\Processor(_Total)\\% Processor Time", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "Pt1m", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme", - ], - severity: 3, - tags: {}, - windowSize: "Pt15m", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertResourceGroup.json - */ -async function createOrUpdateAnAlertRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest1"; - const ruleName = "MetricAlertAtResourceGroupLevel"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1", - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2", - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSubscription.json - */ -async function createOrUpdateAnAlertRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertAtSubscriptionLevel"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: ["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertWithDimensions.json - */ -async function createOrUpdateAnAlertRulesWithDimensions() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleDimensions"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "Metric1", - criterionType: "StaticThresholdCriterion", - dimensions: [ - { name: "ActivityName", operator: "Include", values: ["*"] }, - { name: "StatusCode", operator: "Include", values: ["200"] }, - ], - metricName: "Availability", - metricNamespace: "Microsoft.KeyVault/vaults", - operator: "GreaterThan", - threshold: 55, - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "PT1H", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource", - ], - severity: 3, - tags: {}, - windowSize: "P1D", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -async function main() { - createOrUpdateADynamicAlertRuleForMultipleResources(); - createOrUpdateADynamicAlertRuleForSingleResource(); - createOrUpdateAWebTestAlertRule(); - createOrUpdateAnAlertRuleForMultipleResource(); - createOrUpdateAnAlertRuleForSingleResource(); - createOrUpdateAnAlertRuleOnResourceGroupS(); - createOrUpdateAnAlertRuleOnSubscription(); - createOrUpdateAnAlertRulesWithDimensions(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsDeleteSample.js deleted file mode 100644 index af4f20182481..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete an alert rule definition. - * - * @summary Delete an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json - */ -async function deleteAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsGetSample.js deleted file mode 100644 index 5b1ae950a288..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsGetSample.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json - */ -async function getADynamicAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertSingleResource.json - */ -async function getADynamicAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getWebTestMetricAlert.json - */ -async function getAWebTestAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "rg-example"; - const ruleName = "webtest-name-example"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertMultipleResource.json - */ -async function getAnAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSingleResource.json - */ -async function getAnAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertResourceGroup.json - */ -async function getAnAlertRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest1"; - const ruleName = "MetricAlertAtResourceGroupLevel"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSubscription.json - */ -async function getAnAlertRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertAtSubscriptionLevel"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getADynamicAlertRuleForMultipleResources(); - getADynamicAlertRuleForSingleResource(); - getAWebTestAlertRule(); - getAnAlertRuleForMultipleResources(); - getAnAlertRuleForSingleResource(); - getAnAlertRuleOnResourceGroupS(); - getAnAlertRuleOnSubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListByResourceGroupSample.js deleted file mode 100644 index 7d1b371822fa..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve alert rule definitions in a resource group. - * - * @summary Retrieve alert rule definitions in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json - */ -async function listMetricAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricAlerts.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMetricAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListBySubscriptionSample.js deleted file mode 100644 index 9cb90b057f36..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve alert rule definitions in a subscription. - * - * @summary Retrieve alert rule definitions in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json - */ -async function listMetricAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricAlerts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMetricAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListByNameSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListByNameSample.js deleted file mode 100644 index 70a242920273..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListByNameSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve an alert rule status. - * - * @summary Retrieve an alert rule status. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json - */ -async function getAnAlertRuleStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "009f6022-67ec-423e-9aa7-691182870588"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "EastUs"; - const ruleName = "custom1"; - const statusName = - "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlertsStatus.listByName( - resourceGroupName, - ruleName, - statusName - ); - console.log(result); -} - -async function main() { - getAnAlertRuleStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListSample.js deleted file mode 100644 index 1536695c4c3a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve an alert rule status. - * - * @summary Retrieve an alert rule status. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json - */ -async function getAnAlertRuleStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlertsStatus.list(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getAnAlertRuleStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsUpdateSample.js deleted file mode 100644 index 0dec52571b48..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsUpdateSample.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update an metric alert definition. - * - * @summary Update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json - */ -async function createOrUpdateAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "\\Processor(_Total)\\% Processor Time", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "Pt1m", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme", - ], - severity: 3, - tags: {}, - windowSize: "Pt15m", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.update(resourceGroupName, ruleName, parameters); - console.log(result); -} - -async function main() { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListSample.js deleted file mode 100644 index 6202da3422f9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListSample.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json - */ -async function getApplicationInsightsMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions"; - const metricnamespace = "microsoft.insights/components"; - const options = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitions.json - */ -async function getMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricDefinitions"; - const metricnamespace = "Microsoft.Web/sites"; - const options = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsMetricClass.json - */ -async function getStorageCacheMetricDefinitionsWithMetricClass() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"; - const metricnamespace = "microsoft.storagecache/caches"; - const options = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getApplicationInsightsMetricDefinitionsWithoutFilter(); - getMetricDefinitionsWithoutFilter(); - getStorageCacheMetricDefinitionsWithMetricClass(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricNamespacesListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricNamespacesListSample.js deleted file mode 100644 index 6a26344dad5d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricNamespacesListSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the metric namespaces for the resource. - * - * @summary Lists the metric namespaces for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json - */ -async function getMetricNamespacesWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"; - const startTime = "2020-08-31T15:53:00Z"; - const options = { startTime }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricNamespaces.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getMetricNamespacesWithoutFilter(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListSample.js deleted file mode 100644 index f77166d5a2be..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListSample.js +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json - */ -async function getMetricForData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricMetadata.json - */ -async function getMetricForMetadata() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricError.json - */ -async function getMetricWithError() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo"; - const timespan = "2021-06-07T21:51:00Z/2021-06-08T01:51:00Z"; - const interval = "FULL"; - const metricnames = "MongoRequestsCount,MongoRequests"; - const aggregation = "average"; - const metricnamespace = "microsoft.documentdb/databaseaccounts"; - const options = { - timespan, - interval, - metricnames, - aggregation, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -async function main() { - getMetricForData(); - getMetricForMetadata(); - getMetricWithError(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/monitorOperationsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/monitorOperationsListSample.js deleted file mode 100644 index 1630d667f7e0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/monitorOperationsListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists available Operations for this Resource Provider - * - * @summary Lists available Operations for this Resource Provider - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/OperationsGet.json - */ -async function getOperationsList() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitorOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getOperationsList(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/operationsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/operationsListSample.js deleted file mode 100644 index eee0a7a560b5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/operationsListSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all of the available operations from Microsoft.Insights provider. - * - * @summary Lists all of the available operations from Microsoft.Insights provider. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/OperationList.json - */ -async function getAListOfOperationsForAResourceProvider() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.operations.list(); - console.log(result); -} - -async function main() { - getAListOfOperationsForAResourceProvider(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/package.json b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/package.json deleted file mode 100644 index 9a21b8943f92..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-monitor-js-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript (Beta)", - "engines": { - "node": ">=14.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/monitor/arm-monitor" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor", - "dependencies": { - "@azure/arm-monitor": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.js deleted file mode 100644 index fd19e832af2b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to get predictive autoscale metric future data - * - * @summary get predictive autoscale metric future data - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/GetPredictiveMetric.json - */ -async function getMetricForData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myRG"; - const autoscaleSettingName = "vmss1-Autoscale-775"; - const timespan = "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z"; - const interval = "PT1H"; - const metricNamespace = "Microsoft.Compute/virtualMachineScaleSets"; - const metricName = "PercentageCPU"; - const aggregation = "Total"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.predictiveMetric.get( - resourceGroupName, - autoscaleSettingName, - timespan, - interval, - metricNamespace, - metricName, - aggregation - ); - console.log(result); -} - -async function main() { - getMetricForData(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js deleted file mode 100644 index 50525c8b9cbd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js +++ /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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. - * - * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionUpdate.json - */ -async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const parameters = { - privateLinkServiceConnectionState: { - description: "Approved by johndoe@contoso.com", - status: "Approved", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName, - parameters - ); - console.log(result); -} - -async function main() { - approveOrRejectAPrivateEndpointConnectionWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js deleted file mode 100644 index 96b6b6b8026f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a private endpoint connection with a given name. - * - * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionDelete.json - */ -async function deletesAPrivateEndpointConnectionWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - deletesAPrivateEndpointConnectionWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js deleted file mode 100644 index cd41b34b056b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a private endpoint connection. - * - * @summary Gets a private endpoint connection. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - scopeName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsListByPrivateLinkScopeSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsListByPrivateLinkScopeSample.js deleted file mode 100644 index 81eed1b5eb80..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsListByPrivateLinkScopeSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets all private endpoint connections on a private link scope. - * - * @summary Gets all private endpoint connections on a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionList.json - */ -async function getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.listByPrivateLinkScope( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesGetSample.js deleted file mode 100644 index 9c0fdbebf4e9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesGetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @summary Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const groupName = "azuremonitor"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkResources.get(resourceGroupName, scopeName, groupName); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesListByPrivateLinkScopeSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesListByPrivateLinkScopeSample.js deleted file mode 100644 index 2de8b3040e9f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesListByPrivateLinkScopeSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @summary Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopeOperationStatusGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopeOperationStatusGetSample.js deleted file mode 100644 index cfc40d1cdefa..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopeOperationStatusGetSample.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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @summary Get the status of an azure asynchronous operation associated with a private link scope operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/privateLinkScopeOperationStatuses.json - */ -async function getSpecificOperationStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "613192d7-503f-477a-9cfe-4efc3ee2bd60"; - const asyncOperationId = "713192d7-503f-477a-9cfe-4efc3ee2bd11"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopeOperationStatus.get( - asyncOperationId, - resourceGroupName - ); - console.log(result); -} - -async function main() { - getSpecificOperationStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesCreateOrUpdateSample.js deleted file mode 100644 index a48efc0afbb8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesCreateOrUpdateSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. - * - * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceUpdate.json - */ -async function updateAScopedResourceInAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const parameters = { - linkedResourceId: - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/my-component", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - name, - parameters - ); - console.log(result); -} - -async function main() { - updateAScopedResourceInAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesDeleteSample.js deleted file mode 100644 index 49a7f819ecd1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesDeleteSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a private endpoint connection with a given name. - * - * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceDelete.json - */ -async function deletesAScopedResourceWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.beginDeleteAndWait( - resourceGroupName, - scopeName, - name - ); - console.log(result); -} - -async function main() { - deletesAScopedResourceWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesGetSample.js deleted file mode 100644 index 754cef34ed3f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesGetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a scoped resource in a private link scope. - * - * @summary Gets a scoped resource in a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceGet.json - */ -async function getsPrivateLinkScopedResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.get(resourceGroupName, scopeName, name); - console.log(result); -} - -async function main() { - getsPrivateLinkScopedResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesListByPrivateLinkScopeSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesListByPrivateLinkScopeSample.js deleted file mode 100644 index f02e493cd82a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesListByPrivateLinkScopeSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets all private endpoint connections on a private link scope. - * - * @summary Gets all private endpoint connections on a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceList.json - */ -async function getsListOfScopedResourcesInAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopedResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsListOfScopedResourcesInAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesCreateOrUpdateSample.js deleted file mode 100644 index a66775e178ea..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesCreateOrUpdateSample.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * - * @summary Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesCreate.json - */ -async function privateLinkScopeCreate() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const azureMonitorPrivateLinkScopePayload = { - accessModeSettings: { - exclusions: [], - ingestionAccessMode: "Open", - queryAccessMode: "Open", - }, - location: "Global", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.createOrUpdate( - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * - * @summary Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdate.json - */ -async function privateLinkScopeUpdate() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const azureMonitorPrivateLinkScopePayload = { - accessModeSettings: { - exclusions: [], - ingestionAccessMode: "Open", - queryAccessMode: "Open", - }, - location: "Global", - tags: { tag1: "Value1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.createOrUpdate( - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload - ); - console.log(result); -} - -async function main() { - privateLinkScopeCreate(); - privateLinkScopeUpdate(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesDeleteSample.js deleted file mode 100644 index fd34d4f16986..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a Azure Monitor PrivateLinkScope. - * - * @summary Deletes a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesDelete.json - */ -async function privateLinkScopesDelete() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.beginDeleteAndWait(resourceGroupName, scopeName); - console.log(result); -} - -async function main() { - privateLinkScopesDelete(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesGetSample.js deleted file mode 100644 index f2888eddd30e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns a Azure Monitor PrivateLinkScope. - * - * @summary Returns a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesGet.json - */ -async function privateLinkScopeGet() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.get(resourceGroupName, scopeName); - console.log(result); -} - -async function main() { - privateLinkScopeGet(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListByResourceGroupSample.js deleted file mode 100644 index 1ff733bc43a2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @summary Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesListByResourceGroup.json - */ -async function privateLinkScopeListByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopes.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateLinkScopeListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListSample.js deleted file mode 100644 index fe975a34a483..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @summary Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesList.json - */ -async function privateLinkScopesListJson() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopes.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateLinkScopesListJson(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesUpdateTagsSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesUpdateTagsSample.js deleted file mode 100644 index 6b5b91c39912..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesUpdateTagsSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json - */ -async function privateLinkScopeUpdateTagsOnly() { - const subscriptionId = process.env["MONITOR_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const privateLinkScopeTags = { - tags: { tag1: "Value1", tag2: "Value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.updateTags( - resourceGroupName, - scopeName, - privateLinkScopeTags - ); - console.log(result); -} - -async function main() { - privateLinkScopeUpdateTagsOnly(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/sample.env b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesCreateOrUpdateSample.js deleted file mode 100644 index adc6a4af761c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesCreateOrUpdateSample.js +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const parameters = { - description: "Performance rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - ], - customProperties: { key11: "value11", key12: "value12" }, - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [ - { - name: "ComputerIp", - operator: "Exclude", - values: ["192.168.1.1"], - }, - { name: "OSType", operator: "Include", values: ["*"] }, - ], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1, - }, - metricMeasureColumn: "% Processor Time", - operator: "GreaterThan", - query: 'Perf | where ObjectName == "Processor"', - resourceIdColumn: "resourceId", - threshold: 70, - timeAggregation: "Average", - }, - ], - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: [ - "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1", - ], - severity: 4, - skipQueryValidation: true, - windowSize: "PT10M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleResourceGroup.json - */ -async function createOrUpdateAScheduledQueryRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const parameters = { - description: "Health check rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - ], - customProperties: { key11: "value11", key12: "value12" }, - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1, - }, - operator: "GreaterThan", - query: "Heartbeat", - threshold: 360, - timeAggregation: "Count", - }, - ], - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: [ - "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1", - ], - severity: 4, - skipQueryValidation: true, - targetResourceTypes: ["Microsoft.Compute/virtualMachines"], - windowSize: "PT10M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleSubscription.json - */ -async function createOrUpdateAScheduledQueryRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const parameters = { - description: "Performance rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - ], - customProperties: { key11: "value11", key12: "value12" }, - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [ - { - name: "ComputerIp", - operator: "Exclude", - values: ["192.168.1.1"], - }, - { name: "OSType", operator: "Include", values: ["*"] }, - ], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1, - }, - metricMeasureColumn: "% Processor Time", - operator: "GreaterThan", - query: 'Perf | where ObjectName == "Processor"', - resourceIdColumn: "resourceId", - threshold: 70, - timeAggregation: "Average", - }, - ], - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: ["/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"], - severity: 4, - skipQueryValidation: true, - targetResourceTypes: ["Microsoft.Compute/virtualMachines"], - windowSize: "PT10M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAScheduledQueryRuleForSingleResource(); - createOrUpdateAScheduledQueryRuleOnResourceGroupS(); - createOrUpdateAScheduledQueryRuleOnSubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesDeleteSample.js deleted file mode 100644 index e40c3716fd63..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a scheduled query rule. - * - * @summary Deletes a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/deleteScheduledQueryRule.json - */ -async function deleteAScheduledQueryRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesGetSample.js deleted file mode 100644 index 7f8c4c3817a5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve an scheduled query rule definition. - * - * @summary Retrieve an scheduled query rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/getScheduledQueryRule.json - */ -async function getAScheduledQueryRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getAScheduledQueryRuleForSingleResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListByResourceGroupSample.js deleted file mode 100644 index 90cc8d022ca2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve scheduled query rule definitions in a resource group. - * - * @summary Retrieve scheduled query rule definitions in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesByResourceGroup.json - */ -async function listScheduledQueryRulesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.scheduledQueryRules.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listScheduledQueryRulesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListBySubscriptionSample.js deleted file mode 100644 index 0a1cac0be413..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve a scheduled query rule definitions in a subscription. - * - * @summary Retrieve a scheduled query rule definitions in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesBySubscription.json - */ -async function listScheduledQueryRulesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.scheduledQueryRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listScheduledQueryRulesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesUpdateSample.js deleted file mode 100644 index 9e139d583a65..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesUpdateSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a scheduled query rule. - * - * @summary Update a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/patchScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const parameters = { enabled: false }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.update(resourceGroupName, ruleName, parameters); - console.log(result); -} - -async function main() { - createOrUpdateAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActivityLogsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActivityLogsListSample.js deleted file mode 100644 index 24a6a7862256..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActivityLogsListSample.js +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json - */ -async function getTenantActivityLogsWithFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const options = { filter }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFilteredAndSelected.json - */ -async function getTenantActivityLogsWithFilterAndSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options = { filter, select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsSelected.json - */ -async function getTenantActivityLogsWithSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsNoParams.json - */ -async function getTenantActivityLogsWithoutFilterOrSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getTenantActivityLogsWithFilter(); - getTenantActivityLogsWithFilterAndSelect(); - getTenantActivityLogsWithSelect(); - getTenantActivityLogsWithoutFilterOrSelect(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/vmInsightsGetOnboardingStatusSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/vmInsightsGetOnboardingStatusSample.js deleted file mode 100644 index 21e123e29d8b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/vmInsightsGetOnboardingStatusSample.js +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json - */ -async function getStatusForAVMScaleSetThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVMUnknown.json - */ -async function getStatusForAVMThatHasNotYetReportedData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVM.json - */ -async function getStatusForAVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusResourceGroup.json - */ -async function getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSubscription.json - */ -async function getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -async function main() { - getStatusForAVMScaleSetThatIsActivelyReportingData(); - getStatusForAVMThatHasNotYetReportedData(); - getStatusForAVMThatIsActivelyReportingData(); - getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData(); - getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/README.md b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/README.md deleted file mode 100644 index cd1b8f3e333a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/README.md +++ /dev/null @@ -1,281 +0,0 @@ -# client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts][actiongroupscreatenotificationsatactiongroupresourcelevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json | -| [actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts][actiongroupscreatenotificationsatresourcegrouplevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json | -| [actionGroupsCreateOrUpdateSample.ts][actiongroupscreateorupdatesample] | Create a new action group or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json | -| [actionGroupsDeleteSample.ts][actiongroupsdeletesample] | Delete an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json | -| [actionGroupsEnableReceiverSample.ts][actiongroupsenablereceiversample] | Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json | -| [actionGroupsGetSample.ts][actiongroupsgetsample] | Get an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json | -| [actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts][actiongroupsgettestnotificationsatactiongroupresourcelevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json | -| [actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts][actiongroupsgettestnotificationsatresourcegrouplevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json | -| [actionGroupsGetTestNotificationsSample.ts][actiongroupsgettestnotificationssample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json | -| [actionGroupsListByResourceGroupSample.ts][actiongroupslistbyresourcegroupsample] | Get a list of all action groups in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json | -| [actionGroupsListBySubscriptionIdSample.ts][actiongroupslistbysubscriptionidsample] | Get a list of all action groups in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json | -| [actionGroupsPostTestNotificationsSample.ts][actiongroupsposttestnotificationssample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json | -| [actionGroupsUpdateSample.ts][actiongroupsupdatesample] | Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json | -| [activityLogAlertsCreateOrUpdateSample.ts][activitylogalertscreateorupdatesample] | Create a new Activity Log Alert rule or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json | -| [activityLogAlertsDeleteSample.ts][activitylogalertsdeletesample] | Delete an Activity Log Alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json | -| [activityLogAlertsGetSample.ts][activitylogalertsgetsample] | Get an Activity Log Alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json | -| [activityLogAlertsListByResourceGroupSample.ts][activitylogalertslistbyresourcegroupsample] | Get a list of all Activity Log Alert rules in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json | -| [activityLogAlertsListBySubscriptionIdSample.ts][activitylogalertslistbysubscriptionidsample] | Get a list of all Activity Log Alert rules in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json | -| [activityLogAlertsUpdateSample.ts][activitylogalertsupdatesample] | Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json | -| [activityLogsListSample.ts][activitylogslistsample] | Provides the list of records from the activity logs. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json | -| [alertRuleIncidentsGetSample.ts][alertruleincidentsgetsample] | Gets an incident associated to an alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json | -| [alertRuleIncidentsListByAlertRuleSample.ts][alertruleincidentslistbyalertrulesample] | Gets a list of incidents associated to an alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json | -| [alertRulesCreateOrUpdateSample.ts][alertrulescreateorupdatesample] | Creates or updates a classic metric alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json | -| [alertRulesDeleteSample.ts][alertrulesdeletesample] | Deletes a classic metric alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json | -| [alertRulesGetSample.ts][alertrulesgetsample] | Gets a classic metric alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json | -| [alertRulesListByResourceGroupSample.ts][alertruleslistbyresourcegroupsample] | List the classic metric alert rules within a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json | -| [alertRulesListBySubscriptionSample.ts][alertruleslistbysubscriptionsample] | List the classic metric alert rules within a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json | -| [alertRulesUpdateSample.ts][alertrulesupdatesample] | Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json | -| [autoscaleSettingsCreateOrUpdateSample.ts][autoscalesettingscreateorupdatesample] | Creates or updates an autoscale setting. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json | -| [autoscaleSettingsDeleteSample.ts][autoscalesettingsdeletesample] | Deletes and autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json | -| [autoscaleSettingsGetSample.ts][autoscalesettingsgetsample] | Gets an autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json | -| [autoscaleSettingsListByResourceGroupSample.ts][autoscalesettingslistbyresourcegroupsample] | Lists the autoscale settings for a resource group x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json | -| [autoscaleSettingsListBySubscriptionSample.ts][autoscalesettingslistbysubscriptionsample] | Lists the autoscale settings for a subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json | -| [autoscaleSettingsUpdateSample.ts][autoscalesettingsupdatesample] | Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json | -| [azureMonitorWorkspacesCreateSample.ts][azuremonitorworkspacescreatesample] | Create or update a workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesCreate.json | -| [azureMonitorWorkspacesDeleteSample.ts][azuremonitorworkspacesdeletesample] | Delete a workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesDelete.json | -| [azureMonitorWorkspacesGetSample.ts][azuremonitorworkspacesgetsample] | Returns the specific Azure Monitor workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesGet.json | -| [azureMonitorWorkspacesListByResourceGroupSample.ts][azuremonitorworkspaceslistbyresourcegroupsample] | Lists all workspaces in the specified resource group x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json | -| [azureMonitorWorkspacesListBySubscriptionSample.ts][azuremonitorworkspaceslistbysubscriptionsample] | Lists all workspaces in the specified subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListBySubscription.json | -| [azureMonitorWorkspacesUpdateSample.ts][azuremonitorworkspacesupdatesample] | Updates part of a workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesUpdate.json | -| [baselinesListSample.ts][baselineslistsample] | **Lists the metric baseline values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json | -| [dataCollectionEndpointsCreateSample.ts][datacollectionendpointscreatesample] | Creates or updates a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json | -| [dataCollectionEndpointsDeleteSample.ts][datacollectionendpointsdeletesample] | Deletes a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json | -| [dataCollectionEndpointsGetSample.ts][datacollectionendpointsgetsample] | Returns the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json | -| [dataCollectionEndpointsListByResourceGroupSample.ts][datacollectionendpointslistbyresourcegroupsample] | Lists all data collection endpoints in the specified resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json | -| [dataCollectionEndpointsListBySubscriptionSample.ts][datacollectionendpointslistbysubscriptionsample] | Lists all data collection endpoints in the specified subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json | -| [dataCollectionEndpointsUpdateSample.ts][datacollectionendpointsupdatesample] | Updates part of a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json | -| [dataCollectionRuleAssociationsCreateSample.ts][datacollectionruleassociationscreatesample] | Creates or updates an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json | -| [dataCollectionRuleAssociationsDeleteSample.ts][datacollectionruleassociationsdeletesample] | Deletes an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json | -| [dataCollectionRuleAssociationsGetSample.ts][datacollectionruleassociationsgetsample] | Returns the specified association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json | -| [dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts][datacollectionruleassociationslistbydatacollectionendpointsample] | Lists associations for the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json | -| [dataCollectionRuleAssociationsListByResourceSample.ts][datacollectionruleassociationslistbyresourcesample] | Lists associations for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json | -| [dataCollectionRuleAssociationsListByRuleSample.ts][datacollectionruleassociationslistbyrulesample] | Lists associations for the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json | -| [dataCollectionRulesCreateSample.ts][datacollectionrulescreatesample] | Creates or updates a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json | -| [dataCollectionRulesDeleteSample.ts][datacollectionrulesdeletesample] | Deletes a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json | -| [dataCollectionRulesGetSample.ts][datacollectionrulesgetsample] | Returns the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json | -| [dataCollectionRulesListByResourceGroupSample.ts][datacollectionruleslistbyresourcegroupsample] | Lists all data collection rules in the specified resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json | -| [dataCollectionRulesListBySubscriptionSample.ts][datacollectionruleslistbysubscriptionsample] | Lists all data collection rules in the specified subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json | -| [dataCollectionRulesUpdateSample.ts][datacollectionrulesupdatesample] | Updates part of a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json | -| [diagnosticSettingsCategoryGetSample.ts][diagnosticsettingscategorygetsample] | Gets the diagnostic settings category for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json | -| [diagnosticSettingsCategoryListSample.ts][diagnosticsettingscategorylistsample] | Lists the diagnostic settings categories for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json | -| [diagnosticSettingsCreateOrUpdateSample.ts][diagnosticsettingscreateorupdatesample] | Creates or updates diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json | -| [diagnosticSettingsDeleteSample.ts][diagnosticsettingsdeletesample] | Deletes existing diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json | -| [diagnosticSettingsGetSample.ts][diagnosticsettingsgetsample] | Gets the active diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json | -| [diagnosticSettingsListSample.ts][diagnosticsettingslistsample] | Gets the active diagnostic settings list for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json | -| [eventCategoriesListSample.ts][eventcategorieslistsample] | Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json | -| [logProfilesCreateOrUpdateSample.ts][logprofilescreateorupdatesample] | Create or update a log profile in Azure Monitoring REST API. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json | -| [logProfilesDeleteSample.ts][logprofilesdeletesample] | Deletes the log profile. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json | -| [logProfilesGetSample.ts][logprofilesgetsample] | Gets the log profile. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json | -| [logProfilesListSample.ts][logprofileslistsample] | List the log profiles. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json | -| [logProfilesUpdateSample.ts][logprofilesupdatesample] | Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json | -| [metricAlertsCreateOrUpdateSample.ts][metricalertscreateorupdatesample] | Create or update an metric alert definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json | -| [metricAlertsDeleteSample.ts][metricalertsdeletesample] | Delete an alert rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json | -| [metricAlertsGetSample.ts][metricalertsgetsample] | Retrieve an alert rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json | -| [metricAlertsListByResourceGroupSample.ts][metricalertslistbyresourcegroupsample] | Retrieve alert rule definitions in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json | -| [metricAlertsListBySubscriptionSample.ts][metricalertslistbysubscriptionsample] | Retrieve alert rule definitions in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json | -| [metricAlertsStatusListByNameSample.ts][metricalertsstatuslistbynamesample] | Retrieve an alert rule status. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json | -| [metricAlertsStatusListSample.ts][metricalertsstatuslistsample] | Retrieve an alert rule status. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json | -| [metricAlertsUpdateSample.ts][metricalertsupdatesample] | Update an metric alert definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json | -| [metricDefinitionsListSample.ts][metricdefinitionslistsample] | Lists the metric definitions for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json | -| [metricNamespacesListSample.ts][metricnamespaceslistsample] | Lists the metric namespaces for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json | -| [metricsListSample.ts][metricslistsample] | **Lists the metric values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json | -| [monitorOperationsListSample.ts][monitoroperationslistsample] | Lists available Operations for this Resource Provider x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/OperationsGet.json | -| [operationsListSample.ts][operationslistsample] | Lists all of the available operations from Microsoft.Insights provider. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/OperationList.json | -| [predictiveMetricGetSample.ts][predictivemetricgetsample] | get predictive autoscale metric future data x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/GetPredictiveMetric.json | -| [privateEndpointConnectionsCreateOrUpdateSample.ts][privateendpointconnectionscreateorupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionUpdate.json | -| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionDelete.json | -| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets a private endpoint connection. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionGet.json | -| [privateEndpointConnectionsListByPrivateLinkScopeSample.ts][privateendpointconnectionslistbyprivatelinkscopesample] | Gets all private endpoint connections on a private link scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionList.json | -| [privateLinkResourcesGetSample.ts][privatelinkresourcesgetsample] | Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json | -| [privateLinkResourcesListByPrivateLinkScopeSample.ts][privatelinkresourceslistbyprivatelinkscopesample] | Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json | -| [privateLinkScopeOperationStatusGetSample.ts][privatelinkscopeoperationstatusgetsample] | Get the status of an azure asynchronous operation associated with a private link scope operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/privateLinkScopeOperationStatuses.json | -| [privateLinkScopedResourcesCreateOrUpdateSample.ts][privatelinkscopedresourcescreateorupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceUpdate.json | -| [privateLinkScopedResourcesDeleteSample.ts][privatelinkscopedresourcesdeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceDelete.json | -| [privateLinkScopedResourcesGetSample.ts][privatelinkscopedresourcesgetsample] | Gets a scoped resource in a private link scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceGet.json | -| [privateLinkScopedResourcesListByPrivateLinkScopeSample.ts][privatelinkscopedresourceslistbyprivatelinkscopesample] | Gets all private endpoint connections on a private link scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceList.json | -| [privateLinkScopesCreateOrUpdateSample.ts][privatelinkscopescreateorupdatesample] | Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesCreate.json | -| [privateLinkScopesDeleteSample.ts][privatelinkscopesdeletesample] | Deletes a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesDelete.json | -| [privateLinkScopesGetSample.ts][privatelinkscopesgetsample] | Returns a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesGet.json | -| [privateLinkScopesListByResourceGroupSample.ts][privatelinkscopeslistbyresourcegroupsample] | Gets a list of Azure Monitor PrivateLinkScopes within a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesListByResourceGroup.json | -| [privateLinkScopesListSample.ts][privatelinkscopeslistsample] | Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesList.json | -| [privateLinkScopesUpdateTagsSample.ts][privatelinkscopesupdatetagssample] | Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json | -| [scheduledQueryRulesCreateOrUpdateSample.ts][scheduledqueryrulescreateorupdatesample] | Creates or updates a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRule.json | -| [scheduledQueryRulesDeleteSample.ts][scheduledqueryrulesdeletesample] | Deletes a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/deleteScheduledQueryRule.json | -| [scheduledQueryRulesGetSample.ts][scheduledqueryrulesgetsample] | Retrieve an scheduled query rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/getScheduledQueryRule.json | -| [scheduledQueryRulesListByResourceGroupSample.ts][scheduledqueryruleslistbyresourcegroupsample] | Retrieve scheduled query rule definitions in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesByResourceGroup.json | -| [scheduledQueryRulesListBySubscriptionSample.ts][scheduledqueryruleslistbysubscriptionsample] | Retrieve a scheduled query rule definitions in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesBySubscription.json | -| [scheduledQueryRulesUpdateSample.ts][scheduledqueryrulesupdatesample] | Update a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/patchScheduledQueryRule.json | -| [tenantActivityLogsListSample.ts][tenantactivitylogslistsample] | Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does _not_ retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json | -| [vmInsightsGetOnboardingStatusSample.ts][vminsightsgetonboardingstatussample] | Retrieves the VM Insights onboarding status for the specified resource or resource scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env MONITOR_SUBSCRIPTION_ID="" MONITOR_RESOURCE_GROUP="" node dist/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[actiongroupscreatenotificationsatactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts -[actiongroupscreatenotificationsatresourcegrouplevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts -[actiongroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateOrUpdateSample.ts -[actiongroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsDeleteSample.ts -[actiongroupsenablereceiversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsEnableReceiverSample.ts -[actiongroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetSample.ts -[actiongroupsgettestnotificationsatactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts -[actiongroupsgettestnotificationsatresourcegrouplevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts -[actiongroupsgettestnotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.ts -[actiongroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListByResourceGroupSample.ts -[actiongroupslistbysubscriptionidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListBySubscriptionIdSample.ts -[actiongroupsposttestnotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.ts -[actiongroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsUpdateSample.ts -[activitylogalertscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsCreateOrUpdateSample.ts -[activitylogalertsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsDeleteSample.ts -[activitylogalertsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsGetSample.ts -[activitylogalertslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListByResourceGroupSample.ts -[activitylogalertslistbysubscriptionidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListBySubscriptionIdSample.ts -[activitylogalertsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsUpdateSample.ts -[activitylogslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogsListSample.ts -[alertruleincidentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsGetSample.ts -[alertruleincidentslistbyalertrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsListByAlertRuleSample.ts -[alertrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesCreateOrUpdateSample.ts -[alertrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesDeleteSample.ts -[alertrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesGetSample.ts -[alertruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListByResourceGroupSample.ts -[alertruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListBySubscriptionSample.ts -[alertrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesUpdateSample.ts -[autoscalesettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.ts -[autoscalesettingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsDeleteSample.ts -[autoscalesettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsGetSample.ts -[autoscalesettingslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListByResourceGroupSample.ts -[autoscalesettingslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListBySubscriptionSample.ts -[autoscalesettingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.ts -[azuremonitorworkspacescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesCreateSample.ts -[azuremonitorworkspacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesDeleteSample.ts -[azuremonitorworkspacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesGetSample.ts -[azuremonitorworkspaceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListByResourceGroupSample.ts -[azuremonitorworkspaceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListBySubscriptionSample.ts -[azuremonitorworkspacesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesUpdateSample.ts -[baselineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/baselinesListSample.ts -[datacollectionendpointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsCreateSample.ts -[datacollectionendpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsDeleteSample.ts -[datacollectionendpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsGetSample.ts -[datacollectionendpointslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListByResourceGroupSample.ts -[datacollectionendpointslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListBySubscriptionSample.ts -[datacollectionendpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsUpdateSample.ts -[datacollectionruleassociationscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsCreateSample.ts -[datacollectionruleassociationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsDeleteSample.ts -[datacollectionruleassociationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsGetSample.ts -[datacollectionruleassociationslistbydatacollectionendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts -[datacollectionruleassociationslistbyresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByResourceSample.ts -[datacollectionruleassociationslistbyrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByRuleSample.ts -[datacollectionrulescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesCreateSample.ts -[datacollectionrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesDeleteSample.ts -[datacollectionrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesGetSample.ts -[datacollectionruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListByResourceGroupSample.ts -[datacollectionruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListBySubscriptionSample.ts -[datacollectionrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesUpdateSample.ts -[diagnosticsettingscategorygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryGetSample.ts -[diagnosticsettingscategorylistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.ts -[diagnosticsettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.ts -[diagnosticsettingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsDeleteSample.ts -[diagnosticsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.ts -[diagnosticsettingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.ts -[eventcategorieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/eventCategoriesListSample.ts -[logprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesCreateOrUpdateSample.ts -[logprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesDeleteSample.ts -[logprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesGetSample.ts -[logprofileslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesListSample.ts -[logprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesUpdateSample.ts -[metricalertscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsCreateOrUpdateSample.ts -[metricalertsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsDeleteSample.ts -[metricalertsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsGetSample.ts -[metricalertslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListByResourceGroupSample.ts -[metricalertslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListBySubscriptionSample.ts -[metricalertsstatuslistbynamesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListByNameSample.ts -[metricalertsstatuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListSample.ts -[metricalertsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsUpdateSample.ts -[metricdefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListSample.ts -[metricnamespaceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricNamespacesListSample.ts -[metricslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListSample.ts -[monitoroperationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/monitorOperationsListSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/operationsListSample.ts -[predictivemetricgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/predictiveMetricGetSample.ts -[privateendpointconnectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts -[privateendpointconnectionslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts -[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts -[privatelinkresourceslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts -[privatelinkscopeoperationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopeOperationStatusGetSample.ts -[privatelinkscopedresourcescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesCreateOrUpdateSample.ts -[privatelinkscopedresourcesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesDeleteSample.ts -[privatelinkscopedresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesGetSample.ts -[privatelinkscopedresourceslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts -[privatelinkscopescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts -[privatelinkscopesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesDeleteSample.ts -[privatelinkscopesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesGetSample.ts -[privatelinkscopeslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListByResourceGroupSample.ts -[privatelinkscopeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListSample.ts -[privatelinkscopesupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesUpdateTagsSample.ts -[scheduledqueryrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesCreateOrUpdateSample.ts -[scheduledqueryrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesDeleteSample.ts -[scheduledqueryrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesGetSample.ts -[scheduledqueryruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListByResourceGroupSample.ts -[scheduledqueryruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListBySubscriptionSample.ts -[scheduledqueryrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesUpdateSample.ts -[tenantactivitylogslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActivityLogsListSample.ts -[vminsightsgetonboardingstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/vmInsightsGetOnboardingStatusSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-monitor?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/package.json b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/package.json deleted file mode 100644 index 140b803c02c6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-monitor-ts-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript (Beta)", - "engines": { - "node": ">=14.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/monitor/arm-monitor" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor", - "dependencies": { - "@azure/arm-monitor": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^14.0.0", - "typescript": "~4.8.0", - "rimraf": "latest" - } -} diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/sample.env b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts deleted file mode 100644 index f675456f49f4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestRgName"; - const actionGroupName = "TestAgName"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait( - resourceGroupName, - actionGroupName, - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts deleted file mode 100644 index ef9f52b11f34..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-TestNotifications"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName, - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateOrUpdateSample.ts deleted file mode 100644 index 0d8f5181c84d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ActionGroupResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a new action group or update an existing one. - * - * @summary Create a new action group or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json - */ -async function createOrUpdateAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const actionGroup: ActionGroupResource = { - armRoleReceivers: [ - { - name: "Sample armRole", - roleId: "8e3af657-a8ff-443c-a75c-2fe8c4bcb635", - useCommonAlertSchema: true - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - enabled: true, - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - groupShortName: "sample", - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - location: "Global", - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - tags: {}, - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.createOrUpdate( - resourceGroupName, - actionGroupName, - actionGroup - ); - console.log(result); -} - -async function main() { - createOrUpdateAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsDeleteSample.ts deleted file mode 100644 index 7b955a5715d2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete an action group. - * - * @summary Delete an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json - */ -async function deleteAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.delete( - resourceGroupName, - actionGroupName - ); - console.log(result); -} - -async function main() { - deleteAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsEnableReceiverSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsEnableReceiverSample.ts deleted file mode 100644 index cff901ba8be7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsEnableReceiverSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { EnableRequest, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * - * @summary Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json - */ -async function enableTheReceiver() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const enableRequest: EnableRequest = { receiverName: "John Doe's mobile" }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.enableReceiver( - resourceGroupName, - actionGroupName, - enableRequest - ); - console.log(result); -} - -async function main() { - enableTheReceiver(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetSample.ts deleted file mode 100644 index 39fe3b9fca0a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get an action group. - * - * @summary Get an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json - */ -async function getAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.get( - resourceGroupName, - actionGroupName - ); - console.log(result); -} - -async function main() { - getAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts deleted file mode 100644 index cf60c919b027..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestRgName"; - const actionGroupName = "TestAgName"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtActionGroupResourceLevel( - resourceGroupName, - actionGroupName, - notificationId - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts deleted file mode 100644 index 2d98821e1de7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-TestNotifications"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtResourceGroupLevel( - resourceGroupName, - notificationId - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.ts deleted file mode 100644 index 25cd9a72018c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json - */ -async function getNotificationDetailsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotifications(notificationId); - console.log(result); -} - -async function main() { - getNotificationDetailsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListByResourceGroupSample.ts deleted file mode 100644 index 505dc900d581..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all action groups in a resource group. - * - * @summary Get a list of all action groups in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.actionGroups.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActionGroupsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListBySubscriptionIdSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListBySubscriptionIdSample.ts deleted file mode 100644 index 1b40a18b9ef0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all action groups in a subscription. - * - * @summary Get a list of all action groups in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.actionGroups.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActionGroupsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.ts deleted file mode 100644 index 153ade7de654..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json - */ -async function createNotificationsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginPostTestNotificationsAndWait( - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsUpdateSample.ts deleted file mode 100644 index 80b2b49eabac..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsUpdateSample.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. -import { ActionGroupPatchBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json - */ -async function patchAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const actionGroupPatch: ActionGroupPatchBody = { - enabled: false, - tags: { key1: "value1", key2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.update( - resourceGroupName, - actionGroupName, - actionGroupPatch - ); - console.log(result); -} - -async function main() { - patchAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsCreateOrUpdateSample.ts deleted file mode 100644 index b3c9a4e2f415..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ActivityLogAlertResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json - */ -async function createOrUpdateAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const activityLogAlertRule: ActivityLogAlertResource = { - description: "Description of sample Activity Log Alert rule.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" } - } - ] - }, - condition: { - allOf: [ - { equals: "Administrative", field: "category" }, - { equals: "Error", field: "level" } - ] - }, - enabled: true, - location: "Global", - scopes: ["/subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithAnyOfCondition.json - */ -async function createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRuleWithAnyOfCondition"; - const activityLogAlertRule: ActivityLogAlertResource = { - description: - "Description of sample Activity Log Alert rule with 'anyOf' condition.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" } - } - ] - }, - condition: { - allOf: [ - { equals: "ServiceHealth", field: "category" }, - { - anyOf: [ - { equals: "Incident", field: "properties.incidentType" }, - { equals: "Maintenance", field: "properties.incidentType" } - ] - } - ] - }, - enabled: true, - location: "Global", - scopes: ["subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithContainsAny.json - */ -async function createOrUpdateAnActivityLogAlertRuleWithContainsAny() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRuleWithContainsAny"; - const activityLogAlertRule: ActivityLogAlertResource = { - description: - "Description of sample Activity Log Alert rule with 'containsAny'.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" } - } - ] - }, - condition: { - allOf: [ - { equals: "ServiceHealth", field: "category" }, - { - containsAny: ["North Europe", "West Europe"], - field: "properties.impactedServices[*].ImpactedRegions[*].RegionName" - } - ] - }, - enabled: true, - location: "Global", - scopes: ["subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -async function main() { - createOrUpdateAnActivityLogAlertRule(); - createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition(); - createOrUpdateAnActivityLogAlertRuleWithContainsAny(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsDeleteSample.ts deleted file mode 100644 index 15271385aee4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete an Activity Log Alert rule. - * - * @summary Delete an Activity Log Alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json - */ -async function deleteAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.delete( - resourceGroupName, - activityLogAlertName - ); - console.log(result); -} - -async function main() { - deleteAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsGetSample.ts deleted file mode 100644 index 9e1909525bc2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get an Activity Log Alert rule. - * - * @summary Get an Activity Log Alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json - */ -async function getAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.get( - resourceGroupName, - activityLogAlertName - ); - console.log(result); -} - -async function main() { - getAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListByResourceGroupSample.ts deleted file mode 100644 index a198638e54b2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all Activity Log Alert rules in a resource group. - * - * @summary Get a list of all Activity Log Alert rules in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json - */ -async function listActivityLogAlerts() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogAlerts.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActivityLogAlerts(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListBySubscriptionIdSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListBySubscriptionIdSample.ts deleted file mode 100644 index 173f96e013a3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all Activity Log Alert rules in a subscription. - * - * @summary Get a list of all Activity Log Alert rules in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json - */ -async function getListOfAllActivityLogAlertRulesUnderASubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogAlerts.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getListOfAllActivityLogAlertRulesUnderASubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsUpdateSample.ts deleted file mode 100644 index 54bd68fc2c84..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsUpdateSample.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. -import { AlertRulePatchObject, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. - * - * @summary Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json - */ -async function patchAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const activityLogAlertRulePatch: AlertRulePatchObject = { - enabled: false, - tags: { key1: "value1", key2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.update( - resourceGroupName, - activityLogAlertName, - activityLogAlertRulePatch - ); - console.log(result); -} - -async function main() { - patchAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogsListSample.ts deleted file mode 100644 index d58594916b8c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogsListSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ActivityLogsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Provides the list of records from the activity logs. - * - * @summary Provides the list of records from the activity logs. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json - */ -async function getActivityLogsWithFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogs.list(filter)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Provides the list of records from the activity logs. - * - * @summary Provides the list of records from the activity logs. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFilteredAndSelected.json - */ -async function getActivityLogsWithFilterAndSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: ActivityLogsListOptionalParams = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogs.list(filter, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getActivityLogsWithFilter(); - getActivityLogsWithFilterAndSelect(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsGetSample.ts deleted file mode 100644 index fb92424c0220..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets an incident associated to an alert rule - * - * @summary Gets an incident associated to an alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json - */ -async function getASingleAlertRuleIncident() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "myRuleName"; - const incidentName = "Website_started"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRuleIncidents.get( - resourceGroupName, - ruleName, - incidentName - ); - console.log(result); -} - -async function main() { - getASingleAlertRuleIncident(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsListByAlertRuleSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsListByAlertRuleSample.ts deleted file mode 100644 index 0dc8d87947d2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsListByAlertRuleSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of incidents associated to an alert rule - * - * @summary Gets a list of incidents associated to an alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json - */ -async function listAlertRuleIncidents() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "myRuleName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRuleIncidents.listByAlertRule( - resourceGroupName, - ruleName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRuleIncidents(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesCreateOrUpdateSample.ts deleted file mode 100644 index dfe78856925c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a classic metric alert rule. - * - * @summary Creates or updates a classic metric alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json - */ -async function createOrUpdateAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const parameters: AlertRuleResource = { - namePropertiesName: "chiricutin", - description: "Pura Vida", - actions: [], - condition: { - dataSource: { - metricName: "Requests", - odataType: - "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - resourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest" - }, - odataType: - "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - operator: "GreaterThan", - threshold: 3, - timeAggregation: "Total", - windowSize: "PT5M" - }, - isEnabled: true, - location: "West US", - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesDeleteSample.ts deleted file mode 100644 index 6bd0b7f8913b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a classic metric alert rule - * - * @summary Deletes a classic metric alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json - */ -async function deleteAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesGetSample.ts deleted file mode 100644 index 1eed90dfd819..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a classic metric alert rule - * - * @summary Gets a classic metric alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json - */ -async function getAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListByResourceGroupSample.ts deleted file mode 100644 index 3b5450f105b0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the classic metric alert rules within a resource group. - * - * @summary List the classic metric alert rules within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json - */ -async function listAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRules.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListBySubscriptionSample.ts deleted file mode 100644 index 04a8b5846cd7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the classic metric alert rules within a subscription. - * - * @summary List the classic metric alert rules within a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json - */ -async function listAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesUpdateSample.ts deleted file mode 100644 index 5096a58eb37f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesUpdateSample.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRuleResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json - */ -async function patchAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const alertRulesResource: AlertRuleResourcePatch = { - name: "chiricutin", - description: "Pura Vida", - actions: [], - condition: { - dataSource: { - metricName: "Requests", - odataType: - "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - resourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest" - }, - odataType: - "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - operator: "GreaterThan", - threshold: 3, - timeAggregation: "Total", - windowSize: "PT5M" - }, - isEnabled: true, - tags: { - $type: - "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary" - } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.update( - resourceGroupName, - ruleName, - alertRulesResource - ); - console.log(result); -} - -async function main() { - patchAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.ts deleted file mode 100644 index 9c9021581f86..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AutoscaleSettingResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an autoscale setting. - * - * @summary Creates or updates an autoscale setting. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json - */ -async function createOrUpdateAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const parameters: AutoscaleSettingResource = { - enabled: true, - location: "West US", - notifications: [ - { - email: { - customEmails: ["gu@ms.com", "ge@ns.net"], - sendToSubscriptionAdministrator: true, - sendToSubscriptionCoAdministrators: true - }, - operation: "Scale", - webhooks: [{ properties: {}, serviceUri: "http://myservice.com" }] - } - ], - predictiveAutoscalePolicy: { scaleMode: "Enabled" }, - profiles: [ - { - name: "adios", - capacity: { default: "1", maximum: "10", minimum: "1" }, - fixedDate: { - end: new Date("2015-03-05T14:30:00Z"), - start: new Date("2015-03-05T14:00:00Z"), - timeZone: "UTC" - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - }, - { - name: "saludos", - capacity: { default: "1", maximum: "10", minimum: "1" }, - recurrence: { - frequency: "Week", - schedule: { days: ["1"], hours: [5], minutes: [15], timeZone: "UTC" } - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - } - ], - tags: { key1: "value1", key2: "value2" }, - targetResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.createOrUpdate( - resourceGroupName, - autoscaleSettingName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsDeleteSample.ts deleted file mode 100644 index d40921fc31be..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes and autoscale setting - * - * @summary Deletes and autoscale setting - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json - */ -async function deleteAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.delete( - resourceGroupName, - autoscaleSettingName - ); - console.log(result); -} - -async function main() { - deleteAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsGetSample.ts deleted file mode 100644 index 8d41ae5c506b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets an autoscale setting - * - * @summary Gets an autoscale setting - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json - */ -async function getAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.get( - resourceGroupName, - autoscaleSettingName - ); - console.log(result); -} - -async function main() { - getAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListByResourceGroupSample.ts deleted file mode 100644 index 27a63fcea6f6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the autoscale settings for a resource group - * - * @summary Lists the autoscale settings for a resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json - */ -async function listAutoscaleSettings() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.autoscaleSettings.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAutoscaleSettings(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListBySubscriptionSample.ts deleted file mode 100644 index 726e2114046d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the autoscale settings for a subscription - * - * @summary Lists the autoscale settings for a subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json - */ -async function listAutoscaleSettingsBySubs() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.autoscaleSettings.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAutoscaleSettingsBySubs(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.ts deleted file mode 100644 index 5b30e31e28df..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AutoscaleSettingResourcePatch, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json - */ -async function patchAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const autoscaleSettingResource: AutoscaleSettingResourcePatch = { - enabled: true, - notifications: [ - { - email: { - customEmails: ["gu@ms.com", "ge@ns.net"], - sendToSubscriptionAdministrator: true, - sendToSubscriptionCoAdministrators: true - }, - operation: "Scale", - webhooks: [{ properties: {}, serviceUri: "http://myservice.com" }] - } - ], - predictiveAutoscalePolicy: { scaleMode: "Enabled" }, - profiles: [ - { - name: "adios", - capacity: { default: "1", maximum: "10", minimum: "1" }, - fixedDate: { - end: new Date("2015-03-05T14:30:00Z"), - start: new Date("2015-03-05T14:00:00Z"), - timeZone: "UTC" - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - }, - { - name: "saludos", - capacity: { default: "1", maximum: "10", minimum: "1" }, - recurrence: { - frequency: "Week", - schedule: { days: ["1"], hours: [5], minutes: [15], timeZone: "UTC" } - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - } - ], - tags: { key1: "value1" }, - targetResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.update( - resourceGroupName, - autoscaleSettingName, - autoscaleSettingResource - ); - console.log(result); -} - -async function main() { - patchAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesCreateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesCreateSample.ts deleted file mode 100644 index cd950812a39c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesCreateSample.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. -import { - AzureMonitorWorkspaceResource, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update a workspace - * - * @summary Create or update a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesCreate.json - */ -async function createOrUpdateWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const azureMonitorWorkspaceProperties: AzureMonitorWorkspaceResource = { - location: "eastus" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.create( - resourceGroupName, - azureMonitorWorkspaceName, - azureMonitorWorkspaceProperties - ); - console.log(result); -} - -async function main() { - createOrUpdateWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesDeleteSample.ts deleted file mode 100644 index 540b8c1a8c3e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a workspace - * - * @summary Delete a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesDelete.json - */ -async function deleteWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.delete( - resourceGroupName, - azureMonitorWorkspaceName - ); - console.log(result); -} - -async function main() { - deleteWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesGetSample.ts deleted file mode 100644 index 9d42224702c5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specific Azure Monitor workspace - * - * @summary Returns the specific Azure Monitor workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesGet.json - */ -async function getWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.get( - resourceGroupName, - azureMonitorWorkspaceName - ); - console.log(result); -} - -async function main() { - getWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListByResourceGroupSample.ts deleted file mode 100644 index d33e9e1033e5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all workspaces in the specified resource group - * - * @summary Lists all workspaces in the specified resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json - */ -async function listMonitorWorkspacesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMonitorWorkspacesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListBySubscriptionSample.ts deleted file mode 100644 index 67073eac8ea5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all workspaces in the specified subscription - * - * @summary Lists all workspaces in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListBySubscription.json - */ -async function listWorkspacesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listWorkspacesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesUpdateSample.ts deleted file mode 100644 index 16f3bf41e057..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesUpdateSample.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AzureMonitorWorkspaceResourceForUpdate, - AzureMonitorWorkspacesUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates part of a workspace - * - * @summary Updates part of a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesUpdate.json - */ -async function updateWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const azureMonitorWorkspaceProperties: AzureMonitorWorkspaceResourceForUpdate = { - tags: { tag1: "A", tag2: "B", tag3: "C" } - }; - const options: AzureMonitorWorkspacesUpdateOptionalParams = { - azureMonitorWorkspaceProperties - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.update( - resourceGroupName, - azureMonitorWorkspaceName, - options - ); - console.log(result); -} - -async function main() { - updateWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/baselinesListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/baselinesListSample.ts deleted file mode 100644 index 14eb069dd324..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/baselinesListSample.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. -import { BaselinesListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to **Lists the metric baseline values for a resource**. - * - * @summary **Lists the metric baseline values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json - */ -async function getMetricBaselines() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1"; - const timespan = "2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z"; - const interval = "PT1H"; - const aggregation = "average"; - const sensitivities = "Low,Medium"; - const options: BaselinesListOptionalParams = { - timespan, - interval, - aggregation, - sensitivities - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.baselines.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getMetricBaselines(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsCreateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsCreateSample.ts deleted file mode 100644 index 519b967cab5f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DataCollectionEndpointResource, - DataCollectionEndpointsCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a data collection endpoint. - * - * @summary Creates or updates a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json - */ -async function createOrUpdateDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const body: DataCollectionEndpointResource = { - location: "eastus", - networkAcls: { publicNetworkAccess: "Enabled" } - }; - const options: DataCollectionEndpointsCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.create( - resourceGroupName, - dataCollectionEndpointName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsDeleteSample.ts deleted file mode 100644 index 7a0edbdcc6fb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a data collection endpoint. - * - * @summary Deletes a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json - */ -async function deleteDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.delete( - resourceGroupName, - dataCollectionEndpointName - ); - console.log(result); -} - -async function main() { - deleteDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsGetSample.ts deleted file mode 100644 index 8b65d70d4b9f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specified data collection endpoint. - * - * @summary Returns the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json - */ -async function getDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.get( - resourceGroupName, - dataCollectionEndpointName - ); - console.log(result); -} - -async function main() { - getDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListByResourceGroupSample.ts deleted file mode 100644 index 733401f8e149..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified resource group. - * - * @summary Lists all data collection endpoints in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json - */ -async function listDataCollectionEndpointsByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionEndpoints.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionEndpointsByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListBySubscriptionSample.ts deleted file mode 100644 index f9a0d214965b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified subscription - * - * @summary Lists all data collection endpoints in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json - */ -async function listDataCollectionEndpointsBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionEndpoints.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionEndpointsBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsUpdateSample.ts deleted file mode 100644 index b0b5564c3a59..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsUpdateSample.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. -import { - ResourceForUpdate, - DataCollectionEndpointsUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates part of a data collection endpoint. - * - * @summary Updates part of a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json - */ -async function updateDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const body: ResourceForUpdate = { tags: { tag1: "A", tag2: "B", tag3: "C" } }; - const options: DataCollectionEndpointsUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.update( - resourceGroupName, - dataCollectionEndpointName, - options - ); - console.log(result); -} - -async function main() { - updateDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsCreateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsCreateSample.ts deleted file mode 100644 index 758df428def8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DataCollectionRuleAssociationProxyOnlyResource, - DataCollectionRuleAssociationsCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an association. - * - * @summary Creates or updates an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json - */ -async function createOrUpdateAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const body: DataCollectionRuleAssociationProxyOnlyResource = { - dataCollectionRuleId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule" - }; - const options: DataCollectionRuleAssociationsCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.create( - resourceUri, - associationName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsDeleteSample.ts deleted file mode 100644 index 1034e30e337a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes an association. - * - * @summary Deletes an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json - */ -async function deleteAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.delete( - resourceUri, - associationName - ); - console.log(result); -} - -async function main() { - deleteAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsGetSample.ts deleted file mode 100644 index 35540040a92e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specified association. - * - * @summary Returns the specified association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json - */ -async function getAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.get( - resourceUri, - associationName - ); - console.log(result); -} - -async function main() { - getAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts deleted file mode 100644 index 6d97bace404b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists associations for the specified data collection endpoint. - * - * @summary Lists associations for the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json - */ -async function listAssociationsForSpecifiedDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myDataCollectionEndpointName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByDataCollectionEndpoint( - resourceGroupName, - dataCollectionEndpointName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByResourceSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByResourceSample.ts deleted file mode 100644 index 11ffcd21d8f5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByResourceSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists associations for the specified resource. - * - * @summary Lists associations for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json - */ -async function listAssociationsForSpecifiedResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByResource( - resourceUri - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByRuleSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByRuleSample.ts deleted file mode 100644 index 6cccd9d83a75..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByRuleSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists associations for the specified data collection rule. - * - * @summary Lists associations for the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json - */ -async function listAssociationsForSpecifiedDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByRule( - resourceGroupName, - dataCollectionRuleName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesCreateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesCreateSample.ts deleted file mode 100644 index db801c866f14..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesCreateSample.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DataCollectionRuleResource, - DataCollectionRulesCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a data collection rule. - * - * @summary Creates or updates a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json - */ -async function createOrUpdateDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const body: DataCollectionRuleResource = { - dataFlows: [ - { - destinations: ["centralWorkspace"], - streams: [ - "Microsoft-Perf", - "Microsoft-Syslog", - "Microsoft-WindowsEvent" - ] - } - ], - dataSources: { - performanceCounters: [ - { - name: "cloudTeamCoreCounters", - counterSpecifiers: [ - "\\Processor(_Total)\\% Processor Time", - "\\Memory\\Committed Bytes", - "\\LogicalDisk(_Total)\\Free Megabytes", - "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length" - ], - samplingFrequencyInSeconds: 15, - streams: ["Microsoft-Perf"] - }, - { - name: "appTeamExtraCounters", - counterSpecifiers: ["\\Process(_Total)\\Thread Count"], - samplingFrequencyInSeconds: 30, - streams: ["Microsoft-Perf"] - } - ], - syslog: [ - { - name: "cronSyslog", - facilityNames: ["cron"], - logLevels: ["Debug", "Critical", "Emergency"], - streams: ["Microsoft-Syslog"] - }, - { - name: "syslogBase", - facilityNames: ["syslog"], - logLevels: ["Alert", "Critical", "Emergency"], - streams: ["Microsoft-Syslog"] - } - ], - windowsEventLogs: [ - { - name: "cloudSecurityTeamEvents", - streams: ["Microsoft-WindowsEvent"], - xPathQueries: ["Security!"] - }, - { - name: "appTeam1AppEvents", - streams: ["Microsoft-WindowsEvent"], - xPathQueries: [ - "System![System[(Level = 1 or Level = 2 or Level = 3)]]", - "Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]" - ] - } - ] - }, - destinations: { - logAnalytics: [ - { - name: "centralWorkspace", - workspaceResourceId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace" - } - ] - }, - location: "eastus" - }; - const options: DataCollectionRulesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.create( - resourceGroupName, - dataCollectionRuleName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesDeleteSample.ts deleted file mode 100644 index 4becc7faf8c8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a data collection rule. - * - * @summary Deletes a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json - */ -async function deleteDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.delete( - resourceGroupName, - dataCollectionRuleName - ); - console.log(result); -} - -async function main() { - deleteDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesGetSample.ts deleted file mode 100644 index 833b20532bdb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specified data collection rule. - * - * @summary Returns the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json - */ -async function getDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.get( - resourceGroupName, - dataCollectionRuleName - ); - console.log(result); -} - -async function main() { - getDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListByResourceGroupSample.ts deleted file mode 100644 index 3a5ad5f3084a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified resource group. - * - * @summary Lists all data collection rules in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json - */ -async function listDataCollectionRulesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRules.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionRulesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListBySubscriptionSample.ts deleted file mode 100644 index 509f9ffdb351..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified subscription. - * - * @summary Lists all data collection rules in the specified subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json - */ -async function listDataCollectionRulesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionRulesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesUpdateSample.ts deleted file mode 100644 index 3cedeb4a88a2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesUpdateSample.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. -import { - ResourceForUpdate, - DataCollectionRulesUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates part of a data collection rule. - * - * @summary Updates part of a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json - */ -async function updateDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const body: ResourceForUpdate = { tags: { tag1: "A", tag2: "B", tag3: "C" } }; - const options: DataCollectionRulesUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.update( - resourceGroupName, - dataCollectionRuleName, - options - ); - console.log(result); -} - -async function main() { - updateDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryGetSample.ts deleted file mode 100644 index 769917b066a8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the diagnostic settings category for the specified resource. - * - * @summary Gets the diagnostic settings category for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "WorkflowRuntime"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettingsCategory.get(resourceUri, name); - console.log(result); -} - -async function main() { - getsTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.ts deleted file mode 100644 index a7d2472c1194..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the diagnostic settings categories for the specified resource. - * - * @summary Lists the diagnostic settings categories for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettingsCategory.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.ts deleted file mode 100644 index 31843adcbddf..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DiagnosticSettingsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json - */ -async function createsOrUpdatesTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters: DiagnosticSettingsResource = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - categoryGroup: "allLogs", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSettingCategory.json - */ -async function createsOrUpdatesTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters: DiagnosticSettingsResource = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters - ); - console.log(result); -} - -async function main() { - createsOrUpdatesTheDiagnosticSetting(); - createsOrUpdatesTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsDeleteSample.ts deleted file mode 100644 index d99ca747b606..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes existing diagnostic settings for the specified resource. - * - * @summary Deletes existing diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json - */ -async function deletesTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.delete(resourceUri, name); - console.log(result); -} - -async function main() { - deletesTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.ts deleted file mode 100644 index 51552f38193b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -async function main() { - getsTheDiagnosticSetting(); - getsTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.ts deleted file mode 100644 index 0927d272c404..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsTheDiagnosticSetting(); - getsTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/eventCategoriesListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/eventCategoriesListSample.ts deleted file mode 100644 index 43a5ac1c8845..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/eventCategoriesListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @summary Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json - */ -async function getEventCategories() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.eventCategories.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getEventCategories(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesCreateOrUpdateSample.ts deleted file mode 100644 index ace58a8b0b8e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesCreateOrUpdateSample.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. -import { LogProfileResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update a log profile in Azure Monitoring REST API. - * - * @summary Create or update a log profile in Azure Monitoring REST API. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json - */ -async function createOrUpdateALogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "Rac46PostSwapRG"; - const parameters: LogProfileResource = { - categories: ["Write", "Delete", "Action"], - location: "", - locations: ["global"], - retentionPolicy: { days: 3, enabled: true }, - serviceBusRuleId: "", - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162", - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.createOrUpdate( - logProfileName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateALogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesDeleteSample.ts deleted file mode 100644 index c264d326b6a3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesDeleteSample.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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes the log profile. - * - * @summary Deletes the log profile. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json - */ -async function deleteLogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const logProfileName = "Rac46PostSwapRG"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.delete(logProfileName); - console.log(result); -} - -async function main() { - deleteLogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesGetSample.ts deleted file mode 100644 index 9e2f9f31105a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesGetSample.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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the log profile. - * - * @summary Gets the log profile. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json - */ -async function getLogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "default"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.get(logProfileName); - console.log(result); -} - -async function main() { - getLogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesListSample.ts deleted file mode 100644 index 717850be0c5a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the log profiles. - * - * @summary List the log profiles. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json - */ -async function listLogProfiles() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listLogProfiles(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesUpdateSample.ts deleted file mode 100644 index 32c9825f24f7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesUpdateSample.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. -import { LogProfileResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json - */ -async function patchALogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "Rac46PostSwapRG"; - const logProfilesResource: LogProfileResourcePatch = { - categories: ["Write", "Delete", "Action"], - locations: ["global"], - retentionPolicy: { days: 3, enabled: true }, - serviceBusRuleId: "", - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162", - tags: { key1: "value1" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.update( - logProfileName, - logProfilesResource - ); - console.log(result); -} - -async function main() { - patchALogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsCreateOrUpdateSample.ts deleted file mode 100644 index d609df81bd95..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,504 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricAlertResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json - */ -async function createOrUpdateADynamicAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - alertSensitivity: "Medium", - criterionType: "DynamicThresholdCriterion", - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 4, - numberOfEvaluationPeriods: 4 - }, - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterOrLessThan", - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2" - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertSingleResource.json - */ -async function createOrUpdateADynamicAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - alertSensitivity: "Medium", - criterionType: "DynamicThresholdCriterion", - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 4, - numberOfEvaluationPeriods: 4 - }, - ignoreDataBefore: new Date("2019-04-04T21:00:00.000Z"), - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterOrLessThan", - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - severity: 3, - tags: {}, - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateWebTestMetricAlert.json - */ -async function createOrUpdateAWebTestAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "rg-example"; - const ruleName = "webtest-name-example"; - const parameters: MetricAlertResource = { - description: - 'Automatically created alert rule for availability test "component-example" a', - actions: [], - criteria: { - componentId: - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", - failedLocationCount: 2, - odataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", - webTestId: - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example" - ], - severity: 4, - tags: { - "hiddenLink:/subscriptions/12345678123412341234123456789101/resourcegroups/rgExample/providers/microsoftInsights/components/webtestNameExample": - "Resource", - "hiddenLink:/subscriptions/12345678123412341234123456789101/resourcegroups/rgExample/providers/microsoftInsights/webtests/componentExample": - "Resource" - }, - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertMultipleResource.json - */ -async function createOrUpdateAnAlertRuleForMultipleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1", - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2" - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSingleResource.json - */ -async function createOrUpdateAnAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "\\Processor(_Total)\\% Processor Time", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "Pt1m", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - severity: 3, - tags: {}, - windowSize: "Pt15m" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertResourceGroup.json - */ -async function createOrUpdateAnAlertRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest1"; - const ruleName = "MetricAlertAtResourceGroupLevel"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1", - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2" - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSubscription.json - */ -async function createOrUpdateAnAlertRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertAtSubscriptionLevel"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: ["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertWithDimensions.json - */ -async function createOrUpdateAnAlertRulesWithDimensions() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleDimensions"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "Metric1", - criterionType: "StaticThresholdCriterion", - dimensions: [ - { name: "ActivityName", operator: "Include", values: ["*"] }, - { name: "StatusCode", operator: "Include", values: ["200"] } - ], - metricName: "Availability", - metricNamespace: "Microsoft.KeyVault/vaults", - operator: "GreaterThan", - threshold: 55, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1H", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource" - ], - severity: 3, - tags: {}, - windowSize: "P1D" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateADynamicAlertRuleForMultipleResources(); - createOrUpdateADynamicAlertRuleForSingleResource(); - createOrUpdateAWebTestAlertRule(); - createOrUpdateAnAlertRuleForMultipleResource(); - createOrUpdateAnAlertRuleForSingleResource(); - createOrUpdateAnAlertRuleOnResourceGroupS(); - createOrUpdateAnAlertRuleOnSubscription(); - createOrUpdateAnAlertRulesWithDimensions(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsDeleteSample.ts deleted file mode 100644 index 30628e3520d6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsDeleteSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete an alert rule definition. - * - * @summary Delete an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json - */ -async function deleteAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsGetSample.ts deleted file mode 100644 index c1b733567e66..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsGetSample.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json - */ -async function getADynamicAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertSingleResource.json - */ -async function getADynamicAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getWebTestMetricAlert.json - */ -async function getAWebTestAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "rg-example"; - const ruleName = "webtest-name-example"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertMultipleResource.json - */ -async function getAnAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSingleResource.json - */ -async function getAnAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertResourceGroup.json - */ -async function getAnAlertRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest1"; - const ruleName = "MetricAlertAtResourceGroupLevel"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSubscription.json - */ -async function getAnAlertRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertAtSubscriptionLevel"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getADynamicAlertRuleForMultipleResources(); - getADynamicAlertRuleForSingleResource(); - getAWebTestAlertRule(); - getAnAlertRuleForMultipleResources(); - getAnAlertRuleForSingleResource(); - getAnAlertRuleOnResourceGroupS(); - getAnAlertRuleOnSubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListByResourceGroupSample.ts deleted file mode 100644 index 3396a7fc63bf..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve alert rule definitions in a resource group. - * - * @summary Retrieve alert rule definitions in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json - */ -async function listMetricAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricAlerts.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMetricAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListBySubscriptionSample.ts deleted file mode 100644 index 8e5e162a5570..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve alert rule definitions in a subscription. - * - * @summary Retrieve alert rule definitions in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json - */ -async function listMetricAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricAlerts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMetricAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListByNameSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListByNameSample.ts deleted file mode 100644 index 37c18dacacb1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListByNameSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an alert rule status. - * - * @summary Retrieve an alert rule status. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json - */ -async function getAnAlertRuleStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "009f6022-67ec-423e-9aa7-691182870588"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "EastUs"; - const ruleName = "custom1"; - const statusName = - "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlertsStatus.listByName( - resourceGroupName, - ruleName, - statusName - ); - console.log(result); -} - -async function main() { - getAnAlertRuleStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListSample.ts deleted file mode 100644 index 250b43d4748c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListSample.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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an alert rule status. - * - * @summary Retrieve an alert rule status. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json - */ -async function getAnAlertRuleStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlertsStatus.list( - resourceGroupName, - ruleName - ); - console.log(result); -} - -async function main() { - getAnAlertRuleStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsUpdateSample.ts deleted file mode 100644 index 28c118771553..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsUpdateSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricAlertResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update an metric alert definition. - * - * @summary Update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json - */ -async function createOrUpdateAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters: MetricAlertResourcePatch = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "\\Processor(_Total)\\% Processor Time", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "Pt1m", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - severity: 3, - tags: {}, - windowSize: "Pt15m" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.update( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListSample.ts deleted file mode 100644 index db4ec4a363d5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListSample.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricDefinitionsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json - */ -async function getApplicationInsightsMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions"; - const metricnamespace = "microsoft.insights/components"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitions.json - */ -async function getMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricDefinitions"; - const metricnamespace = "Microsoft.Web/sites"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsMetricClass.json - */ -async function getStorageCacheMetricDefinitionsWithMetricClass() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"; - const metricnamespace = "microsoft.storagecache/caches"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getApplicationInsightsMetricDefinitionsWithoutFilter(); - getMetricDefinitionsWithoutFilter(); - getStorageCacheMetricDefinitionsWithMetricClass(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricNamespacesListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricNamespacesListSample.ts deleted file mode 100644 index 3df200d50713..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricNamespacesListSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricNamespacesListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the metric namespaces for the resource. - * - * @summary Lists the metric namespaces for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json - */ -async function getMetricNamespacesWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"; - const startTime = "2020-08-31T15:53:00Z"; - const options: MetricNamespacesListOptionalParams = { startTime }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricNamespaces.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getMetricNamespacesWithoutFilter(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListSample.ts deleted file mode 100644 index de1242962f04..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListSample.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricsListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json - */ -async function getMetricForData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricMetadata.json - */ -async function getMetricForMetadata() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricError.json - */ -async function getMetricWithError() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo"; - const timespan = "2021-06-07T21:51:00Z/2021-06-08T01:51:00Z"; - const interval = "FULL"; - const metricnames = "MongoRequestsCount,MongoRequests"; - const aggregation = "average"; - const metricnamespace = "microsoft.documentdb/databaseaccounts"; - const options: MetricsListOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -async function main() { - getMetricForData(); - getMetricForMetadata(); - getMetricWithError(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/monitorOperationsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/monitorOperationsListSample.ts deleted file mode 100644 index c39df4e1ffa2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/monitorOperationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists available Operations for this Resource Provider - * - * @summary Lists available Operations for this Resource Provider - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/OperationsGet.json - */ -async function getOperationsList() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitorOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getOperationsList(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/operationsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/operationsListSample.ts deleted file mode 100644 index b286ddbb34f4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all of the available operations from Microsoft.Insights provider. - * - * @summary Lists all of the available operations from Microsoft.Insights provider. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/OperationList.json - */ -async function getAListOfOperationsForAResourceProvider() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.operations.list(); - console.log(result); -} - -async function main() { - getAListOfOperationsForAResourceProvider(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/predictiveMetricGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/predictiveMetricGetSample.ts deleted file mode 100644 index 46141b8812d7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/predictiveMetricGetSample.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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to get predictive autoscale metric future data - * - * @summary get predictive autoscale metric future data - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/GetPredictiveMetric.json - */ -async function getMetricForData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myRG"; - const autoscaleSettingName = "vmss1-Autoscale-775"; - const timespan = "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z"; - const interval = "PT1H"; - const metricNamespace = "Microsoft.Compute/virtualMachineScaleSets"; - const metricName = "PercentageCPU"; - const aggregation = "Total"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.predictiveMetric.get( - resourceGroupName, - autoscaleSettingName, - timespan, - interval, - metricNamespace, - metricName, - aggregation - ); - console.log(result); -} - -async function main() { - getMetricForData(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts deleted file mode 100644 index 58c9ae6e5230..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.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. -import { PrivateEndpointConnection, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. - * - * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionUpdate.json - */ -async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const parameters: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Approved by johndoe@contoso.com", - status: "Approved" - } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName, - parameters - ); - console.log(result); -} - -async function main() { - approveOrRejectAPrivateEndpointConnectionWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts deleted file mode 100644 index 3328788b882d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a private endpoint connection with a given name. - * - * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionDelete.json - */ -async function deletesAPrivateEndpointConnectionWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - deletesAPrivateEndpointConnectionWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts deleted file mode 100644 index 61b6812cba6a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a private endpoint connection. - * - * @summary Gets a private endpoint connection. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - scopeName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts deleted file mode 100644 index 3ad2bbb647f0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets all private endpoint connections on a private link scope. - * - * @summary Gets all private endpoint connections on a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionList.json - */ -async function getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.listByPrivateLinkScope( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts deleted file mode 100644 index a44ca23c11f4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @summary Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const groupName = "azuremonitor"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkResources.get( - resourceGroupName, - scopeName, - groupName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts deleted file mode 100644 index b2d1f95086c2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @summary Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopeOperationStatusGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopeOperationStatusGetSample.ts deleted file mode 100644 index 8f40d8c5a8f5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopeOperationStatusGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @summary Get the status of an azure asynchronous operation associated with a private link scope operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/privateLinkScopeOperationStatuses.json - */ -async function getSpecificOperationStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "613192d7-503f-477a-9cfe-4efc3ee2bd60"; - const asyncOperationId = "713192d7-503f-477a-9cfe-4efc3ee2bd11"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopeOperationStatus.get( - asyncOperationId, - resourceGroupName - ); - console.log(result); -} - -async function main() { - getSpecificOperationStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesCreateOrUpdateSample.ts deleted file mode 100644 index c0e06fc98bfb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesCreateOrUpdateSample.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. -import { ScopedResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. - * - * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceUpdate.json - */ -async function updateAScopedResourceInAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const parameters: ScopedResource = { - linkedResourceId: - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/my-component" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - name, - parameters - ); - console.log(result); -} - -async function main() { - updateAScopedResourceInAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesDeleteSample.ts deleted file mode 100644 index da8128cf28d5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a private endpoint connection with a given name. - * - * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceDelete.json - */ -async function deletesAScopedResourceWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.beginDeleteAndWait( - resourceGroupName, - scopeName, - name - ); - console.log(result); -} - -async function main() { - deletesAScopedResourceWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesGetSample.ts deleted file mode 100644 index 248dc344aea7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a scoped resource in a private link scope. - * - * @summary Gets a scoped resource in a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceGet.json - */ -async function getsPrivateLinkScopedResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.get( - resourceGroupName, - scopeName, - name - ); - console.log(result); -} - -async function main() { - getsPrivateLinkScopedResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts deleted file mode 100644 index 2157e3c141ff..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets all private endpoint connections on a private link scope. - * - * @summary Gets all private endpoint connections on a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceList.json - */ -async function getsListOfScopedResourcesInAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopedResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsListOfScopedResourcesInAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts deleted file mode 100644 index 484867612812..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AzureMonitorPrivateLinkScope, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * - * @summary Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesCreate.json - */ -async function privateLinkScopeCreate() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope = { - accessModeSettings: { - exclusions: [], - ingestionAccessMode: "Open", - queryAccessMode: "Open" - }, - location: "Global" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.createOrUpdate( - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * - * @summary Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdate.json - */ -async function privateLinkScopeUpdate() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope = { - accessModeSettings: { - exclusions: [], - ingestionAccessMode: "Open", - queryAccessMode: "Open" - }, - location: "Global", - tags: { tag1: "Value1" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.createOrUpdate( - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload - ); - console.log(result); -} - -async function main() { - privateLinkScopeCreate(); - privateLinkScopeUpdate(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesDeleteSample.ts deleted file mode 100644 index 72fa958e3561..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a Azure Monitor PrivateLinkScope. - * - * @summary Deletes a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesDelete.json - */ -async function privateLinkScopesDelete() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.beginDeleteAndWait( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - privateLinkScopesDelete(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesGetSample.ts deleted file mode 100644 index bc31e306902a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns a Azure Monitor PrivateLinkScope. - * - * @summary Returns a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesGet.json - */ -async function privateLinkScopeGet() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.get( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - privateLinkScopeGet(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListByResourceGroupSample.ts deleted file mode 100644 index e5c093f8e3de..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @summary Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesListByResourceGroup.json - */ -async function privateLinkScopeListByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopes.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateLinkScopeListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListSample.ts deleted file mode 100644 index 47d4083d2f79..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @summary Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesList.json - */ -async function privateLinkScopesListJson() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopes.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateLinkScopesListJson(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesUpdateTagsSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesUpdateTagsSample.ts deleted file mode 100644 index d6956ec9e02c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesUpdateTagsSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { TagsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json - */ -async function privateLinkScopeUpdateTagsOnly() { - const subscriptionId = process.env["MONITOR_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const privateLinkScopeTags: TagsResource = { - tags: { tag1: "Value1", tag2: "Value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.updateTags( - resourceGroupName, - scopeName, - privateLinkScopeTags - ); - console.log(result); -} - -async function main() { - privateLinkScopeUpdateTagsOnly(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesCreateOrUpdateSample.ts deleted file mode 100644 index c22ab70cb00b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ScheduledQueryRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const parameters: ScheduledQueryRuleResource = { - description: "Performance rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" - ], - customProperties: { key11: "value11", key12: "value12" } - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [ - { - name: "ComputerIp", - operator: "Exclude", - values: ["192.168.1.1"] - }, - { name: "OSType", operator: "Include", values: ["*"] } - ], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1 - }, - metricMeasureColumn: "% Processor Time", - operator: "GreaterThan", - query: 'Perf | where ObjectName == "Processor"', - resourceIdColumn: "resourceId", - threshold: 70, - timeAggregation: "Average" - } - ] - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: [ - "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1" - ], - severity: 4, - skipQueryValidation: true, - windowSize: "PT10M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleResourceGroup.json - */ -async function createOrUpdateAScheduledQueryRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const parameters: ScheduledQueryRuleResource = { - description: "Health check rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" - ], - customProperties: { key11: "value11", key12: "value12" } - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1 - }, - operator: "GreaterThan", - query: "Heartbeat", - threshold: 360, - timeAggregation: "Count" - } - ] - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: [ - "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1" - ], - severity: 4, - skipQueryValidation: true, - targetResourceTypes: ["Microsoft.Compute/virtualMachines"], - windowSize: "PT10M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleSubscription.json - */ -async function createOrUpdateAScheduledQueryRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const parameters: ScheduledQueryRuleResource = { - description: "Performance rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" - ], - customProperties: { key11: "value11", key12: "value12" } - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [ - { - name: "ComputerIp", - operator: "Exclude", - values: ["192.168.1.1"] - }, - { name: "OSType", operator: "Include", values: ["*"] } - ], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1 - }, - metricMeasureColumn: "% Processor Time", - operator: "GreaterThan", - query: 'Perf | where ObjectName == "Processor"', - resourceIdColumn: "resourceId", - threshold: 70, - timeAggregation: "Average" - } - ] - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: ["/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"], - severity: 4, - skipQueryValidation: true, - targetResourceTypes: ["Microsoft.Compute/virtualMachines"], - windowSize: "PT10M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAScheduledQueryRuleForSingleResource(); - createOrUpdateAScheduledQueryRuleOnResourceGroupS(); - createOrUpdateAScheduledQueryRuleOnSubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesDeleteSample.ts deleted file mode 100644 index 9e34f0b8d669..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a scheduled query rule. - * - * @summary Deletes a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/deleteScheduledQueryRule.json - */ -async function deleteAScheduledQueryRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.delete( - resourceGroupName, - ruleName - ); - console.log(result); -} - -async function main() { - deleteAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesGetSample.ts deleted file mode 100644 index e77734253abe..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an scheduled query rule definition. - * - * @summary Retrieve an scheduled query rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/getScheduledQueryRule.json - */ -async function getAScheduledQueryRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.get( - resourceGroupName, - ruleName - ); - console.log(result); -} - -async function main() { - getAScheduledQueryRuleForSingleResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListByResourceGroupSample.ts deleted file mode 100644 index f474165d969b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve scheduled query rule definitions in a resource group. - * - * @summary Retrieve scheduled query rule definitions in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesByResourceGroup.json - */ -async function listScheduledQueryRulesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.scheduledQueryRules.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listScheduledQueryRulesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListBySubscriptionSample.ts deleted file mode 100644 index ec1cce5bfe7b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve a scheduled query rule definitions in a subscription. - * - * @summary Retrieve a scheduled query rule definitions in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesBySubscription.json - */ -async function listScheduledQueryRulesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.scheduledQueryRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listScheduledQueryRulesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesUpdateSample.ts deleted file mode 100644 index ccadc3a95389..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesUpdateSample.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. -import { - ScheduledQueryRuleResourcePatch, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a scheduled query rule. - * - * @summary Update a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/patchScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const parameters: ScheduledQueryRuleResourcePatch = { enabled: false }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.update( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActivityLogsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActivityLogsListSample.ts deleted file mode 100644 index 519961fabae5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActivityLogsListSample.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TenantActivityLogsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json - */ -async function getTenantActivityLogsWithFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const options: TenantActivityLogsListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFilteredAndSelected.json - */ -async function getTenantActivityLogsWithFilterAndSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: TenantActivityLogsListOptionalParams = { filter, select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsSelected.json - */ -async function getTenantActivityLogsWithSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: TenantActivityLogsListOptionalParams = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsNoParams.json - */ -async function getTenantActivityLogsWithoutFilterOrSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getTenantActivityLogsWithFilter(); - getTenantActivityLogsWithFilterAndSelect(); - getTenantActivityLogsWithSelect(); - getTenantActivityLogsWithoutFilterOrSelect(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/vmInsightsGetOnboardingStatusSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/vmInsightsGetOnboardingStatusSample.ts deleted file mode 100644 index 96e4892e9ecc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/vmInsightsGetOnboardingStatusSample.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json - */ -async function getStatusForAVMScaleSetThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVMUnknown.json - */ -async function getStatusForAVMThatHasNotYetReportedData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVM.json - */ -async function getStatusForAVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusResourceGroup.json - */ -async function getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSubscription.json - */ -async function getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -async function main() { - getStatusForAVMScaleSetThatIsActivelyReportingData(); - getStatusForAVMThatHasNotYetReportedData(); - getStatusForAVMThatIsActivelyReportingData(); - getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData(); - getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/tsconfig.json b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/tsconfig.json deleted file mode 100644 index e26ce2a6d8f7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/monitor/arm-monitor/src/models/index.ts b/sdk/monitor/arm-monitor/src/models/index.ts index dc51201fb334..c31b255f050e 100644 --- a/sdk/monitor/arm-monitor/src/models/index.ts +++ b/sdk/monitor/arm-monitor/src/models/index.ts @@ -28,6 +28,278 @@ export type MultiMetricCriteriaUnion = | MetricCriteria | DynamicMetricCriteria; +/** A pageable list of resources */ +export interface AzureMonitorWorkspaceResourceListResult { + /** A list of resources */ + value: AzureMonitorWorkspaceResource[]; + /** The URL to use for getting the next set of results */ + nextLink?: string; +} + +/** Properties of an Azure Monitor workspace */ +export interface AzureMonitorWorkspace { + /** + * The immutable ID of the Azure Monitor workspace. This property is read-only. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountId?: string; + /** + * Information about metrics for the Azure Monitor workspace + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metrics?: AzureMonitorWorkspaceMetrics; + /** + * The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * The Data Collection Rule and Endpoint used for ingestion by default. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; + /** + * List of private endpoint connections + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** + * Gets or sets allow or disallow public network access to workspace + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publicNetworkAccess?: PublicNetworkAccess; +} + +/** Information about metrics for the workspace */ +export interface Metrics { + /** + * The Prometheus query endpoint for the workspace + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly prometheusQueryEndpoint?: string; + /** + * An internal identifier for the metrics container. Only to be used by the system + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly internalId?: string; +} + +/** Settings for data ingestion */ +export interface IngestionSettings { + /** + * The Azure resource Id of the default data collection rule for this workspace. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dataCollectionRuleResourceId?: string; + /** + * The Azure resource Id of the default data collection endpoint for this workspace. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dataCollectionEndpointResourceId?: string; +} + +/** The private endpoint resource. */ +export interface PrivateEndpoint { + /** + * The ARM identifier for private endpoint. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; +} + +/** A collection of information about the state of the connection between service consumer and provider. */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface ResourceAutoGenerated { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** Definition of ARM tracked top level resource properties for update operation */ +export interface AzureMonitorWorkspaceResourceForUpdate { + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + /** Represents a collection of autoscale setting resources. */ export interface AutoscaleSettingResourceCollection { /** the values for the autoscale setting resources. */ @@ -185,7 +457,7 @@ export interface PredictiveAutoscalePolicy { } /** The autoscale setting resource. */ -export interface Resource { +export interface ResourceAutoGenerated2 { /** * Azure resource Id * NOTE: This property will not be serialized. It can only be populated by the server. @@ -212,22 +484,6 @@ export interface Resource { readonly systemData?: SystemData; } -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - /** Describes the format of Error response. */ export interface AutoscaleErrorResponse { /** The error object. */ @@ -294,23 +550,23 @@ export interface PredictiveValue { } /** Result of the request to list Microsoft.Insights operations. It contains a list of operations and a URL link to get the next set of results. */ -export interface OperationListResult { +export interface OperationListResultAutoGenerated { /** List of operations supported by the Microsoft.Insights provider. */ - value?: Operation[]; + value?: OperationAutoGenerated[]; /** URL to get the next set of operation list results if there are any. */ nextLink?: string; } /** Microsoft Insights API operation definition. */ -export interface Operation { +export interface OperationAutoGenerated { /** Operation name: {provider}/{resource}/{operation} */ name?: string; /** Display metadata associated with the operation. */ - display?: OperationDisplay; + display?: OperationDisplayAutoGenerated; } /** Display metadata associated with the operation. */ -export interface OperationDisplay { +export interface OperationDisplayAutoGenerated { /** Service provider: Microsoft.Insights */ provider?: string; /** Resource on which the operation is performed: AlertRules, Autoscale, etc. */ @@ -349,7 +605,7 @@ export interface Incident { } /** Describes the format of Error response. */ -export interface ErrorResponse { +export interface ErrorResponseAutoGenerated { /** Error code */ code?: string; /** Error message indicating why the operation failed. */ @@ -398,7 +654,7 @@ export interface RuleAction { } /** An azure resource object */ -export interface ResourceAutoGenerated { +export interface ResourceAutoGenerated3 { /** * Azure resource Id * NOTE: This property will not be serialized. It can only be populated by the server. @@ -460,7 +716,7 @@ export interface RetentionPolicy { } /** An azure resource object */ -export interface ResourceAutoGenerated2 { +export interface ResourceAutoGenerated4 { /** * Azure resource Id * NOTE: This property will not be serialized. It can only be populated by the server. @@ -529,7 +785,7 @@ export interface LogSettings { } /** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface ResourceAutoGenerated3 { +export interface ResourceAutoGenerated5 { /** * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} * NOTE: This property will not be serialized. It can only be populated by the server. @@ -820,6 +1076,88 @@ export interface EnableRequest { receiverName: string; } +/** An email receiver. */ +export interface EmailReceiverAutoGenerated { + /** The name of the email receiver. Names must be unique across all receivers within a tenant action group. */ + name: string; + /** The email address of this receiver. */ + emailAddress: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; + /** + * The receiver status of the e-mail. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: ReceiverStatus; +} + +/** An SMS receiver. */ +export interface SmsReceiverAutoGenerated { + /** The name of the SMS receiver. Names must be unique across all receivers within a tenant action group. */ + name: string; + /** The country code of the SMS receiver. */ + countryCode: string; + /** The phone number of the SMS receiver. */ + phoneNumber: string; + /** + * The status of the receiver. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: ReceiverStatus; +} + +/** A webhook receiver. */ +export interface WebhookReceiverAutoGenerated { + /** The name of the webhook receiver. Names must be unique across all receivers within a tenant action group. */ + name: string; + /** The URI where webhooks should be sent. */ + serviceUri: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; + /** Indicates whether or not use AAD authentication. */ + useAadAuth?: boolean; + /** Indicates the webhook app object Id for aad auth. */ + objectId?: string; + /** Indicates the identifier uri for aad auth. */ + identifierUri?: string; + /** Indicates the tenant id for aad auth. */ + tenantId?: string; +} + +/** The Azure mobile App push notification receiver. */ +export interface AzureAppPushReceiverAutoGenerated { + /** The name of the Azure mobile app push receiver. Names must be unique across all receivers within a tenant action group. */ + name: string; + /** The email address registered for the Azure mobile app. */ + emailAddress: string; +} + +/** A voice receiver. */ +export interface VoiceReceiverAutoGenerated { + /** The name of the voice receiver. Names must be unique across all receivers within a tenant action group. */ + name: string; + /** The country code of the voice receiver. */ + countryCode: string; + /** The phone number of the voice receiver. */ + phoneNumber: string; +} + +/** A tenant action group object for the body of patch operations. */ +export interface ActionGroupPatchBodyAutoGenerated { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** Indicates whether this tenant action group is enabled. If a tenant action group is not enabled, then none of its actions will be activated. */ + enabled?: boolean; +} + +/** A list of tenant action groups. */ +export interface TenantActionGroupList { + /** The list of tenant action groups. */ + value?: TenantActionGroupResource[]; + /** Provides the link to retrieve the next set of elements. */ + nextLink?: string; +} + /** Represents collection of events. */ export interface EventDataCollection { /** this list that includes the Azure audit logs. */ @@ -970,22 +1308,72 @@ export interface LocalizableString { localizedValue?: string; } -/** The Http request info. */ -export interface HttpRequestInfo { - /** the client request id. */ - clientRequestId?: string; - /** the client Ip Address */ - clientIpAddress?: string; - /** the Http request method. */ - method?: string; - /** the Uri. */ - uri?: string; +/** The Http request info. */ +export interface HttpRequestInfo { + /** the client request id. */ + clientRequestId?: string; + /** the client Ip Address */ + clientIpAddress?: string; + /** the Http request method. */ + method?: string; + /** the Uri. */ + uri?: string; +} + +/** A collection of event categories. Currently possible values are: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. */ +export interface EventCategoryCollection { + /** the list that includes the Azure event categories. */ + value: LocalizableString[]; +} + +/** Represents collection of metric definitions. */ +export interface SubscriptionScopeMetricDefinitionCollection { + /** The values for the metric definitions. */ + value: SubscriptionScopeMetricDefinition[]; +} + +/** Metric definition class specifies the metadata for a metric. */ +export interface SubscriptionScopeMetricDefinition { + /** Flag to indicate whether the dimension is required. */ + isDimensionRequired?: boolean; + /** the resource identifier of the resource that emitted the metric. */ + resourceId?: string; + /** the namespace the metric belongs to. */ + namespace?: string; + /** the name and the display name of the metric, i.e. it is a localizable string. */ + name?: LocalizableString; + /** Detailed description of this metric. */ + displayDescription?: string; + /** Custom category name for this metric. */ + category?: string; + /** The class of the metric. */ + metricClass?: MetricClass; + /** the unit of the metric. */ + unit?: MetricUnit; + /** the primary aggregation type value defining how to use the values for display. */ + primaryAggregationType?: MetricAggregationType; + /** the collection of what aggregation types are supported. */ + supportedAggregationTypes?: MetricAggregationType[]; + /** the collection of what aggregation intervals are available to be queried. */ + metricAvailabilities?: MetricAvailability[]; + /** the resource identifier of the metric definition. */ + id?: string; + /** the name and the display name of the dimension, i.e. it is a localizable string. */ + dimensions?: LocalizableString[]; +} + +/** Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time grain. */ +export interface MetricAvailability { + /** the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc. */ + timeGrain?: string; + /** the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc. */ + retention?: string; } -/** A collection of event categories. Currently possible values are: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. */ -export interface EventCategoryCollection { - /** the list that includes the Azure event categories. */ - value: LocalizableString[]; +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */ +export interface ErrorContract { + /** The error object. */ + error?: ErrorResponseAutoGenerated; } /** Represents collection of metric definitions. */ @@ -1010,7 +1398,7 @@ export interface MetricDefinition { category?: string; /** The class of the metric. */ metricClass?: MetricClass; - /** The unit of the metric. */ + /** the unit of the metric. */ unit?: MetricUnit; /** the primary aggregation type value defining how to use the values for display. */ primaryAggregationType?: AggregationType; @@ -1024,16 +1412,8 @@ export interface MetricDefinition { dimensions?: LocalizableString[]; } -/** Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time grain. */ -export interface MetricAvailability { - /** the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc. */ - timeGrain?: string; - /** the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc. */ - retention?: string; -} - -/** The response to a metrics query. */ -export interface Response { +/** The response to a subscription scope metrics query. */ +export interface SubscriptionScopeMetricResponse { /** The integer value representing the relative cost of the query. */ cost?: number; /** The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested. */ @@ -1045,11 +1425,11 @@ export interface Response { /** The region of the resource being queried for metrics. */ resourceregion?: string; /** the value of the collection. */ - value: Metric[]; + value: SubscriptionScopeMetric[]; } /** The result data of a query. */ -export interface Metric { +export interface SubscriptionScopeMetric { /** the metric Id. */ id: string; /** the resource type of the metric resource. */ @@ -1100,6 +1480,81 @@ export interface MetricValue { count?: number; } +/** Query parameters can also be specified in the body, specifying the same parameter in both the body and query parameters will result in an error. */ +export interface SubscriptionScopeMetricsRequestBodyParameters { + /** + * The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. + * This value should be an ISO-8601 formatted string representing time. E.g. "HH:MM:SS" or "HH:MM:SS.mm". + */ + timespan?: string; + /** The interval (i.e. timegrain) of the query. */ + interval?: string; + /** The names of the metrics (comma separated) to retrieve. */ + metricNames?: string; + /** The list of aggregation types (comma separated) to retrieve. */ + aggregation?: string; + /** The **$filter** is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
This is invalid because the logical or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. */ + filter?: string; + /** + * The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + */ + top?: number; + /** + * The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + */ + orderBy?: string; + /** Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. */ + rollUpBy?: string; + /** Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. */ + resultType?: MetricResultType; + /** Metric namespace where the metrics you want reside. */ + metricNamespace?: string; + /** When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. Defaults to false. */ + autoAdjustTimegrain?: boolean; + /** When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid filter parameters. Defaults to true. */ + validateDimensions?: boolean; +} + +/** The response to a metrics query. */ +export interface Response { + /** The integer value representing the relative cost of the query. */ + cost?: number; + /** The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested. */ + timespan: string; + /** The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made. */ + interval?: string; + /** The namespace of the metrics being queried */ + namespace?: string; + /** The region of the resource being queried for metrics. */ + resourceregion?: string; + /** the value of the collection. */ + value: Metric[]; +} + +/** The result data of a query. */ +export interface Metric { + /** the metric Id. */ + id: string; + /** the resource type of the metric resource. */ + type: string; + /** the name and the display name of the metric, i.e. it is localizable string. */ + name: LocalizableString; + /** Detailed description of this metric. */ + displayDescription?: string; + /** 'Success' or the error details on query failures for this metric. */ + errorCode?: string; + /** Error message encountered querying this specific metric. */ + errorMessage?: string; + /** The unit of the metric. */ + unit: Unit; + /** the time series returned when a data query is performed. */ + timeseries: TimeSeriesElement[]; +} + /** A list of metric baselines. */ export interface MetricBaselinesResponse { /** The list of metric baselines. */ @@ -1190,7 +1645,7 @@ export interface MetricAlertAction { } /** An azure resource object */ -export interface ResourceAutoGenerated4 { +export interface ResourceAutoGenerated6 { /** * Azure resource Id * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1470,7 +1925,7 @@ export interface RuleResolveConfiguration { } /** Describes the format of Error response. */ -export interface ErrorContract { +export interface ErrorContractAutoGenerated { /** The error details. */ error?: ErrorResponseDetails; } @@ -1659,7 +2114,7 @@ export interface AzureMonitorPrivateLinkScopeListResult { } /** The Private Endpoint resource. */ -export interface PrivateEndpoint { +export interface PrivateEndpointAutoGenerated { /** * The ARM identifier for Private Endpoint * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1667,16 +2122,6 @@ export interface PrivateEndpoint { readonly id?: string; } -/** A collection of information about the state of the connection between service consumer and provider. */ -export interface PrivateLinkServiceConnectionState { - /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - status?: PrivateEndpointServiceConnectionStatus; - /** The reason for approval/rejection of the connection. */ - description?: string; - /** A message indicating if changes on the service provider require any updates on the consumer. */ - actionsRequired?: string; -} - /** Properties that define the scope private link mode settings. */ export interface AccessModeSettings { /** Specifies the default access mode of queries through associated private endpoints in scope. If not specified default value is 'Open'. You can override this default setting for a specific private endpoint connection by adding an exclusion in the 'exclusions' array. */ @@ -1700,11 +2145,11 @@ export interface AccessModeSettingsExclusion { /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ export interface DefaultErrorResponse { /** The error object. */ - error?: ErrorDetail; + error?: ErrorDetailAutoGenerated; } /** The error detail. */ -export interface ErrorDetail { +export interface ErrorDetailAutoGenerated { /** * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1724,7 +2169,7 @@ export interface ErrorDetail { * The error details. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ErrorDetail[]; + readonly details?: ErrorDetailAutoGenerated[]; /** * The error additional info. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1732,20 +2177,6 @@ export interface ErrorDetail { readonly additionalInfo?: ErrorAdditionalInfo[]; } -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - /** A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance. */ export interface TagsResource { /** Resource tags */ @@ -1765,7 +2196,7 @@ export interface OperationStatus { /** The status of the operation. */ status?: string; /** The error detail of the operation if any. */ - error?: ErrorDetail; + error?: ErrorDetailAutoGenerated; } /** A list of private link resources */ @@ -1777,7 +2208,7 @@ export interface PrivateLinkResourceListResult { /** List of private endpoint connection associated with the specified storage account */ export interface PrivateEndpointConnectionListResult { /** Array of private endpoint connections */ - value?: PrivateEndpointConnection[]; + value?: PrivateEndpointConnectionAutoGenerated[]; } /** A list of scoped resources in a private link scope. */ @@ -1854,7 +2285,7 @@ export interface AzureResourceAutoGenerated { } /** The error response. */ -export interface ErrorResponseAutoGenerated { +export interface ErrorResponseAutoGenerated2 { /** * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1899,6 +2330,8 @@ export interface DataCollectionEndpointResource { tags?: { [propertyName: string]: string }; /** The kind of the resource. */ kind?: KnownDataCollectionEndpointResourceKind; + /** Managed service identity of the resource. */ + identity?: DataCollectionEndpointResourceIdentity; /** * Fully qualified ID of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1932,6 +2365,8 @@ export interface DataCollectionEndpointResource { configurationAccess?: DataCollectionEndpointConfigurationAccess; /** The endpoint used by clients to ingest logs. */ logsIngestion?: DataCollectionEndpointLogsIngestion; + /** The endpoint used by clients to ingest metrics. */ + metricsIngestion?: DataCollectionEndpointMetricsIngestion; /** Network access control rules for the endpoints. */ networkAcls?: DataCollectionEndpointNetworkAcls; /** @@ -1939,6 +2374,21 @@ export interface DataCollectionEndpointResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: KnownDataCollectionEndpointProvisioningState; + /** + * List of Azure Monitor Private Link Scope Resources to which this data collection endpoint resource is associated. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateLinkScopedResources?: PrivateLinkScopedResource[]; + /** + * Failover configuration on this endpoint. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly failoverConfiguration?: DataCollectionEndpointFailoverConfiguration; + /** + * Metadata for the resource. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metadata?: DataCollectionEndpointMetadata; } /** Definition of data collection endpoint. */ @@ -1951,6 +2401,8 @@ export interface DataCollectionEndpoint { configurationAccess?: DataCollectionEndpointConfigurationAccess; /** The endpoint used by clients to ingest logs. */ logsIngestion?: DataCollectionEndpointLogsIngestion; + /** The endpoint used by clients to ingest metrics. */ + metricsIngestion?: DataCollectionEndpointMetricsIngestion; /** Network access control rules for the endpoints. */ networkAcls?: DataCollectionEndpointNetworkAcls; /** @@ -1958,6 +2410,21 @@ export interface DataCollectionEndpoint { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: KnownDataCollectionEndpointProvisioningState; + /** + * List of Azure Monitor Private Link Scope Resources to which this data collection endpoint resource is associated. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateLinkScopedResources?: PrivateLinkScopedResource[]; + /** + * Failover configuration on this endpoint. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly failoverConfiguration?: DataCollectionEndpointFailoverConfiguration; + /** + * Metadata for the resource. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metadata?: DataCollectionEndpointMetadata; } /** Definition of the endpoint used for accessing configuration. */ @@ -1978,22 +2445,102 @@ export interface LogsIngestionEndpointSpec { readonly endpoint?: string; } +/** Definition of the endpoint used for ingesting metrics. */ +export interface MetricsIngestionEndpointSpec { + /** + * The endpoint. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endpoint?: string; +} + /** Definition of the network rules. */ export interface NetworkRuleSet { /** The configuration to set whether network access from public internet to the endpoints are allowed. */ publicNetworkAccess?: KnownPublicNetworkAccessOptions; } +export interface PrivateLinkScopedResource { + /** The resourceId of the Azure Monitor Private Link Scope Scoped Resource through which this DCE is associated with a Azure Monitor Private Link Scope. */ + resourceId?: string; + /** The immutableId of the Azure Monitor Private Link Scope Resource to which the association is. */ + scopeId?: string; +} + +export interface FailoverConfigurationSpec { + /** Active location where data flow will occur. */ + activeLocation?: string; + /** Locations that are configured for failover. */ + locations?: LocationSpec[]; +} + +export interface LocationSpec { + /** Name of location. */ + location?: string; + /** The resource provisioning state in this location. */ + provisioningStatus?: KnownLocationSpecProvisioningStatus; +} + +/** Metadata about the resource */ +export interface Metadata { + /** + * Azure offering managing this resource on-behalf-of customer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisionedBy?: string; + /** + * Resource Id of azure offering managing this resource on-behalf-of customer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisionedByResourceId?: string; +} + +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ + type: ManagedServiceIdentityType; + /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity | null; + }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** + * The principal ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ export interface ErrorResponseCommonV2 { /** The error object. */ - error?: ErrorDetail; + error?: ErrorDetailAutoGenerated; } /** Definition of ARM tracked top level resource properties for update operation. */ export interface ResourceForUpdate { /** Resource tags. */ tags?: { [propertyName: string]: string }; + /** Managed Service Identity. */ + identity?: ResourceForUpdateIdentity; } /** A pageable list of resources. */ @@ -2069,15 +2616,6 @@ export interface DataCollectionRuleAssociation { readonly metadata?: DataCollectionRuleAssociationMetadata; } -/** Metadata about the resource */ -export interface Metadata { - /** - * Azure offering managing this resource on-behalf-of customer. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisionedBy?: string; -} - /** A pageable list of resources. */ export interface DataCollectionRuleResourceListResult { /** A list of resources. */ @@ -2094,6 +2632,8 @@ export interface DataCollectionRuleResource { tags?: { [propertyName: string]: string }; /** The kind of the resource. */ kind?: KnownDataCollectionRuleResourceKind; + /** Managed service identity of the resource. */ + identity?: DataCollectionRuleResourceIdentity; /** * Fully qualified ID of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2213,6 +2753,14 @@ export interface DataSourcesSpec { logFiles?: LogFilesDataSource[]; /** The list of IIS logs source configurations. */ iisLogs?: IisLogsDataSource[]; + /** The list of Windows Firewall logs source configurations. */ + windowsFirewallLogs?: WindowsFirewallLogsDataSource[]; + /** The list of Prometheus forwarder data source configurations. */ + prometheusForwarder?: PrometheusForwarderDataSource[]; + /** The list of platform telemetry configurations */ + platformTelemetry?: PlatformTelemetryDataSource[]; + /** Specifications of pull based data sources */ + dataImports?: DataSourcesSpecDataImports; } /** @@ -2323,37 +2871,105 @@ export interface LogFilesDataSource { name?: string; } -/** Settings for different log file formats */ -export interface LogFileSettings { - /** Text settings */ - text?: LogFileSettingsText; +/** Settings for different log file formats */ +export interface LogFileSettings { + /** Text settings */ + text?: LogFileSettingsText; +} + +/** Settings for text log files */ +export interface LogFileTextSettings { + /** One of the supported timestamp formats */ + recordStartTimestampFormat: KnownLogFileTextSettingsRecordStartTimestampFormat; +} + +/** Enables IIS logs to be collected by this data collection rule. */ +export interface IisLogsDataSource { + /** IIS streams */ + streams: string[]; + /** Absolute paths file location */ + logDirectories?: string[]; + /** + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + name?: string; +} + +/** Enables Firewall logs to be collected by this data collection rule. */ +export interface WindowsFirewallLogsDataSource { + /** Firewall logs streams */ + streams: string[]; + /** + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + name?: string; +} + +/** Definition of Prometheus metrics forwarding configuration. */ +export interface PrometheusForwarderDataSource { + /** List of streams that this data source will be sent to. */ + streams?: KnownPrometheusForwarderDataSourceStreams[]; + /** + * The list of label inclusion filters in the form of label "name-value" pairs. + * Currently only one label is supported: 'microsoft_metrics_include_label'. + * Label values are matched case-insensitively. + */ + labelIncludeFilter?: { [propertyName: string]: string }; + /** + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + name?: string; +} + +/** Definition of platform telemetry data source configuration */ +export interface PlatformTelemetryDataSource { + /** List of platform telemetry streams to collect */ + streams: string[]; + /** + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + name?: string; } -/** Settings for text log files */ -export interface LogFileTextSettings { - /** One of the supported timestamp formats */ - recordStartTimestampFormat: KnownLogFileTextSettingsRecordStartTimestampFormat; +export interface DataImportSources { + /** Definition of Event Hub configuration. */ + eventHub?: DataImportSourcesEventHub; } -/** Enables IIS logs to be collected by this data collection rule. */ -export interface IisLogsDataSource { - /** IIS streams */ - streams: string[]; - /** Absolute paths file location */ - logDirectories?: string[]; +export interface EventHubDataSource { /** * A friendly name for the data source. * This name should be unique across all data sources (regardless of type) within the data collection rule. */ name?: string; + /** Event Hub consumer group name */ + consumerGroup?: string; + /** The stream to collect from EventHub */ + stream?: string; } /** Specification of destinations that can be used in data flows. */ export interface DestinationsSpec { /** List of Log Analytics destinations. */ logAnalytics?: LogAnalyticsDestination[]; + /** List of monitoring account destinations. */ + monitoringAccounts?: MonitoringAccountDestination[]; /** Azure Monitor Metrics destination. */ azureMonitorMetrics?: DestinationsSpecAzureMonitorMetrics; + /** List of Event Hubs destinations. */ + eventHubs?: EventHubDestination[]; + /** List of Event Hubs Direct destinations. */ + eventHubsDirect?: EventHubDirectDestination[]; + /** List of Storage Blob Direct destinations. To be used only for sending data directly to store from the agent. */ + storageBlobsDirect?: StorageBlobDestination[]; + /** List of Storage Table Direct destinations. */ + storageTablesDirect?: StorageTableDestination[]; + /** List of storage accounts destinations. */ + storageAccounts?: StorageBlobDestination[]; } /** Log Analytics destination. */ @@ -2372,214 +2988,87 @@ export interface LogAnalyticsDestination { name?: string; } -/** Azure Monitor Metrics destination. */ -export interface AzureMonitorMetricsDestination { - /** - * A friendly name for the destination. - * This name should be unique across all destinations (regardless of type) within the data collection rule. - */ - name?: string; -} - -/** Definition of which streams are sent to which destinations. */ -export interface DataFlow { - /** List of streams for this data flow. */ - streams?: KnownDataFlowStreams[]; - /** List of destinations for this data flow. */ - destinations?: string[]; - /** The KQL query to transform stream data. */ - transformKql?: string; - /** The output stream of the transform. Only required if the transform changes data to a different stream. */ - outputStream?: string; -} - -/** A pageable list of resources */ -export interface AzureMonitorWorkspaceResourceListResult { - /** A list of resources */ - value: AzureMonitorWorkspaceResource[]; - /** The URL to use for getting the next set of results */ - nextLink?: string; -} - -/** Properties of an Azure Monitor workspace */ -export interface AzureMonitorWorkspace { +/** Monitoring account destination. */ +export interface MonitoringAccountDestination { + /** The resource ID of the monitoring account. */ + accountResourceId?: string; /** - * The immutable ID of the Azure Monitor workspace. This property is read-only. + * The immutable ID of the account. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly accountId?: string; /** - * Information about metrics for the Azure Monitor workspace - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metrics?: AzureMonitorWorkspaceMetrics; - /** - * The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; - /** - * The Data Collection Rule and Endpoint used for ingestion by default. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; -} - -/** Information about metrics for the workspace */ -export interface Metrics { - /** - * The Prometheus query endpoint for the workspace - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly prometheusQueryEndpoint?: string; - /** - * An internal identifier for the metrics container. Only to be used by the system - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly internalId?: string; + name?: string; } -/** Settings for data ingestion */ -export interface IngestionSettings { - /** - * The Azure resource Id of the default data collection rule for this workspace. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly dataCollectionRuleResourceId?: string; +/** Azure Monitor Metrics destination. */ +export interface AzureMonitorMetricsDestination { /** - * The Azure resource Id of the default data collection endpoint for this workspace. - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly dataCollectionEndpointResourceId?: string; + name?: string; } -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface ResourceAutoGenerated5 { - /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; +export interface EventHubDestination { + /** The resource ID of the event hub. */ + eventHubResourceId?: string; /** - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly systemData?: SystemData; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponseAutoGenerated2 { - /** The error object. */ - error?: ErrorDetailAutoGenerated; + name?: string; } -/** The error detail. */ -export interface ErrorDetailAutoGenerated { +export interface EventHubDirectDestination { + /** The resource ID of the event hub. */ + eventHubResourceId?: string; /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetailAutoGenerated[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** Definition of ARM tracked top level resource properties for update operation */ -export interface AzureMonitorWorkspaceResourceForUpdate { - /** Resource tags */ - tags?: { [propertyName: string]: string }; + name?: string; } -/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ -export interface OperationListResultAutoGenerated { - /** - * List of operations supported by the resource provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: OperationAutoGenerated[]; +export interface StorageBlobDestination { + /** The container name of the Storage Blob. */ + containerName?: string; + /** The resource ID of the storage account. */ + storageAccountResourceId?: string; /** - * URL to get the next set of operation list results (if there are any). - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly nextLink?: string; + name?: string; } -/** Details of a REST API operation, returned from the Resource Provider Operations API */ -export interface OperationAutoGenerated { - /** - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDataAction?: boolean; - /** Localized display information for this particular operation. */ - display?: OperationDisplayAutoGenerated; - /** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly origin?: Origin; +export interface StorageTableDestination { + /** The name of the Storage Table. */ + tableName?: string; + /** The resource ID of the storage account. */ + storageAccountResourceId?: string; /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly actionType?: ActionType; + name?: string; } -/** Localized display information for this particular operation. */ -export interface OperationDisplayAutoGenerated { - /** - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provider?: string; - /** - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resource?: string; - /** - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operation?: string; - /** - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; +/** Definition of which streams are sent to which destinations. */ +export interface DataFlow { + /** List of streams for this data flow. */ + streams?: KnownDataFlowStreams[]; + /** List of destinations for this data flow. */ + destinations?: string[]; + /** The KQL query to transform stream data. */ + transformKql?: string; + /** The output stream of the transform. Only required if the transform changes data to a different stream. */ + outputStream?: string; + /** The builtIn transform to transform stream data */ + builtInTransform?: string; } /** The claims for a rule management event data source. */ @@ -2636,8 +3125,52 @@ export interface DynamicThresholdFailingPeriods { minFailingPeriodsToAlert: number; } +/** Resource properties */ +export interface AzureMonitorWorkspaceResourceProperties + extends AzureMonitorWorkspace {} + +/** Information about metrics for the Azure Monitor workspace */ +export interface AzureMonitorWorkspaceMetrics extends Metrics {} + +/** The Data Collection Rule and Endpoint used for ingestion by default. */ +export interface AzureMonitorWorkspaceDefaultIngestionSettings + extends IngestionSettings {} + +/** The private endpoint connection resource. */ +export interface PrivateEndpointConnection extends Resource { + /** + * The group ids for the private endpoint resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupIds?: string[]; + /** The private endpoint resource. */ + privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + /** The provisioning state of the private endpoint connection resource. */ + provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface DataCollectionEndpointResourceSystemData extends SystemData {} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface DataCollectionRuleAssociationProxyOnlyResourceSystemData + extends SystemData {} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface DataCollectionRuleResourceSystemData extends SystemData {} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends ResourceAutoGenerated { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + /** The autoscale setting resource. */ -export interface AutoscaleSettingResource extends Resource { +export interface AutoscaleSettingResource extends ResourceAutoGenerated2 { /** the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. */ profiles: AutoscaleProfile[]; /** the collection of notifications. */ @@ -2654,16 +3187,6 @@ export interface AutoscaleSettingResource extends Resource { targetResourceLocation?: string; } -/** Metadata pertaining to creation and last modification of the resource. */ -export interface DataCollectionEndpointResourceSystemData extends SystemData {} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface DataCollectionRuleAssociationProxyOnlyResourceSystemData - extends SystemData {} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface DataCollectionRuleResourceSystemData extends SystemData {} - /** A rule condition based on a metric crossing a threshold. */ export interface ThresholdRuleCondition extends RuleCondition { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -2749,7 +3272,7 @@ export interface RuleWebhookAction extends RuleAction { } /** The alert rule resource. */ -export interface AlertRuleResource extends ResourceAutoGenerated { +export interface AlertRuleResource extends ResourceAutoGenerated3 { /** the name of the alert rule. */ namePropertiesName: string; /** the description of the alert rule that will be included in the alert email. */ @@ -2772,7 +3295,7 @@ export interface AlertRuleResource extends ResourceAutoGenerated { } /** The log profile resource. */ -export interface LogProfileResource extends ResourceAutoGenerated2 { +export interface LogProfileResource extends ResourceAutoGenerated4 { /** the resource id of the storage account to which you would like to send the Activity Log. */ storageAccountId?: string; /** The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'. */ @@ -2786,7 +3309,7 @@ export interface LogProfileResource extends ResourceAutoGenerated2 { } /** The diagnostic setting resource. */ -export interface DiagnosticSettingsResource extends ResourceAutoGenerated3 { +export interface DiagnosticSettingsResource extends ResourceAutoGenerated5 { /** * The system metadata related to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2814,7 +3337,7 @@ export interface DiagnosticSettingsResource extends ResourceAutoGenerated3 { /** The diagnostic settings category resource. */ export interface DiagnosticSettingsCategoryResource - extends ResourceAutoGenerated3 { + extends ResourceAutoGenerated5 { /** * The system metadata related to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2827,20 +3350,18 @@ export interface DiagnosticSettingsCategoryResource } /** The Private Endpoint Connection resource. */ -export interface PrivateEndpointConnection extends ResourceAutoGenerated3 { +export interface PrivateEndpointConnectionAutoGenerated + extends ResourceAutoGenerated5 { /** The resource of private end point. */ - privateEndpoint?: PrivateEndpoint; + privateEndpoint?: PrivateEndpointAutoGenerated; /** A collection of information about the state of the connection between service consumer and provider. */ privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - /** - * The provisioning state of the private endpoint connection resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: PrivateEndpointConnectionProvisioningState; + /** The provisioning state of the private endpoint connection resource. */ + provisioningState?: PrivateEndpointConnectionProvisioningState; } /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export interface TrackedResource extends ResourceAutoGenerated3 { +export interface TrackedResourceAutoGenerated extends ResourceAutoGenerated5 { /** Resource tags. */ tags?: { [propertyName: string]: string }; /** The geo-location where the resource lives */ @@ -2848,7 +3369,7 @@ export interface TrackedResource extends ResourceAutoGenerated3 { } /** A private link resource */ -export interface PrivateLinkResource extends ResourceAutoGenerated3 { +export interface PrivateLinkResource extends ResourceAutoGenerated5 { /** * The private link resource group id. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2864,7 +3385,7 @@ export interface PrivateLinkResource extends ResourceAutoGenerated3 { } /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResourceAutoGenerated extends ResourceAutoGenerated3 {} +export interface ProxyResourceAutoGenerated extends ResourceAutoGenerated5 {} /** An action group resource. */ export interface ActionGroupResource extends AzureResource { @@ -2896,6 +3417,24 @@ export interface ActionGroupResource extends AzureResource { eventHubReceivers?: EventHubReceiver[]; } +/** A tenant action group resource. */ +export interface TenantActionGroupResource extends AzureResource { + /** The short name of the action group. This will be used in SMS messages. */ + groupShortName?: string; + /** Indicates whether this tenant action group is enabled. If a tenant action group is not enabled, then none of its receivers will receive communications. */ + enabled?: boolean; + /** The list of email receivers that are part of this tenant action group. */ + emailReceivers?: EmailReceiverAutoGenerated[]; + /** The list of SMS receivers that are part of this tenant action group. */ + smsReceivers?: SmsReceiverAutoGenerated[]; + /** The list of webhook receivers that are part of this tenant action group. */ + webhookReceivers?: WebhookReceiverAutoGenerated[]; + /** The list of AzureAppPush receivers that are part of this tenant action group. */ + azureAppPushReceivers?: AzureAppPushReceiverAutoGenerated[]; + /** The list of voice receivers that are part of this tenant action group. */ + voiceReceivers?: VoiceReceiverAutoGenerated[]; +} + /** Specifies the metric alert criteria for a single resource that has multiple metric criteria. */ export interface MetricAlertSingleResourceMultipleMetricCriteria extends MetricAlertCriteria { @@ -2928,7 +3467,7 @@ export interface MetricAlertMultipleResourceMultipleMetricCriteria } /** The metric alert resource. */ -export interface MetricAlertResource extends ResourceAutoGenerated4 { +export interface MetricAlertResource extends ResourceAutoGenerated6 { /** the description of the metric alert that will be included in the alert email. */ description?: string; /** Alert severity {0, 1, 2, 3, 4} */ @@ -3016,12 +3555,19 @@ export interface DataCollectionEndpointConfigurationAccess export interface DataCollectionEndpointLogsIngestion extends LogsIngestionEndpointSpec {} +/** The endpoint used by clients to ingest metrics. */ +export interface DataCollectionEndpointMetricsIngestion + extends MetricsIngestionEndpointSpec {} + /** Network access control rules for the endpoints. */ export interface DataCollectionEndpointNetworkAcls extends NetworkRuleSet {} -/** Resource properties. */ -export interface DataCollectionRuleAssociationProxyOnlyResourceProperties - extends DataCollectionRuleAssociation {} +/** Failover configuration on this endpoint. This property is READ-ONLY. */ +export interface DataCollectionEndpointFailoverConfiguration + extends FailoverConfigurationSpec {} + +/** Metadata for the resource. This property is READ-ONLY. */ +export interface DataCollectionEndpointMetadata extends Metadata {} /** Metadata about the resource */ export interface DataCollectionRuleAssociationMetadata extends Metadata {} @@ -3029,6 +3575,21 @@ export interface DataCollectionRuleAssociationMetadata extends Metadata {} /** Metadata about the resource */ export interface DataCollectionRuleMetadata extends Metadata {} +/** Managed service identity of the resource. */ +export interface DataCollectionEndpointResourceIdentity + extends ManagedServiceIdentity {} + +/** Managed Service Identity. */ +export interface ResourceForUpdateIdentity extends ManagedServiceIdentity {} + +/** Managed service identity of the resource. */ +export interface DataCollectionRuleResourceIdentity + extends ManagedServiceIdentity {} + +/** Resource properties. */ +export interface DataCollectionRuleAssociationProxyOnlyResourceProperties + extends DataCollectionRuleAssociation {} + /** Resource properties. */ export interface DataCollectionRuleResourceProperties extends DataCollectionRule {} @@ -3045,6 +3606,12 @@ export interface LogFilesDataSourceSettings extends LogFileSettings {} /** Text settings */ export interface LogFileSettingsText extends LogFileTextSettings {} +/** Specifications of pull based data sources */ +export interface DataSourcesSpecDataImports extends DataImportSources {} + +/** Definition of Event Hub configuration. */ +export interface DataImportSourcesEventHub extends EventHubDataSource {} + /** The specification of destinations. */ export interface DataCollectionRuleDestinations extends DestinationsSpec {} @@ -3052,25 +3619,6 @@ export interface DataCollectionRuleDestinations extends DestinationsSpec {} export interface DestinationsSpecAzureMonitorMetrics extends AzureMonitorMetricsDestination {} -/** Resource properties */ -export interface AzureMonitorWorkspaceResourceProperties - extends AzureMonitorWorkspace {} - -/** Information about metrics for the Azure Monitor workspace */ -export interface AzureMonitorWorkspaceMetrics extends Metrics {} - -/** The Data Collection Rule and Endpoint used for ingestion by default. */ -export interface AzureMonitorWorkspaceDefaultIngestionSettings - extends IngestionSettings {} - -/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export interface TrackedResourceAutoGenerated extends ResourceAutoGenerated5 { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The geo-location where the resource lives */ - location: string; -} - /** Criterion to filter metrics. */ export interface MetricCriteria extends MultiMetricCriteria { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -3095,8 +3643,48 @@ export interface DynamicMetricCriteria extends MultiMetricCriteria { ignoreDataBefore?: Date; } +/** An Azure Monitor Workspace definition */ +export interface AzureMonitorWorkspaceResource extends TrackedResource { + /** + * Resource entity tag (ETag) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; + /** + * The immutable ID of the Azure Monitor workspace. This property is read-only. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountId?: string; + /** + * Information about metrics for the Azure Monitor workspace + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metrics?: AzureMonitorWorkspaceMetrics; + /** + * The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * The Data Collection Rule and Endpoint used for ingestion by default. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; + /** + * List of private endpoint connections + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** + * Gets or sets allow or disallow public network access to workspace + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publicNetworkAccess?: PublicNetworkAccess; +} + /** An Azure Monitor PrivateLinkScope definition. */ -export interface AzureMonitorPrivateLinkScope extends TrackedResource { +export interface AzureMonitorPrivateLinkScope + extends TrackedResourceAutoGenerated { /** * System data * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3111,7 +3699,7 @@ export interface AzureMonitorPrivateLinkScope extends TrackedResource { * List of private endpoint connections. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly privateEndpointConnections?: PrivateEndpointConnectionAutoGenerated[]; /** Access mode settings */ accessModeSettings: AccessModeSettings; } @@ -3132,54 +3720,171 @@ export interface ScopedResource extends ProxyResourceAutoGenerated { readonly provisioningState?: string; } -/** An Azure Monitor Workspace definition */ -export interface AzureMonitorWorkspaceResource - extends TrackedResourceAutoGenerated { - /** - * Resource entity tag (ETag) - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; - /** - * The immutable ID of the Azure Monitor workspace. This property is read-only. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly accountId?: string; - /** - * Information about metrics for the Azure Monitor workspace - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metrics?: AzureMonitorWorkspaceMetrics; - /** - * The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; - /** - * The Data Collection Rule and Endpoint used for ingestion by default. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; +/** Defines headers for AzureMonitorWorkspaces_delete operation. */ +export interface AzureMonitorWorkspacesDeleteHeaders { + azureAsyncOperation?: string; + location?: string; } -/** Defines headers for ActionGroups_postTestNotifications operation. */ -export interface ActionGroupsPostTestNotificationsHeaders { +/** Defines headers for ActionGroups_createNotificationsAtActionGroupResourceLevel operation. */ +export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders { /** The location header that has the polling uri. */ location?: string; } -/** Defines headers for ActionGroups_createNotificationsAtResourceGroupLevel operation. */ -export interface ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders { - /** The location header that has the polling uri. */ - location?: string; +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Creating */ + Creating = "Creating", + /** Succeeded */ + Succeeded = "Succeeded", + /** Deleting */ + Deleting = "Deleting", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating** \ + * **Succeeded** \ + * **Deleting** \ + * **Failed** \ + * **Canceled** + */ +export type ProvisioningState = string; + +/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Rejected */ + Rejected = "Rejected" +} + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** + */ +export type PrivateEndpointServiceConnectionStatus = string; + +/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Creating */ + Creating = "Creating", + /** Deleting */ + Deleting = "Deleting", + /** Failed */ + Failed = "Failed" +} + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. \ + * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Creating** \ + * **Deleting** \ + * **Failed** + */ +export type PrivateEndpointConnectionProvisioningState = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", + /** SecuredByPerimeter */ + SecuredByPerimeter = "SecuredByPerimeter" +} + +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** \ + * **SecuredByPerimeter** + */ +export type PublicNetworkAccess = string; + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system" } -/** Defines headers for ActionGroups_createNotificationsAtActionGroupResourceLevel operation. */ -export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders { - /** The location header that has the polling uri. */ - location?: string; +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal" } +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + /** Known values of {@link ScaleRuleMetricDimensionOperationType} that the service accepts. */ export enum KnownScaleRuleMetricDimensionOperationType { /** Equals */ @@ -3198,30 +3903,6 @@ export enum KnownScaleRuleMetricDimensionOperationType { */ export type ScaleRuleMetricDimensionOperationType = string; -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key" -} - -/** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** - */ -export type CreatedByType = string; - /** Known values of {@link CategoryType} that the service accepts. */ export enum KnownCategoryType { /** Metrics */ @@ -3318,6 +3999,54 @@ export enum KnownMetricUnit { */ export type MetricUnit = string; +/** Known values of {@link MetricAggregationType} that the service accepts. */ +export enum KnownMetricAggregationType { + /** None */ + None = "None", + /** Average */ + Average = "Average", + /** Count */ + Count = "Count", + /** Minimum */ + Minimum = "Minimum", + /** Maximum */ + Maximum = "Maximum", + /** Total */ + Total = "Total" +} + +/** + * Defines values for MetricAggregationType. \ + * {@link KnownMetricAggregationType} can be used interchangeably with MetricAggregationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Average** \ + * **Count** \ + * **Minimum** \ + * **Maximum** \ + * **Total** + */ +export type MetricAggregationType = string; + +/** Known values of {@link MetricResultType} that the service accepts. */ +export enum KnownMetricResultType { + /** Data */ + Data = "Data", + /** Metadata */ + Metadata = "Metadata" +} + +/** + * Defines values for MetricResultType. \ + * {@link KnownMetricResultType} can be used interchangeably with MetricResultType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Data** \ + * **Metadata** + */ +export type MetricResultType = string; + /** Known values of {@link BaselineSensitivity} that the service accepts. */ export enum KnownBaselineSensitivity { /** Low */ @@ -3405,27 +4134,6 @@ export enum KnownAlertSeverity { */ export type AlertSeverity = number; -/** Known values of {@link PublicNetworkAccess} that the service accepts. */ -export enum KnownPublicNetworkAccess { - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", - /** SecuredByPerimeter */ - SecuredByPerimeter = "SecuredByPerimeter" -} - -/** - * Defines values for PublicNetworkAccess. \ - * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enabled** \ - * **Disabled** \ - * **SecuredByPerimeter** - */ -export type PublicNetworkAccess = string; - /** Known values of {@link TimeAggregation} that the service accepts. */ export enum KnownTimeAggregation { /** Count */ @@ -3531,51 +4239,6 @@ export enum KnownDataStatus { */ export type DataStatus = string; -/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ -export enum KnownPrivateEndpointServiceConnectionStatus { - /** Pending */ - Pending = "Pending", - /** Approved */ - Approved = "Approved", - /** Rejected */ - Rejected = "Rejected" -} - -/** - * Defines values for PrivateEndpointServiceConnectionStatus. \ - * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Pending** \ - * **Approved** \ - * **Rejected** - */ -export type PrivateEndpointServiceConnectionStatus = string; - -/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ -export enum KnownPrivateEndpointConnectionProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded", - /** Creating */ - Creating = "Creating", - /** Deleting */ - Deleting = "Deleting", - /** Failed */ - Failed = "Failed" -} - -/** - * Defines values for PrivateEndpointConnectionProvisioningState. \ - * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Succeeded** \ - * **Creating** \ - * **Deleting** \ - * **Failed** - */ -export type PrivateEndpointConnectionProvisioningState = string; - /** Known values of {@link AccessMode} that the service accepts. */ export enum KnownAccessMode { /** Open */ @@ -3599,7 +4262,9 @@ export enum KnownKnownPublicNetworkAccessOptions { /** Enabled */ Enabled = "Enabled", /** Disabled */ - Disabled = "Disabled" + Disabled = "Disabled", + /** SecuredByPerimeter */ + SecuredByPerimeter = "SecuredByPerimeter" } /** @@ -3608,7 +4273,8 @@ export enum KnownKnownPublicNetworkAccessOptions { * this enum contains the known values that the service supports. * ### Known values supported by the service * **Enabled** \ - * **Disabled** + * **Disabled** \ + * **SecuredByPerimeter** */ export type KnownPublicNetworkAccessOptions = string; @@ -3622,6 +4288,8 @@ export enum KnownKnownDataCollectionEndpointProvisioningState { Deleting = "Deleting", /** Succeeded */ Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", /** Failed */ Failed = "Failed" } @@ -3635,10 +4303,41 @@ export enum KnownKnownDataCollectionEndpointProvisioningState { * **Updating** \ * **Deleting** \ * **Succeeded** \ + * **Canceled** \ * **Failed** */ export type KnownDataCollectionEndpointProvisioningState = string; +/** Known values of {@link KnownLocationSpecProvisioningStatus} that the service accepts. */ +export enum KnownKnownLocationSpecProvisioningStatus { + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Deleting */ + Deleting = "Deleting", + /** Succeeded */ + Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", + /** Failed */ + Failed = "Failed" +} + +/** + * Defines values for KnownLocationSpecProvisioningStatus. \ + * {@link KnownKnownLocationSpecProvisioningStatus} can be used interchangeably with KnownLocationSpecProvisioningStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Succeeded** \ + * **Canceled** \ + * **Failed** + */ +export type KnownLocationSpecProvisioningStatus = string; + /** Known values of {@link KnownDataCollectionEndpointResourceKind} that the service accepts. */ export enum KnownKnownDataCollectionEndpointResourceKind { /** Linux */ @@ -3657,6 +4356,30 @@ export enum KnownKnownDataCollectionEndpointResourceKind { */ export type KnownDataCollectionEndpointResourceKind = string; +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", + /** SystemAssignedUserAssigned */ + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned" +} + +/** + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned,UserAssigned** + */ +export type ManagedServiceIdentityType = string; + /** Known values of {@link KnownDataCollectionRuleAssociationProvisioningState} that the service accepts. */ export enum KnownKnownDataCollectionRuleAssociationProvisioningState { /** Creating */ @@ -3667,6 +4390,8 @@ export enum KnownKnownDataCollectionRuleAssociationProvisioningState { Deleting = "Deleting", /** Succeeded */ Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", /** Failed */ Failed = "Failed" } @@ -3680,6 +4405,7 @@ export enum KnownKnownDataCollectionRuleAssociationProvisioningState { * **Updating** \ * **Deleting** \ * **Succeeded** \ + * **Canceled** \ * **Failed** */ export type KnownDataCollectionRuleAssociationProvisioningState = string; @@ -3963,6 +4689,21 @@ export enum KnownKnownLogFileTextSettingsRecordStartTimestampFormat { */ export type KnownLogFileTextSettingsRecordStartTimestampFormat = string; +/** Known values of {@link KnownPrometheusForwarderDataSourceStreams} that the service accepts. */ +export enum KnownKnownPrometheusForwarderDataSourceStreams { + /** MicrosoftPrometheusMetrics */ + MicrosoftPrometheusMetrics = "Microsoft-PrometheusMetrics" +} + +/** + * Defines values for KnownPrometheusForwarderDataSourceStreams. \ + * {@link KnownKnownPrometheusForwarderDataSourceStreams} can be used interchangeably with KnownPrometheusForwarderDataSourceStreams, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft-PrometheusMetrics** + */ +export type KnownPrometheusForwarderDataSourceStreams = string; + /** Known values of {@link KnownDataFlowStreams} that the service accepts. */ export enum KnownKnownDataFlowStreams { /** MicrosoftEvent */ @@ -4000,6 +4741,8 @@ export enum KnownKnownDataCollectionRuleProvisioningState { Deleting = "Deleting", /** Succeeded */ Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", /** Failed */ Failed = "Failed" } @@ -4013,6 +4756,7 @@ export enum KnownKnownDataCollectionRuleProvisioningState { * **Updating** \ * **Deleting** \ * **Succeeded** \ + * **Canceled** \ * **Failed** */ export type KnownDataCollectionRuleProvisioningState = string; @@ -4033,70 +4777,7 @@ export enum KnownKnownDataCollectionRuleResourceKind { * **Linux** \ * **Windows** */ -export type KnownDataCollectionRuleResourceKind = string; - -/** Known values of {@link ProvisioningState} that the service accepts. */ -export enum KnownProvisioningState { - /** Creating */ - Creating = "Creating", - /** Succeeded */ - Succeeded = "Succeeded", - /** Deleting */ - Deleting = "Deleting", - /** Failed */ - Failed = "Failed", - /** Canceled */ - Canceled = "Canceled" -} - -/** - * Defines values for ProvisioningState. \ - * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Creating** \ - * **Succeeded** \ - * **Deleting** \ - * **Failed** \ - * **Canceled** - */ -export type ProvisioningState = string; - -/** Known values of {@link Origin} that the service accepts. */ -export enum KnownOrigin { - /** User */ - User = "user", - /** System */ - System = "system", - /** UserSystem */ - UserSystem = "user,system" -} - -/** - * Defines values for Origin. \ - * {@link KnownOrigin} can be used interchangeably with Origin, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **system** \ - * **user,system** - */ -export type Origin = string; - -/** Known values of {@link ActionType} that the service accepts. */ -export enum KnownActionType { - /** Internal */ - Internal = "Internal" -} - -/** - * Defines values for ActionType. \ - * {@link KnownActionType} can be used interchangeably with ActionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Internal** - */ -export type ActionType = string; +export type KnownDataCollectionRuleResourceKind = string; /** Known values of {@link Operator} that the service accepts. */ export enum KnownOperator { @@ -4271,6 +4952,21 @@ export type AggregationType = | "Total"; /** Defines values for ResultType. */ export type ResultType = "Data" | "Metadata"; +/** Defines values for Unit. */ +export type Unit = + | "Count" + | "Bytes" + | "Seconds" + | "CountPerSecond" + | "BytesPerSecond" + | "Percent" + | "MilliSeconds" + | "ByteSeconds" + | "Unspecified" + | "Cores" + | "MilliCores" + | "NanoCores" + | "BitsPerSecond"; /** Defines values for IdentityType. */ export type IdentityType = "SystemAssigned" | "UserAssigned" | "None"; /** Defines values for ConditionOperator. */ @@ -4288,6 +4984,84 @@ export type TimeAggregationOperator = | "Total" | "Last"; +/** Optional parameters. */ +export interface AzureMonitorWorkspacesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type AzureMonitorWorkspacesListByResourceGroupResponse = AzureMonitorWorkspaceResourceListResult; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type AzureMonitorWorkspacesListBySubscriptionResponse = AzureMonitorWorkspaceResourceListResult; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AzureMonitorWorkspacesGetResponse = AzureMonitorWorkspaceResource; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type AzureMonitorWorkspacesCreateResponse = AzureMonitorWorkspaceResource; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesUpdateOptionalParams + extends coreClient.OperationOptions { + /** The payload */ + azureMonitorWorkspaceProperties?: AzureMonitorWorkspaceResourceForUpdate; +} + +/** Contains response data for the update operation. */ +export type AzureMonitorWorkspacesUpdateResponse = AzureMonitorWorkspaceResource; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type AzureMonitorWorkspacesDeleteResponse = AzureMonitorWorkspacesDeleteHeaders; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type AzureMonitorWorkspacesListByResourceGroupNextResponse = AzureMonitorWorkspaceResourceListResult; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type AzureMonitorWorkspacesListBySubscriptionNextResponse = AzureMonitorWorkspaceResourceListResult; + +/** Optional parameters. */ +export interface MonitorOperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type MonitorOperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface MonitorOperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type MonitorOperationsListNextResponse = OperationListResult; + /** Optional parameters. */ export interface AutoscaleSettingsListByResourceGroupOptionalParams extends coreClient.OperationOptions {} @@ -4353,7 +5127,7 @@ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; +export type OperationsListResponse = OperationListResultAutoGenerated; /** Optional parameters. */ export interface AlertRuleIncidentsGetOptionalParams @@ -4504,30 +5278,6 @@ export interface ActionGroupsUpdateOptionalParams /** Contains response data for the update operation. */ export type ActionGroupsUpdateResponse = ActionGroupResource; -/** Optional parameters. */ -export interface ActionGroupsPostTestNotificationsOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the postTestNotifications operation. */ -export type ActionGroupsPostTestNotificationsResponse = TestNotificationDetailsResponse; - -/** Optional parameters. */ -export interface ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createNotificationsAtResourceGroupLevel operation. */ -export type ActionGroupsCreateNotificationsAtResourceGroupLevelResponse = TestNotificationDetailsResponse; - /** Optional parameters. */ export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams extends coreClient.OperationOptions { @@ -4540,20 +5290,6 @@ export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOption /** Contains response data for the createNotificationsAtActionGroupResourceLevel operation. */ export type ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse = TestNotificationDetailsResponse; -/** Optional parameters. */ -export interface ActionGroupsGetTestNotificationsOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getTestNotifications operation. */ -export type ActionGroupsGetTestNotificationsResponse = TestNotificationDetailsResponse; - -/** Optional parameters. */ -export interface ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getTestNotificationsAtResourceGroupLevel operation. */ -export type ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse = TestNotificationDetailsResponse; - /** Optional parameters. */ export interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams extends coreClient.OperationOptions {} @@ -4579,6 +5315,38 @@ export type ActionGroupsListByResourceGroupResponse = ActionGroupList; export interface ActionGroupsEnableReceiverOptionalParams extends coreClient.OperationOptions {} +/** Optional parameters. */ +export interface TenantActionGroupsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type TenantActionGroupsCreateOrUpdateResponse = TenantActionGroupResource; + +/** Optional parameters. */ +export interface TenantActionGroupsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TenantActionGroupsGetResponse = TenantActionGroupResource; + +/** Optional parameters. */ +export interface TenantActionGroupsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface TenantActionGroupsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type TenantActionGroupsUpdateResponse = TenantActionGroupResource; + +/** Optional parameters. */ +export interface TenantActionGroupsListByManagementGroupIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByManagementGroupId operation. */ +export type TenantActionGroupsListByManagementGroupIdResponse = TenantActionGroupList; + /** Optional parameters. */ export interface ActivityLogsListOptionalParams extends coreClient.OperationOptions { @@ -4622,27 +5390,115 @@ export interface TenantActivityLogsListNextOptionalParams /** Contains response data for the listNext operation. */ export type TenantActivityLogsListNextResponse = EventDataCollection; +/** Optional parameters. */ +export interface MetricDefinitionsListAtSubscriptionScopeOptionalParams + extends coreClient.OperationOptions { + /** Metric namespace where the metrics you want reside. */ + metricnamespace?: string; +} + +/** Contains response data for the listAtSubscriptionScope operation. */ +export type MetricDefinitionsListAtSubscriptionScopeResponse = SubscriptionScopeMetricDefinitionCollection; + /** Optional parameters. */ export interface MetricDefinitionsListOptionalParams extends coreClient.OperationOptions { - /** Metric namespace to query metric definitions for. */ + /** Metric namespace where the metrics you want reside. */ metricnamespace?: string; } /** Contains response data for the list operation. */ export type MetricDefinitionsListResponse = MetricDefinitionCollection; +/** Optional parameters. */ +export interface MetricsListAtSubscriptionScopeOptionalParams + extends coreClient.OperationOptions { + /** The **$filter** is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
This is invalid because the logical or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. */ + filter?: string; + /** Metric namespace where the metrics you want reside. */ + metricnamespace?: string; + /** The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. */ + timespan?: string; + /** The interval (i.e. timegrain) of the query. */ + interval?: string; + /** The names of the metrics (comma separated) to retrieve. */ + metricnames?: string; + /** The list of aggregation types (comma separated) to retrieve. */ + aggregation?: string; + /** + * The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + */ + top?: number; + /** + * The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + */ + orderby?: string; + /** Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. */ + resultType?: MetricResultType; + /** When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. Defaults to false. */ + autoAdjustTimegrain?: boolean; + /** When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid filter parameters. Defaults to true. */ + validateDimensions?: boolean; +} + +/** Contains response data for the listAtSubscriptionScope operation. */ +export type MetricsListAtSubscriptionScopeResponse = SubscriptionScopeMetricResponse; + +/** Optional parameters. */ +export interface MetricsListAtSubscriptionScopePostOptionalParams + extends coreClient.OperationOptions { + /** The **$filter** is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
This is invalid because the logical or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. */ + filter?: string; + /** Metric namespace where the metrics you want reside. */ + metricnamespace?: string; + /** The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. */ + timespan?: string; + /** The interval (i.e. timegrain) of the query. */ + interval?: string; + /** The names of the metrics (comma separated) to retrieve. */ + metricnames?: string; + /** The list of aggregation types (comma separated) to retrieve. */ + aggregation?: string; + /** + * The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + */ + top?: number; + /** + * The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + */ + orderby?: string; + /** Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. */ + resultType?: MetricResultType; + /** When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. Defaults to false. */ + autoAdjustTimegrain?: boolean; + /** When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid filter parameters. Defaults to true. */ + validateDimensions?: boolean; + /** Parameters serialized in the body */ + body?: SubscriptionScopeMetricsRequestBodyParameters; +} + +/** Contains response data for the listAtSubscriptionScopePost operation. */ +export type MetricsListAtSubscriptionScopePostResponse = SubscriptionScopeMetricResponse; + /** Optional parameters. */ export interface MetricsListOptionalParams extends coreClient.OperationOptions { - /** The **$filter** is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "** */ + /** The **$filter** is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
This is invalid because the logical or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. */ filter?: string; - /** Metric namespace to query metric definitions for. */ + /** Metric namespace where the metrics you want reside. */ metricnamespace?: string; /** The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. */ timespan?: string; /** The interval (i.e. timegrain) of the query. */ interval?: string; - /** The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'** */ + /** The names of the metrics (comma separated) to retrieve. */ metricnames?: string; /** The list of aggregation types (comma separated) to retrieve. */ aggregation?: string; @@ -4658,6 +5514,10 @@ export interface MetricsListOptionalParams extends coreClient.OperationOptions { * Examples: sum asc. */ orderby?: string; + /** When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. Defaults to false. */ + autoAdjustTimegrain?: boolean; + /** When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid filter parameters. Defaults to true. */ + validateDimensions?: boolean; /** Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. */ resultType?: ResultType; } @@ -4896,7 +5756,7 @@ export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnectionAutoGenerated; /** Optional parameters. */ export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams @@ -4908,7 +5768,7 @@ export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams } /** Contains response data for the createOrUpdate operation. */ -export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnectionAutoGenerated; /** Optional parameters. */ export interface PrivateEndpointConnectionsDeleteOptionalParams @@ -5202,76 +6062,6 @@ export interface DataCollectionRulesListBySubscriptionNextOptionalParams /** Contains response data for the listBySubscriptionNext operation. */ export type DataCollectionRulesListBySubscriptionNextResponse = DataCollectionRuleResourceListResult; -/** Optional parameters. */ -export interface AzureMonitorWorkspacesListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type AzureMonitorWorkspacesListByResourceGroupResponse = AzureMonitorWorkspaceResourceListResult; - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type AzureMonitorWorkspacesListBySubscriptionResponse = AzureMonitorWorkspaceResourceListResult; - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type AzureMonitorWorkspacesGetResponse = AzureMonitorWorkspaceResource; - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesCreateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the create operation. */ -export type AzureMonitorWorkspacesCreateResponse = AzureMonitorWorkspaceResource; - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesUpdateOptionalParams - extends coreClient.OperationOptions { - /** The payload */ - azureMonitorWorkspaceProperties?: AzureMonitorWorkspaceResourceForUpdate; -} - -/** Contains response data for the update operation. */ -export type AzureMonitorWorkspacesUpdateResponse = AzureMonitorWorkspaceResource; - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type AzureMonitorWorkspacesListByResourceGroupNextResponse = AzureMonitorWorkspaceResourceListResult; - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type AzureMonitorWorkspacesListBySubscriptionNextResponse = AzureMonitorWorkspaceResourceListResult; - -/** Optional parameters. */ -export interface MonitorOperationsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type MonitorOperationsListResponse = OperationListResultAutoGenerated; - -/** Optional parameters. */ -export interface MonitorOperationsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type MonitorOperationsListNextResponse = OperationListResultAutoGenerated; - /** Optional parameters. */ export interface MonitorClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/monitor/arm-monitor/src/models/mappers.ts b/sdk/monitor/arm-monitor/src/models/mappers.ts index 55b873ac7999..1faf134273b5 100644 --- a/sdk/monitor/arm-monitor/src/models/mappers.ts +++ b/sdk/monitor/arm-monitor/src/models/mappers.ts @@ -8,6 +8,521 @@ import * as coreClient from "@azure/core-client"; +export const AzureMonitorWorkspaceResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureMonitorWorkspaceResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureMonitorWorkspaceResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const AzureMonitorWorkspace: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureMonitorWorkspace", + modelProperties: { + accountId: { + serializedName: "accountId", + readOnly: true, + type: { + name: "String" + } + }, + metrics: { + serializedName: "metrics", + type: { + name: "Composite", + className: "AzureMonitorWorkspaceMetrics" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + defaultIngestionSettings: { + serializedName: "defaultIngestionSettings", + type: { + name: "Composite", + className: "AzureMonitorWorkspaceDefaultIngestionSettings" + } + }, + privateEndpointConnections: { + serializedName: "privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, + publicNetworkAccess: { + serializedName: "publicNetworkAccess", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Metrics: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Metrics", + modelProperties: { + prometheusQueryEndpoint: { + serializedName: "prometheusQueryEndpoint", + readOnly: true, + type: { + name: "String" + } + }, + internalId: { + serializedName: "internalId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const IngestionSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IngestionSettings", + modelProperties: { + dataCollectionRuleResourceId: { + serializedName: "dataCollectionRuleResourceId", + readOnly: true, + type: { + name: "String" + } + }, + dataCollectionEndpointResourceId: { + serializedName: "dataCollectionEndpointResourceId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + actionsRequired: { + serializedName: "actionsRequired", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ResourceAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceAutoGenerated", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const AzureMonitorWorkspaceResourceForUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureMonitorWorkspaceResourceForUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const AutoscaleSettingResourceCollection: coreClient.CompositeMapper = { type: { name: "Composite", @@ -559,10 +1074,10 @@ export const PredictiveAutoscalePolicy: coreClient.CompositeMapper = { } }; -export const Resource: coreClient.CompositeMapper = { +export const ResourceAutoGenerated2: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "ResourceAutoGenerated2", modelProperties: { id: { serializedName: "id", @@ -610,51 +1125,6 @@ export const Resource: coreClient.CompositeMapper = { } }; -export const SystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String" - } - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String" - } - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime" - } - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "String" - } - }, - lastModifiedByType: { - serializedName: "lastModifiedByType", - type: { - name: "String" - } - }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime" - } - } - } - } -}; - export const AutoscaleErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", @@ -854,10 +1324,10 @@ export const PredictiveValue: coreClient.CompositeMapper = { } }; -export const OperationListResult: coreClient.CompositeMapper = { +export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "OperationListResultAutoGenerated", modelProperties: { value: { serializedName: "value", @@ -866,7 +1336,7 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" + className: "OperationAutoGenerated" } } } @@ -881,10 +1351,10 @@ export const OperationListResult: coreClient.CompositeMapper = { } }; -export const Operation: coreClient.CompositeMapper = { +export const OperationAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "OperationAutoGenerated", modelProperties: { name: { serializedName: "name", @@ -896,17 +1366,17 @@ export const Operation: coreClient.CompositeMapper = { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" + className: "OperationDisplayAutoGenerated" } } } } }; -export const OperationDisplay: coreClient.CompositeMapper = { +export const OperationDisplayAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "OperationDisplayAutoGenerated", modelProperties: { provider: { serializedName: "provider", @@ -974,10 +1444,10 @@ export const Incident: coreClient.CompositeMapper = { } }; -export const ErrorResponse: coreClient.CompositeMapper = { +export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", + className: "ErrorResponseAutoGenerated", modelProperties: { code: { serializedName: "code", @@ -1110,10 +1580,10 @@ export const RuleAction: coreClient.CompositeMapper = { } }; -export const ResourceAutoGenerated: coreClient.CompositeMapper = { +export const ResourceAutoGenerated3: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceAutoGenerated", + className: "ResourceAutoGenerated3", modelProperties: { id: { serializedName: "id", @@ -1274,10 +1744,10 @@ export const RetentionPolicy: coreClient.CompositeMapper = { } }; -export const ResourceAutoGenerated2: coreClient.CompositeMapper = { +export const ResourceAutoGenerated4: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceAutoGenerated2", + className: "ResourceAutoGenerated4", modelProperties: { id: { serializedName: "id", @@ -1467,10 +1937,10 @@ export const LogSettings: coreClient.CompositeMapper = { } }; -export const ResourceAutoGenerated3: coreClient.CompositeMapper = { +export const ResourceAutoGenerated5: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceAutoGenerated3", + className: "ResourceAutoGenerated5", modelProperties: { id: { serializedName: "id", @@ -2236,32 +2706,274 @@ export const TestNotificationDetailsResponse: coreClient.CompositeMapper = { actionDetails: { serializedName: "actionDetails", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ActionDetail" - } - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActionDetail" + } + } + } + } + } + } +}; + +export const Context: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Context", + modelProperties: { + notificationSource: { + serializedName: "notificationSource", + type: { + name: "String" + } + }, + contextType: { + serializedName: "contextType", + type: { + name: "String" + } + } + } + } +}; + +export const ActionDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActionDetail", + modelProperties: { + mechanismType: { + serializedName: "MechanismType", + type: { + name: "String" + } + }, + name: { + serializedName: "Name", + type: { + name: "String" + } + }, + status: { + serializedName: "Status", + type: { + name: "String" + } + }, + subState: { + serializedName: "SubState", + type: { + name: "String" + } + }, + sendTime: { + serializedName: "SendTime", + type: { + name: "String" + } + }, + detail: { + serializedName: "Detail", + type: { + name: "String" + } + } + } + } +}; + +export const ActionGroupList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActionGroupList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActionGroupResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const EnableRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnableRequest", + modelProperties: { + receiverName: { + serializedName: "receiverName", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const EmailReceiverAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EmailReceiverAutoGenerated", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + emailAddress: { + serializedName: "emailAddress", + required: true, + type: { + name: "String" + } + }, + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", + type: { + name: "Boolean" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["NotSpecified", "Enabled", "Disabled"] + } + } + } + } +}; + +export const SmsReceiverAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SmsReceiverAutoGenerated", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + countryCode: { + serializedName: "countryCode", + required: true, + type: { + name: "String" + } + }, + phoneNumber: { + serializedName: "phoneNumber", + required: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["NotSpecified", "Enabled", "Disabled"] + } + } + } + } +}; + +export const WebhookReceiverAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WebhookReceiverAutoGenerated", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + serviceUri: { + serializedName: "serviceUri", + required: true, + type: { + name: "String" + } + }, + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", + type: { + name: "Boolean" + } + }, + useAadAuth: { + defaultValue: false, + serializedName: "useAadAuth", + type: { + name: "Boolean" + } + }, + objectId: { + serializedName: "objectId", + type: { + name: "String" + } + }, + identifierUri: { + serializedName: "identifierUri", + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + type: { + name: "String" } } } } }; -export const Context: coreClient.CompositeMapper = { +export const AzureAppPushReceiverAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Context", + className: "AzureAppPushReceiverAutoGenerated", modelProperties: { - notificationSource: { - serializedName: "notificationSource", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - contextType: { - serializedName: "contextType", + emailAddress: { + serializedName: "emailAddress", + required: true, type: { name: "String" } @@ -2270,55 +2982,63 @@ export const Context: coreClient.CompositeMapper = { } }; -export const ActionDetail: coreClient.CompositeMapper = { +export const VoiceReceiverAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionDetail", + className: "VoiceReceiverAutoGenerated", modelProperties: { - mechanismType: { - serializedName: "MechanismType", - type: { - name: "String" - } - }, name: { - serializedName: "Name", + serializedName: "name", + required: true, type: { name: "String" } }, - status: { - serializedName: "Status", + countryCode: { + serializedName: "countryCode", + required: true, type: { name: "String" } }, - subState: { - serializedName: "SubState", + phoneNumber: { + serializedName: "phoneNumber", + required: true, type: { name: "String" } - }, - sendTime: { - serializedName: "SendTime", + } + } + } +}; + +export const ActionGroupPatchBodyAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActionGroupPatchBodyAutoGenerated", + modelProperties: { + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - detail: { - serializedName: "Detail", + enabled: { + defaultValue: true, + serializedName: "properties.enabled", type: { - name: "String" + name: "Boolean" } } } } }; -export const ActionGroupList: coreClient.CompositeMapper = { +export const TenantActionGroupList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionGroupList", + className: "TenantActionGroupList", modelProperties: { value: { serializedName: "value", @@ -2327,7 +3047,7 @@ export const ActionGroupList: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ActionGroupResource" + className: "TenantActionGroupResource" } } } @@ -2342,22 +3062,6 @@ export const ActionGroupList: coreClient.CompositeMapper = { } }; -export const EnableRequest: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EnableRequest", - modelProperties: { - receiverName: { - serializedName: "receiverName", - required: true, - type: { - name: "String" - } - } - } - } -}; - export const EventDataCollection: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2621,55 +3325,219 @@ export const LocalizableString: coreClient.CompositeMapper = { } }; -export const HttpRequestInfo: coreClient.CompositeMapper = { +export const HttpRequestInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HttpRequestInfo", + modelProperties: { + clientRequestId: { + serializedName: "clientRequestId", + type: { + name: "String" + } + }, + clientIpAddress: { + serializedName: "clientIpAddress", + type: { + name: "String" + } + }, + method: { + serializedName: "method", + type: { + name: "String" + } + }, + uri: { + serializedName: "uri", + type: { + name: "String" + } + } + } + } +}; + +export const EventCategoryCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventCategoryCollection", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LocalizableString" + } + } + } + } + } + } +}; + +export const SubscriptionScopeMetricDefinitionCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionScopeMetricDefinitionCollection", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubscriptionScopeMetricDefinition" + } + } + } + } + } + } +}; + +export const SubscriptionScopeMetricDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionScopeMetricDefinition", + modelProperties: { + isDimensionRequired: { + serializedName: "isDimensionRequired", + type: { + name: "Boolean" + } + }, + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + namespace: { + serializedName: "namespace", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "LocalizableString" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + category: { + serializedName: "category", + type: { + name: "String" + } + }, + metricClass: { + serializedName: "metricClass", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + primaryAggregationType: { + serializedName: "primaryAggregationType", + type: { + name: "String" + } + }, + supportedAggregationTypes: { + serializedName: "supportedAggregationTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + metricAvailabilities: { + serializedName: "metricAvailabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricAvailability" + } + } + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LocalizableString" + } + } + } + } + } + } +}; + +export const MetricAvailability: coreClient.CompositeMapper = { type: { name: "Composite", - className: "HttpRequestInfo", + className: "MetricAvailability", modelProperties: { - clientRequestId: { - serializedName: "clientRequestId", - type: { - name: "String" - } - }, - clientIpAddress: { - serializedName: "clientIpAddress", - type: { - name: "String" - } - }, - method: { - serializedName: "method", + timeGrain: { + serializedName: "timeGrain", type: { - name: "String" + name: "TimeSpan" } }, - uri: { - serializedName: "uri", + retention: { + serializedName: "retention", type: { - name: "String" + name: "TimeSpan" } } } } }; -export const EventCategoryCollection: coreClient.CompositeMapper = { +export const ErrorContract: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EventCategoryCollection", + className: "ErrorContract", modelProperties: { - value: { - serializedName: "value", - required: true, + error: { + serializedName: "error", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LocalizableString" - } - } + name: "Composite", + className: "ErrorResponseAutoGenerated" } } } @@ -2819,31 +3687,10 @@ export const MetricDefinition: coreClient.CompositeMapper = { } }; -export const MetricAvailability: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricAvailability", - modelProperties: { - timeGrain: { - serializedName: "timeGrain", - type: { - name: "TimeSpan" - } - }, - retention: { - serializedName: "retention", - type: { - name: "TimeSpan" - } - } - } - } -}; - -export const Response: coreClient.CompositeMapper = { +export const SubscriptionScopeMetricResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Response", + className: "SubscriptionScopeMetricResponse", modelProperties: { cost: { constraints: { @@ -2887,7 +3734,7 @@ export const Response: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Metric" + className: "SubscriptionScopeMetric" } } } @@ -2896,10 +3743,10 @@ export const Response: coreClient.CompositeMapper = { } }; -export const Metric: coreClient.CompositeMapper = { +export const SubscriptionScopeMetric: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Metric", + className: "SubscriptionScopeMetric", modelProperties: { id: { serializedName: "id", @@ -3052,13 +3899,233 @@ export const MetricValue: coreClient.CompositeMapper = { total: { serializedName: "total", type: { - name: "Number" + name: "Number" + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + } + } + } +}; + +export const SubscriptionScopeMetricsRequestBodyParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionScopeMetricsRequestBodyParameters", + modelProperties: { + timespan: { + serializedName: "timespan", + type: { + name: "String" + } + }, + interval: { + serializedName: "interval", + type: { + name: "TimeSpan" + } + }, + metricNames: { + serializedName: "metricNames", + type: { + name: "String" + } + }, + aggregation: { + serializedName: "aggregation", + type: { + name: "String" + } + }, + filter: { + serializedName: "filter", + type: { + name: "String" + } + }, + top: { + serializedName: "top", + type: { + name: "Number" + } + }, + orderBy: { + serializedName: "orderBy", + type: { + name: "String" + } + }, + rollUpBy: { + serializedName: "rollUpBy", + type: { + name: "String" + } + }, + resultType: { + serializedName: "resultType", + type: { + name: "String" + } + }, + metricNamespace: { + serializedName: "metricNamespace", + type: { + name: "String" + } + }, + autoAdjustTimegrain: { + serializedName: "autoAdjustTimegrain", + type: { + name: "Boolean" + } + }, + validateDimensions: { + serializedName: "validateDimensions", + type: { + name: "Boolean" + } + } + } + } +}; + +export const Response: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Response", + modelProperties: { + cost: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "cost", + type: { + name: "Number" + } + }, + timespan: { + serializedName: "timespan", + required: true, + type: { + name: "String" + } + }, + interval: { + serializedName: "interval", + type: { + name: "TimeSpan" + } + }, + namespace: { + serializedName: "namespace", + type: { + name: "String" + } + }, + resourceregion: { + serializedName: "resourceregion", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Metric" + } + } + } + } + } + } +}; + +export const Metric: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Metric", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "LocalizableString" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + errorCode: { + serializedName: "errorCode", + type: { + name: "String" + } + }, + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + required: true, + type: { + name: "Enum", + allowedValues: [ + "Count", + "Bytes", + "Seconds", + "CountPerSecond", + "BytesPerSecond", + "Percent", + "MilliSeconds", + "ByteSeconds", + "Unspecified", + "Cores", + "MilliCores", + "NanoCores", + "BitsPerSecond" + ] } }, - count: { - serializedName: "count", + timeseries: { + serializedName: "timeseries", + required: true, type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TimeSeriesElement" + } + } } } } @@ -3366,10 +4433,10 @@ export const MetricAlertAction: coreClient.CompositeMapper = { } }; -export const ResourceAutoGenerated4: coreClient.CompositeMapper = { +export const ResourceAutoGenerated6: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceAutoGenerated4", + className: "ResourceAutoGenerated6", modelProperties: { id: { serializedName: "id", @@ -3735,7 +4802,6 @@ export const ScheduledQueryRuleResource: coreClient.CompositeMapper = { } }, publicNetworkAccess: { - defaultValue: "Enabled", serializedName: "properties.publicNetworkAccess", type: { name: "String" @@ -4104,10 +5170,10 @@ export const RuleResolveConfiguration: coreClient.CompositeMapper = { } }; -export const ErrorContract: coreClient.CompositeMapper = { +export const ErrorContractAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorContract", + className: "ErrorContractAutoGenerated", modelProperties: { error: { serializedName: "error", @@ -4258,7 +5324,6 @@ export const ScheduledQueryRuleResourcePatch: coreClient.CompositeMapper = { } }, publicNetworkAccess: { - defaultValue: "Enabled", serializedName: "properties.publicNetworkAccess", type: { name: "String" @@ -4579,10 +5644,10 @@ export const AzureMonitorPrivateLinkScopeListResult: coreClient.CompositeMapper } }; -export const PrivateEndpoint: coreClient.CompositeMapper = { +export const PrivateEndpointAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpoint", + className: "PrivateEndpointAutoGenerated", modelProperties: { id: { serializedName: "id", @@ -4595,33 +5660,6 @@ export const PrivateEndpoint: coreClient.CompositeMapper = { } }; -export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "String" - } - }, - description: { - serializedName: "description", - type: { - name: "String" - } - }, - actionsRequired: { - serializedName: "actionsRequired", - type: { - name: "String" - } - } - } - } -}; - export const AccessModeSettings: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4693,17 +5731,17 @@ export const DefaultErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" + className: "ErrorDetailAutoGenerated" } } } } }; -export const ErrorDetail: coreClient.CompositeMapper = { +export const ErrorDetailAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDetail", + className: "ErrorDetailAutoGenerated", modelProperties: { code: { serializedName: "code", @@ -4734,7 +5772,7 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" + className: "ErrorDetailAutoGenerated" } } } @@ -4756,30 +5794,6 @@ export const ErrorDetail: coreClient.CompositeMapper = { } }; -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } -}; - export const TagsResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4837,7 +5851,7 @@ export const OperationStatus: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" + className: "ErrorDetailAutoGenerated" } } } @@ -4877,7 +5891,7 @@ export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PrivateEndpointConnection" + className: "PrivateEndpointConnectionAutoGenerated" } } } @@ -5057,10 +6071,10 @@ export const AzureResourceAutoGenerated: coreClient.CompositeMapper = { } }; -export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { +export const ErrorResponseAutoGenerated2: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponseAutoGenerated", + className: "ErrorResponseAutoGenerated2", modelProperties: { code: { serializedName: "code", @@ -5183,6 +6197,13 @@ export const DataCollectionEndpointResource: coreClient.CompositeMapper = { name: "String" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "DataCollectionEndpointResourceIdentity" + } + }, id: { serializedName: "id", readOnly: true, @@ -5244,6 +6265,13 @@ export const DataCollectionEndpointResource: coreClient.CompositeMapper = { className: "DataCollectionEndpointLogsIngestion" } }, + metricsIngestion: { + serializedName: "properties.metricsIngestion", + type: { + name: "Composite", + className: "DataCollectionEndpointMetricsIngestion" + } + }, networkAcls: { serializedName: "properties.networkAcls", type: { @@ -5257,6 +6285,33 @@ export const DataCollectionEndpointResource: coreClient.CompositeMapper = { type: { name: "String" } + }, + privateLinkScopedResources: { + serializedName: "properties.privateLinkScopedResources", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkScopedResource" + } + } + } + }, + failoverConfiguration: { + serializedName: "properties.failoverConfiguration", + type: { + name: "Composite", + className: "DataCollectionEndpointFailoverConfiguration" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Composite", + className: "DataCollectionEndpointMetadata" + } } } } @@ -5292,17 +6347,183 @@ export const DataCollectionEndpoint: coreClient.CompositeMapper = { name: "Composite", className: "DataCollectionEndpointLogsIngestion" } - }, - networkAcls: { - serializedName: "networkAcls", + }, + metricsIngestion: { + serializedName: "metricsIngestion", + type: { + name: "Composite", + className: "DataCollectionEndpointMetricsIngestion" + } + }, + networkAcls: { + serializedName: "networkAcls", + type: { + name: "Composite", + className: "DataCollectionEndpointNetworkAcls" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + privateLinkScopedResources: { + serializedName: "privateLinkScopedResources", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkScopedResource" + } + } + } + }, + failoverConfiguration: { + serializedName: "failoverConfiguration", + type: { + name: "Composite", + className: "DataCollectionEndpointFailoverConfiguration" + } + }, + metadata: { + serializedName: "metadata", + type: { + name: "Composite", + className: "DataCollectionEndpointMetadata" + } + } + } + } +}; + +export const ConfigurationAccessEndpointSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConfigurationAccessEndpointSpec", + modelProperties: { + endpoint: { + serializedName: "endpoint", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const LogsIngestionEndpointSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogsIngestionEndpointSpec", + modelProperties: { + endpoint: { + serializedName: "endpoint", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const MetricsIngestionEndpointSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricsIngestionEndpointSpec", + modelProperties: { + endpoint: { + serializedName: "endpoint", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const NetworkRuleSet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkRuleSet", + modelProperties: { + publicNetworkAccess: { + serializedName: "publicNetworkAccess", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkScopedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkScopedResource", + modelProperties: { + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + scopeId: { + serializedName: "scopeId", + type: { + name: "String" + } + } + } + } +}; + +export const FailoverConfigurationSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FailoverConfigurationSpec", + modelProperties: { + activeLocation: { + serializedName: "activeLocation", + type: { + name: "String" + } + }, + locations: { + serializedName: "locations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LocationSpec" + } + } + } + } + } + } +}; + +export const LocationSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LocationSpec", + modelProperties: { + location: { + serializedName: "location", type: { - name: "Composite", - className: "DataCollectionEndpointNetworkAcls" + name: "String" } }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, + provisioningStatus: { + serializedName: "provisioningStatus", type: { name: "String" } @@ -5311,13 +6532,20 @@ export const DataCollectionEndpoint: coreClient.CompositeMapper = { } }; -export const ConfigurationAccessEndpointSpec: coreClient.CompositeMapper = { +export const Metadata: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ConfigurationAccessEndpointSpec", + className: "Metadata", modelProperties: { - endpoint: { - serializedName: "endpoint", + provisionedBy: { + serializedName: "provisionedBy", + readOnly: true, + type: { + name: "String" + } + }, + provisionedByResourceId: { + serializedName: "provisionedByResourceId", readOnly: true, type: { name: "String" @@ -5327,31 +6555,62 @@ export const ConfigurationAccessEndpointSpec: coreClient.CompositeMapper = { } }; -export const LogsIngestionEndpointSpec: coreClient.CompositeMapper = { +export const ManagedServiceIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogsIngestionEndpointSpec", + className: "ManagedServiceIdentity", modelProperties: { - endpoint: { - serializedName: "endpoint", + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + tenantId: { + serializedName: "tenantId", readOnly: true, + type: { + name: "Uuid" + } + }, + type: { + serializedName: "type", + required: true, type: { name: "String" } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } + } } } } }; -export const NetworkRuleSet: coreClient.CompositeMapper = { +export const UserAssignedIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkRuleSet", + className: "UserAssignedIdentity", modelProperties: { - publicNetworkAccess: { - serializedName: "publicNetworkAccess", + principalId: { + serializedName: "principalId", + readOnly: true, type: { - name: "String" + name: "Uuid" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "Uuid" } } } @@ -5367,7 +6626,7 @@ export const ErrorResponseCommonV2: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" + className: "ErrorDetailAutoGenerated" } } } @@ -5385,6 +6644,13 @@ export const ResourceForUpdate: coreClient.CompositeMapper = { name: "Dictionary", value: { type: { name: "String" } } } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ResourceForUpdateIdentity" + } } } } @@ -5535,22 +6801,6 @@ export const DataCollectionRuleAssociation: coreClient.CompositeMapper = { } }; -export const Metadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Metadata", - modelProperties: { - provisionedBy: { - serializedName: "provisionedBy", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - export const DataCollectionRuleResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -5604,6 +6854,13 @@ export const DataCollectionRuleResource: coreClient.CompositeMapper = { name: "String" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "DataCollectionRuleResourceIdentity" + } + }, id: { serializedName: "id", readOnly: true, @@ -5902,6 +7159,49 @@ export const DataSourcesSpec: coreClient.CompositeMapper = { } } } + }, + windowsFirewallLogs: { + serializedName: "windowsFirewallLogs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WindowsFirewallLogsDataSource" + } + } + } + }, + prometheusForwarder: { + serializedName: "prometheusForwarder", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrometheusForwarderDataSource" + } + } + } + }, + platformTelemetry: { + serializedName: "platformTelemetry", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PlatformTelemetryDataSource" + } + } + } + }, + dataImports: { + serializedName: "dataImports", + type: { + name: "Composite", + className: "DataSourcesSpecDataImports" + } } } } @@ -6135,143 +7435,34 @@ export const LogFilesDataSource: coreClient.CompositeMapper = { name: "String" } } - } - } -}; - -export const LogFileSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogFileSettings", - modelProperties: { - text: { - serializedName: "text", - type: { - name: "Composite", - className: "LogFileSettingsText" - } - } - } - } -}; - -export const LogFileTextSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogFileTextSettings", - modelProperties: { - recordStartTimestampFormat: { - serializedName: "recordStartTimestampFormat", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const IisLogsDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "IisLogsDataSource", - modelProperties: { - streams: { - serializedName: "streams", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - logDirectories: { - serializedName: "logDirectories", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - name: { - serializedName: "name", - type: { - name: "String" - } - } - } - } -}; - -export const DestinationsSpec: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DestinationsSpec", - modelProperties: { - logAnalytics: { - serializedName: "logAnalytics", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LogAnalyticsDestination" - } - } - } - }, - azureMonitorMetrics: { - serializedName: "azureMonitorMetrics", - type: { - name: "Composite", - className: "DestinationsSpecAzureMonitorMetrics" - } - } - } - } -}; - -export const LogAnalyticsDestination: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogAnalyticsDestination", - modelProperties: { - workspaceResourceId: { - serializedName: "workspaceResourceId", - type: { - name: "String" - } - }, - workspaceId: { - serializedName: "workspaceId", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", + } + } +}; + +export const LogFileSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogFileSettings", + modelProperties: { + text: { + serializedName: "text", type: { - name: "String" + name: "Composite", + className: "LogFileSettingsText" } } } } }; -export const AzureMonitorMetricsDestination: coreClient.CompositeMapper = { +export const LogFileTextSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorMetricsDestination", + className: "LogFileTextSettings", modelProperties: { - name: { - serializedName: "name", + recordStartTimestampFormat: { + serializedName: "recordStartTimestampFormat", + required: true, type: { name: "String" } @@ -6280,13 +7471,14 @@ export const AzureMonitorMetricsDestination: coreClient.CompositeMapper = { } }; -export const DataFlow: coreClient.CompositeMapper = { +export const IisLogsDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataFlow", + className: "IisLogsDataSource", modelProperties: { streams: { serializedName: "streams", + required: true, type: { name: "Sequence", element: { @@ -6296,8 +7488,8 @@ export const DataFlow: coreClient.CompositeMapper = { } } }, - destinations: { - serializedName: "destinations", + logDirectories: { + serializedName: "logDirectories", type: { name: "Sequence", element: { @@ -6307,14 +7499,8 @@ export const DataFlow: coreClient.CompositeMapper = { } } }, - transformKql: { - serializedName: "transformKql", - type: { - name: "String" - } - }, - outputStream: { - serializedName: "outputStream", + name: { + serializedName: "name", type: { name: "String" } @@ -6323,26 +7509,25 @@ export const DataFlow: coreClient.CompositeMapper = { } }; -export const AzureMonitorWorkspaceResourceListResult: coreClient.CompositeMapper = { +export const WindowsFirewallLogsDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceResourceListResult", + className: "WindowsFirewallLogsDataSource", modelProperties: { - value: { - serializedName: "value", + streams: { + serializedName: "streams", required: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "AzureMonitorWorkspaceResource" + name: "String" } } } }, - nextLink: { - serializedName: "nextLink", + name: { + serializedName: "name", type: { name: "String" } @@ -6351,58 +7536,58 @@ export const AzureMonitorWorkspaceResourceListResult: coreClient.CompositeMapper } }; -export const AzureMonitorWorkspace: coreClient.CompositeMapper = { +export const PrometheusForwarderDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspace", + className: "PrometheusForwarderDataSource", modelProperties: { - accountId: { - serializedName: "accountId", - readOnly: true, + streams: { + serializedName: "streams", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - metrics: { - serializedName: "metrics", + labelIncludeFilter: { + serializedName: "labelIncludeFilter", type: { - name: "Composite", - className: "AzureMonitorWorkspaceMetrics" + name: "Dictionary", + value: { type: { name: "String" } } } }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, + name: { + serializedName: "name", type: { name: "String" } - }, - defaultIngestionSettings: { - serializedName: "defaultIngestionSettings", - type: { - name: "Composite", - className: "AzureMonitorWorkspaceDefaultIngestionSettings" - } } } } }; -export const Metrics: coreClient.CompositeMapper = { +export const PlatformTelemetryDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Metrics", + className: "PlatformTelemetryDataSource", modelProperties: { - prometheusQueryEndpoint: { - serializedName: "prometheusQueryEndpoint", - readOnly: true, + streams: { + serializedName: "streams", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - internalId: { - serializedName: "internalId", - readOnly: true, + name: { + serializedName: "name", type: { name: "String" } @@ -6411,175 +7596,233 @@ export const Metrics: coreClient.CompositeMapper = { } }; -export const IngestionSettings: coreClient.CompositeMapper = { +export const DataImportSources: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IngestionSettings", + className: "DataImportSources", modelProperties: { - dataCollectionRuleResourceId: { - serializedName: "dataCollectionRuleResourceId", - readOnly: true, + eventHub: { + serializedName: "eventHub", type: { - name: "String" - } - }, - dataCollectionEndpointResourceId: { - serializedName: "dataCollectionEndpointResourceId", - readOnly: true, - type: { - name: "String" + name: "Composite", + className: "DataImportSourcesEventHub" } } } } }; -export const ResourceAutoGenerated5: coreClient.CompositeMapper = { +export const EventHubDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceAutoGenerated5", + className: "EventHubDataSource", modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, name: { serializedName: "name", - readOnly: true, type: { name: "String" } }, - type: { - serializedName: "type", - readOnly: true, + consumerGroup: { + serializedName: "consumerGroup", type: { name: "String" } }, - systemData: { - serializedName: "systemData", + stream: { + serializedName: "stream", type: { - name: "Composite", - className: "SystemData" + name: "String" } } } } }; -export const ErrorResponseAutoGenerated2: coreClient.CompositeMapper = { +export const DestinationsSpec: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponseAutoGenerated2", + className: "DestinationsSpec", modelProperties: { - error: { - serializedName: "error", + logAnalytics: { + serializedName: "logAnalytics", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogAnalyticsDestination" + } + } + } + }, + monitoringAccounts: { + serializedName: "monitoringAccounts", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitoringAccountDestination" + } + } + } + }, + azureMonitorMetrics: { + serializedName: "azureMonitorMetrics", type: { name: "Composite", - className: "ErrorDetailAutoGenerated" + className: "DestinationsSpecAzureMonitorMetrics" + } + }, + eventHubs: { + serializedName: "eventHubs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventHubDestination" + } + } + } + }, + eventHubsDirect: { + serializedName: "eventHubsDirect", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventHubDirectDestination" + } + } + } + }, + storageBlobsDirect: { + serializedName: "storageBlobsDirect", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageBlobDestination" + } + } + } + }, + storageTablesDirect: { + serializedName: "storageTablesDirect", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageTableDestination" + } + } + } + }, + storageAccounts: { + serializedName: "storageAccounts", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageBlobDestination" + } + } } } } } }; -export const ErrorDetailAutoGenerated: coreClient.CompositeMapper = { +export const LogAnalyticsDestination: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDetailAutoGenerated", + className: "LogAnalyticsDestination", modelProperties: { - code: { - serializedName: "code", - readOnly: true, + workspaceResourceId: { + serializedName: "workspaceResourceId", type: { name: "String" } }, - message: { - serializedName: "message", + workspaceId: { + serializedName: "workspaceId", readOnly: true, type: { name: "String" } }, - target: { - serializedName: "target", - readOnly: true, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const MonitoringAccountDestination: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringAccountDestination", + modelProperties: { + accountResourceId: { + serializedName: "accountResourceId", type: { name: "String" } }, - details: { - serializedName: "details", + accountId: { + serializedName: "accountId", readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetailAutoGenerated" - } - } + name: "String" } }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, + name: { + serializedName: "name", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo" - } - } + name: "String" } } } } }; -export const AzureMonitorWorkspaceResourceForUpdate: coreClient.CompositeMapper = { +export const AzureMonitorMetricsDestination: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceResourceForUpdate", + className: "AzureMonitorMetricsDestination", modelProperties: { - tags: { - serializedName: "tags", + name: { + serializedName: "name", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } } } } }; -export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { +export const EventHubDestination: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResultAutoGenerated", + className: "EventHubDestination", modelProperties: { - value: { - serializedName: "value", - readOnly: true, + eventHubResourceId: { + serializedName: "eventHubResourceId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OperationAutoGenerated" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", - readOnly: true, + name: { + serializedName: "name", type: { name: "String" } @@ -6588,42 +7831,73 @@ export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { } }; -export const OperationAutoGenerated: coreClient.CompositeMapper = { +export const EventHubDirectDestination: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationAutoGenerated", + className: "EventHubDirectDestination", modelProperties: { + eventHubResourceId: { + serializedName: "eventHubResourceId", + type: { + name: "String" + } + }, name: { serializedName: "name", - readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const StorageBlobDestination: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageBlobDestination", + modelProperties: { + containerName: { + serializedName: "containerName", type: { name: "String" } }, - isDataAction: { - serializedName: "isDataAction", - readOnly: true, + storageAccountResourceId: { + serializedName: "storageAccountResourceId", type: { - name: "Boolean" + name: "String" } }, - display: { - serializedName: "display", + name: { + serializedName: "name", type: { - name: "Composite", - className: "OperationDisplayAutoGenerated" + name: "String" + } + } + } + } +}; + +export const StorageTableDestination: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageTableDestination", + modelProperties: { + tableName: { + serializedName: "tableName", + type: { + name: "String" } }, - origin: { - serializedName: "origin", - readOnly: true, + storageAccountResourceId: { + serializedName: "storageAccountResourceId", type: { name: "String" } }, - actionType: { - serializedName: "actionType", - readOnly: true, + name: { + serializedName: "name", type: { name: "String" } @@ -6632,35 +7906,47 @@ export const OperationAutoGenerated: coreClient.CompositeMapper = { } }; -export const OperationDisplayAutoGenerated: coreClient.CompositeMapper = { +export const DataFlow: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplayAutoGenerated", + className: "DataFlow", modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, + streams: { + serializedName: "streams", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - resource: { - serializedName: "resource", - readOnly: true, + destinations: { + serializedName: "destinations", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + transformKql: { + serializedName: "transformKql", type: { name: "String" } }, - operation: { - serializedName: "operation", - readOnly: true, + outputStream: { + serializedName: "outputStream", type: { name: "String" } }, - description: { - serializedName: "description", - readOnly: true, + builtInTransform: { + serializedName: "builtInTransform", type: { name: "String" } @@ -6754,90 +8040,216 @@ export const MultiMetricCriteria: coreClient.CompositeMapper = { metricNamespace: { serializedName: "metricNamespace", type: { - name: "String" + name: "String" + } + }, + timeAggregation: { + serializedName: "timeAggregation", + required: true, + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricDimension" + } + } + } + }, + skipMetricValidation: { + serializedName: "skipMetricValidation", + type: { + name: "Boolean" + } + } + } + } +}; + +export const MetricDimension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricDimension", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + operator: { + serializedName: "operator", + required: true, + type: { + name: "String" + } + }, + values: { + serializedName: "values", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DynamicThresholdFailingPeriods: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DynamicThresholdFailingPeriods", + modelProperties: { + numberOfEvaluationPeriods: { + serializedName: "numberOfEvaluationPeriods", + required: true, + type: { + name: "Number" + } + }, + minFailingPeriodsToAlert: { + serializedName: "minFailingPeriodsToAlert", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const AzureMonitorWorkspaceResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureMonitorWorkspaceResourceProperties", + modelProperties: { + ...AzureMonitorWorkspace.type.modelProperties + } + } +}; + +export const AzureMonitorWorkspaceMetrics: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureMonitorWorkspaceMetrics", + modelProperties: { + ...Metrics.type.modelProperties + } + } +}; + +export const AzureMonitorWorkspaceDefaultIngestionSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureMonitorWorkspaceDefaultIngestionSettings", + modelProperties: { + ...IngestionSettings.type.modelProperties + } + } +}; + +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...Resource.type.modelProperties, + groupIds: { + serializedName: "properties.groupIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - timeAggregation: { - serializedName: "timeAggregation", - required: true, + privateEndpoint: { + serializedName: "properties.privateEndpoint", type: { - name: "String" + name: "Composite", + className: "PrivateEndpoint" } }, - dimensions: { - serializedName: "dimensions", + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricDimension" - } - } + name: "Composite", + className: "PrivateLinkServiceConnectionState" } }, - skipMetricValidation: { - serializedName: "skipMetricValidation", + provisioningState: { + serializedName: "properties.provisioningState", type: { - name: "Boolean" + name: "String" } } } } }; -export const MetricDimension: coreClient.CompositeMapper = { +export const DataCollectionEndpointResourceSystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricDimension", + className: "DataCollectionEndpointResourceSystemData", modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - operator: { - serializedName: "operator", - required: true, - type: { - name: "String" - } - }, - values: { - serializedName: "values", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } + ...SystemData.type.modelProperties } } }; -export const DynamicThresholdFailingPeriods: coreClient.CompositeMapper = { +export const DataCollectionRuleAssociationProxyOnlyResourceSystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DynamicThresholdFailingPeriods", + className: "DataCollectionRuleAssociationProxyOnlyResourceSystemData", modelProperties: { - numberOfEvaluationPeriods: { - serializedName: "numberOfEvaluationPeriods", - required: true, + ...SystemData.type.modelProperties + } + } +}; + +export const DataCollectionRuleResourceSystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionRuleResourceSystemData", + modelProperties: { + ...SystemData.type.modelProperties + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...ResourceAutoGenerated.type.modelProperties, + tags: { + serializedName: "tags", type: { - name: "Number" + name: "Dictionary", + value: { type: { name: "String" } } } }, - minFailingPeriodsToAlert: { - serializedName: "minFailingPeriodsToAlert", + location: { + serializedName: "location", required: true, type: { - name: "Number" + name: "String" } } } @@ -6849,7 +8261,7 @@ export const AutoscaleSettingResource: coreClient.CompositeMapper = { name: "Composite", className: "AutoscaleSettingResource", modelProperties: { - ...Resource.type.modelProperties, + ...ResourceAutoGenerated2.type.modelProperties, profiles: { constraints: { MaxItems: 20 @@ -6914,36 +8326,6 @@ export const AutoscaleSettingResource: coreClient.CompositeMapper = { } }; -export const DataCollectionEndpointResourceSystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionEndpointResourceSystemData", - modelProperties: { - ...SystemData.type.modelProperties - } - } -}; - -export const DataCollectionRuleAssociationProxyOnlyResourceSystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResourceSystemData", - modelProperties: { - ...SystemData.type.modelProperties - } - } -}; - -export const DataCollectionRuleResourceSystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionRuleResourceSystemData", - modelProperties: { - ...SystemData.type.modelProperties - } - } -}; - export const ThresholdRuleCondition: coreClient.CompositeMapper = { serializedName: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", @@ -7194,7 +8576,7 @@ export const AlertRuleResource: coreClient.CompositeMapper = { name: "Composite", className: "AlertRuleResource", modelProperties: { - ...ResourceAutoGenerated.type.modelProperties, + ...ResourceAutoGenerated3.type.modelProperties, namePropertiesName: { serializedName: "properties.name", required: true, @@ -7263,7 +8645,7 @@ export const LogProfileResource: coreClient.CompositeMapper = { name: "Composite", className: "LogProfileResource", modelProperties: { - ...ResourceAutoGenerated2.type.modelProperties, + ...ResourceAutoGenerated4.type.modelProperties, storageAccountId: { serializedName: "properties.storageAccountId", type: { @@ -7316,7 +8698,7 @@ export const DiagnosticSettingsResource: coreClient.CompositeMapper = { name: "Composite", className: "DiagnosticSettingsResource", modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties, + ...ResourceAutoGenerated5.type.modelProperties, systemData: { serializedName: "systemData", type: { @@ -7399,7 +8781,7 @@ export const DiagnosticSettingsCategoryResource: coreClient.CompositeMapper = { name: "Composite", className: "DiagnosticSettingsCategoryResource", modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties, + ...ResourceAutoGenerated5.type.modelProperties, systemData: { serializedName: "systemData", type: { @@ -7428,17 +8810,17 @@ export const DiagnosticSettingsCategoryResource: coreClient.CompositeMapper = { } }; -export const PrivateEndpointConnection: coreClient.CompositeMapper = { +export const PrivateEndpointConnectionAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpointConnection", + className: "PrivateEndpointConnectionAutoGenerated", modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties, + ...ResourceAutoGenerated5.type.modelProperties, privateEndpoint: { serializedName: "properties.privateEndpoint", type: { name: "Composite", - className: "PrivateEndpoint" + className: "PrivateEndpointAutoGenerated" } }, privateLinkServiceConnectionState: { @@ -7450,7 +8832,6 @@ export const PrivateEndpointConnection: coreClient.CompositeMapper = { }, provisioningState: { serializedName: "properties.provisioningState", - readOnly: true, type: { name: "String" } @@ -7459,12 +8840,12 @@ export const PrivateEndpointConnection: coreClient.CompositeMapper = { } }; -export const TrackedResource: coreClient.CompositeMapper = { +export const TrackedResourceAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "TrackedResourceAutoGenerated", modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties, + ...ResourceAutoGenerated5.type.modelProperties, tags: { serializedName: "tags", type: { @@ -7488,7 +8869,7 @@ export const PrivateLinkResource: coreClient.CompositeMapper = { name: "Composite", className: "PrivateLinkResource", modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties, + ...ResourceAutoGenerated5.type.modelProperties, groupId: { serializedName: "properties.groupId", readOnly: true, @@ -7528,7 +8909,7 @@ export const ProxyResourceAutoGenerated: coreClient.CompositeMapper = { name: "Composite", className: "ProxyResourceAutoGenerated", modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties + ...ResourceAutoGenerated5.type.modelProperties } } }; @@ -7606,83 +8987,169 @@ export const ActionGroupResource: coreClient.CompositeMapper = { azureAppPushReceivers: { serializedName: "properties.azureAppPushReceivers", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzureAppPushReceiver" - } - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureAppPushReceiver" + } + } + } + }, + automationRunbookReceivers: { + serializedName: "properties.automationRunbookReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutomationRunbookReceiver" + } + } + } + }, + voiceReceivers: { + serializedName: "properties.voiceReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VoiceReceiver" + } + } + } + }, + logicAppReceivers: { + serializedName: "properties.logicAppReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogicAppReceiver" + } + } + } + }, + azureFunctionReceivers: { + serializedName: "properties.azureFunctionReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureFunctionReceiver" + } + } + } + }, + armRoleReceivers: { + serializedName: "properties.armRoleReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArmRoleReceiver" + } + } + } + }, + eventHubReceivers: { + serializedName: "properties.eventHubReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventHubReceiver" + } + } + } + } + } + } +}; + +export const TenantActionGroupResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TenantActionGroupResource", + modelProperties: { + ...AzureResource.type.modelProperties, + groupShortName: { + constraints: { + MaxLength: 12 + }, + serializedName: "properties.groupShortName", + type: { + name: "String" } }, - automationRunbookReceivers: { - serializedName: "properties.automationRunbookReceivers", + enabled: { + defaultValue: true, + serializedName: "properties.enabled", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutomationRunbookReceiver" - } - } + name: "Boolean" } }, - voiceReceivers: { - serializedName: "properties.voiceReceivers", + emailReceivers: { + serializedName: "properties.emailReceivers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "VoiceReceiver" + className: "EmailReceiverAutoGenerated" } } } }, - logicAppReceivers: { - serializedName: "properties.logicAppReceivers", + smsReceivers: { + serializedName: "properties.smsReceivers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "LogicAppReceiver" + className: "SmsReceiverAutoGenerated" } } } }, - azureFunctionReceivers: { - serializedName: "properties.azureFunctionReceivers", + webhookReceivers: { + serializedName: "properties.webhookReceivers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "AzureFunctionReceiver" + className: "WebhookReceiverAutoGenerated" } } } }, - armRoleReceivers: { - serializedName: "properties.armRoleReceivers", + azureAppPushReceivers: { + serializedName: "properties.azureAppPushReceivers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ArmRoleReceiver" + className: "AzureAppPushReceiverAutoGenerated" } } } }, - eventHubReceivers: { - serializedName: "properties.eventHubReceivers", + voiceReceivers: { + serializedName: "properties.voiceReceivers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "EventHubReceiver" + className: "VoiceReceiverAutoGenerated" } } } @@ -7785,7 +9252,7 @@ export const MetricAlertResource: coreClient.CompositeMapper = { name: "Composite", className: "MetricAlertResource", modelProperties: { - ...ResourceAutoGenerated4.type.modelProperties, + ...ResourceAutoGenerated6.type.modelProperties, description: { serializedName: "properties.description", type: { @@ -8027,6 +9494,16 @@ export const DataCollectionEndpointLogsIngestion: coreClient.CompositeMapper = { } }; +export const DataCollectionEndpointMetricsIngestion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionEndpointMetricsIngestion", + modelProperties: { + ...MetricsIngestionEndpointSpec.type.modelProperties + } + } +}; + export const DataCollectionEndpointNetworkAcls: coreClient.CompositeMapper = { type: { name: "Composite", @@ -8037,12 +9514,22 @@ export const DataCollectionEndpointNetworkAcls: coreClient.CompositeMapper = { } }; -export const DataCollectionRuleAssociationProxyOnlyResourceProperties: coreClient.CompositeMapper = { +export const DataCollectionEndpointFailoverConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResourceProperties", + className: "DataCollectionEndpointFailoverConfiguration", modelProperties: { - ...DataCollectionRuleAssociation.type.modelProperties + ...FailoverConfigurationSpec.type.modelProperties + } + } +}; + +export const DataCollectionEndpointMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionEndpointMetadata", + modelProperties: { + ...Metadata.type.modelProperties } } }; @@ -8067,116 +9554,122 @@ export const DataCollectionRuleMetadata: coreClient.CompositeMapper = { } }; -export const DataCollectionRuleResourceProperties: coreClient.CompositeMapper = { +export const DataCollectionEndpointResourceIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleResourceProperties", + className: "DataCollectionEndpointResourceIdentity", modelProperties: { - ...DataCollectionRule.type.modelProperties + ...ManagedServiceIdentity.type.modelProperties } } }; -export const DataCollectionRuleDataSources: coreClient.CompositeMapper = { +export const ResourceForUpdateIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleDataSources", + className: "ResourceForUpdateIdentity", modelProperties: { - ...DataSourcesSpec.type.modelProperties + ...ManagedServiceIdentity.type.modelProperties } } }; -export const LogFilesDataSourceSettings: coreClient.CompositeMapper = { +export const DataCollectionRuleResourceIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogFilesDataSourceSettings", + className: "DataCollectionRuleResourceIdentity", modelProperties: { - ...LogFileSettings.type.modelProperties + ...ManagedServiceIdentity.type.modelProperties } } }; -export const LogFileSettingsText: coreClient.CompositeMapper = { +export const DataCollectionRuleAssociationProxyOnlyResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogFileSettingsText", + className: "DataCollectionRuleAssociationProxyOnlyResourceProperties", modelProperties: { - ...LogFileTextSettings.type.modelProperties + ...DataCollectionRuleAssociation.type.modelProperties } } }; -export const DataCollectionRuleDestinations: coreClient.CompositeMapper = { +export const DataCollectionRuleResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleDestinations", + className: "DataCollectionRuleResourceProperties", modelProperties: { - ...DestinationsSpec.type.modelProperties + ...DataCollectionRule.type.modelProperties } } }; -export const DestinationsSpecAzureMonitorMetrics: coreClient.CompositeMapper = { +export const DataCollectionRuleDataSources: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DestinationsSpecAzureMonitorMetrics", + className: "DataCollectionRuleDataSources", modelProperties: { - ...AzureMonitorMetricsDestination.type.modelProperties + ...DataSourcesSpec.type.modelProperties } } }; -export const AzureMonitorWorkspaceResourceProperties: coreClient.CompositeMapper = { +export const LogFilesDataSourceSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceResourceProperties", + className: "LogFilesDataSourceSettings", modelProperties: { - ...AzureMonitorWorkspace.type.modelProperties + ...LogFileSettings.type.modelProperties } } }; -export const AzureMonitorWorkspaceMetrics: coreClient.CompositeMapper = { +export const LogFileSettingsText: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceMetrics", + className: "LogFileSettingsText", modelProperties: { - ...Metrics.type.modelProperties + ...LogFileTextSettings.type.modelProperties } } }; -export const AzureMonitorWorkspaceDefaultIngestionSettings: coreClient.CompositeMapper = { +export const DataSourcesSpecDataImports: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceDefaultIngestionSettings", + className: "DataSourcesSpecDataImports", modelProperties: { - ...IngestionSettings.type.modelProperties + ...DataImportSources.type.modelProperties } } }; -export const TrackedResourceAutoGenerated: coreClient.CompositeMapper = { +export const DataImportSourcesEventHub: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResourceAutoGenerated", + className: "DataImportSourcesEventHub", modelProperties: { - ...ResourceAutoGenerated5.type.modelProperties, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String" - } - } + ...EventHubDataSource.type.modelProperties + } + } +}; + +export const DataCollectionRuleDestinations: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionRuleDestinations", + modelProperties: { + ...DestinationsSpec.type.modelProperties + } + } +}; + +export const DestinationsSpecAzureMonitorMetrics: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DestinationsSpecAzureMonitorMetrics", + modelProperties: { + ...AzureMonitorMetricsDestination.type.modelProperties } } }; @@ -8250,17 +9743,31 @@ export const DynamicMetricCriteria: coreClient.CompositeMapper = { } }; -export const AzureMonitorPrivateLinkScope: coreClient.CompositeMapper = { +export const AzureMonitorWorkspaceResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorPrivateLinkScope", + className: "AzureMonitorWorkspaceResource", modelProperties: { ...TrackedResource.type.modelProperties, - systemData: { - serializedName: "systemData", + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + }, + accountId: { + serializedName: "properties.accountId", + readOnly: true, + type: { + name: "String" + } + }, + metrics: { + serializedName: "properties.metrics", type: { name: "Composite", - className: "SystemData" + className: "AzureMonitorWorkspaceMetrics" } }, provisioningState: { @@ -8270,6 +9777,13 @@ export const AzureMonitorPrivateLinkScope: coreClient.CompositeMapper = { name: "String" } }, + defaultIngestionSettings: { + serializedName: "properties.defaultIngestionSettings", + type: { + name: "Composite", + className: "AzureMonitorWorkspaceDefaultIngestionSettings" + } + }, privateEndpointConnections: { serializedName: "properties.privateEndpointConnections", readOnly: true, @@ -8283,23 +9797,23 @@ export const AzureMonitorPrivateLinkScope: coreClient.CompositeMapper = { } } }, - accessModeSettings: { - serializedName: "properties.accessModeSettings", + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", + readOnly: true, type: { - name: "Composite", - className: "AccessModeSettings" + name: "String" } } } } }; -export const ScopedResource: coreClient.CompositeMapper = { +export const AzureMonitorPrivateLinkScope: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ScopedResource", + className: "AzureMonitorPrivateLinkScope", modelProperties: { - ...ProxyResourceAutoGenerated.type.modelProperties, + ...TrackedResourceAutoGenerated.type.modelProperties, systemData: { serializedName: "systemData", type: { @@ -8307,88 +9821,78 @@ export const ScopedResource: coreClient.CompositeMapper = { className: "SystemData" } }, - linkedResourceId: { - serializedName: "properties.linkedResourceId", + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } }, - provisioningState: { - serializedName: "properties.provisioningState", + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnectionAutoGenerated" + } + } + } + }, + accessModeSettings: { + serializedName: "properties.accessModeSettings", + type: { + name: "Composite", + className: "AccessModeSettings" } } } } }; -export const AzureMonitorWorkspaceResource: coreClient.CompositeMapper = { +export const ScopedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceResource", + className: "ScopedResource", modelProperties: { - ...TrackedResourceAutoGenerated.type.modelProperties, - etag: { - serializedName: "etag", - readOnly: true, + ...ProxyResourceAutoGenerated.type.modelProperties, + systemData: { + serializedName: "systemData", type: { - name: "String" + name: "Composite", + className: "SystemData" } }, - accountId: { - serializedName: "properties.accountId", - readOnly: true, + linkedResourceId: { + serializedName: "properties.linkedResourceId", type: { name: "String" } }, - metrics: { - serializedName: "properties.metrics", - type: { - name: "Composite", - className: "AzureMonitorWorkspaceMetrics" - } - }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { name: "String" } - }, - defaultIngestionSettings: { - serializedName: "properties.defaultIngestionSettings", - type: { - name: "Composite", - className: "AzureMonitorWorkspaceDefaultIngestionSettings" - } } } } }; -export const ActionGroupsPostTestNotificationsHeaders: coreClient.CompositeMapper = { +export const AzureMonitorWorkspacesDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionGroupsPostTestNotificationsHeaders", + className: "AzureMonitorWorkspacesDeleteHeaders", modelProperties: { - location: { - serializedName: "location", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { name: "String" } - } - } - } -}; - -export const ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders", - modelProperties: { + }, location: { serializedName: "location", type: { diff --git a/sdk/monitor/arm-monitor/src/models/parameters.ts b/sdk/monitor/arm-monitor/src/models/parameters.ts index 720e12797aa6..af42dca72f09 100644 --- a/sdk/monitor/arm-monitor/src/models/parameters.ts +++ b/sdk/monitor/arm-monitor/src/models/parameters.ts @@ -12,6 +12,8 @@ import { OperationQueryParameter } from "@azure/core-client"; import { + AzureMonitorWorkspaceResource as AzureMonitorWorkspaceResourceMapper, + AzureMonitorWorkspaceResourceForUpdate as AzureMonitorWorkspaceResourceForUpdateMapper, AutoscaleSettingResource as AutoscaleSettingResourceMapper, AutoscaleSettingResourcePatch as AutoscaleSettingResourcePatchMapper, AlertRuleResource as AlertRuleResourceMapper, @@ -23,22 +25,23 @@ import { ActionGroupPatchBody as ActionGroupPatchBodyMapper, NotificationRequestBody as NotificationRequestBodyMapper, EnableRequest as EnableRequestMapper, + TenantActionGroupResource as TenantActionGroupResourceMapper, + ActionGroupPatchBodyAutoGenerated as ActionGroupPatchBodyAutoGeneratedMapper, + SubscriptionScopeMetricsRequestBodyParameters as SubscriptionScopeMetricsRequestBodyParametersMapper, MetricAlertResource as MetricAlertResourceMapper, MetricAlertResourcePatch as MetricAlertResourcePatchMapper, ScheduledQueryRuleResource as ScheduledQueryRuleResourceMapper, ScheduledQueryRuleResourcePatch as ScheduledQueryRuleResourcePatchMapper, AzureMonitorPrivateLinkScope as AzureMonitorPrivateLinkScopeMapper, TagsResource as TagsResourceMapper, - PrivateEndpointConnection as PrivateEndpointConnectionMapper, + PrivateEndpointConnectionAutoGenerated as PrivateEndpointConnectionAutoGeneratedMapper, ScopedResource as ScopedResourceMapper, ActivityLogAlertResource as ActivityLogAlertResourceMapper, AlertRulePatchObject as AlertRulePatchObjectMapper, DataCollectionEndpointResource as DataCollectionEndpointResourceMapper, ResourceForUpdate as ResourceForUpdateMapper, DataCollectionRuleAssociationProxyOnlyResource as DataCollectionRuleAssociationProxyOnlyResourceMapper, - DataCollectionRuleResource as DataCollectionRuleResourceMapper, - AzureMonitorWorkspaceResource as AzureMonitorWorkspaceResourceMapper, - AzureMonitorWorkspaceResourceForUpdate as AzureMonitorWorkspaceResourceForUpdateMapper + DataCollectionRuleResource as DataCollectionRuleResourceMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -65,6 +68,20 @@ export const $host: OperationURLParameter = { skipEncoding: true }; +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { @@ -83,7 +100,7 @@ export const resourceGroupName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-10-01", + defaultValue: "2023-04-03", isConstant: true, serializedName: "api-version", type: { @@ -92,13 +109,13 @@ export const apiVersion: OperationQueryParameter = { } }; -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", +export const azureMonitorWorkspaceName: OperationURLParameter = { + parameterPath: "azureMonitorWorkspaceName", mapper: { constraints: { - MinLength: 1 + Pattern: new RegExp("^(?!-)[a-zA-Z0-9-]+[^-]$") }, - serializedName: "subscriptionId", + serializedName: "azureMonitorWorkspaceName", required: true, type: { name: "String" @@ -118,6 +135,40 @@ export const contentType: OperationParameter = { } }; +export const azureMonitorWorkspaceProperties: OperationParameter = { + parameterPath: "azureMonitorWorkspaceProperties", + mapper: AzureMonitorWorkspaceResourceMapper +}; + +export const azureMonitorWorkspaceProperties1: OperationParameter = { + parameterPath: ["options", "azureMonitorWorkspaceProperties"], + mapper: AzureMonitorWorkspaceResourceForUpdateMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion1: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-10-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + export const parameters: OperationParameter = { parameterPath: "parameters", mapper: AutoscaleSettingResourceMapper @@ -139,18 +190,6 @@ export const autoscaleSettingResource: OperationParameter = { mapper: AutoscaleSettingResourcePatchMapper }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - export const timespan: OperationQueryParameter = { parameterPath: "timespan", mapper: { @@ -206,7 +245,7 @@ export const aggregation: OperationQueryParameter = { } }; -export const apiVersion1: OperationQueryParameter = { +export const apiVersion2: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2015-04-01", @@ -240,7 +279,7 @@ export const incidentName: OperationURLParameter = { } }; -export const apiVersion2: OperationQueryParameter = { +export const apiVersion3: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2016-03-01", @@ -295,7 +334,7 @@ export const resourceUri: OperationURLParameter = { skipEncoding: true }; -export const apiVersion3: OperationQueryParameter = { +export const apiVersion4: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2021-05-01-preview", @@ -339,10 +378,10 @@ export const actionGroupName: OperationURLParameter = { } }; -export const apiVersion4: OperationQueryParameter = { +export const apiVersion5: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-06-01", + defaultValue: "2023-01-01", isConstant: true, serializedName: "api-version", type: { @@ -377,6 +416,61 @@ export const enableRequest: OperationParameter = { mapper: EnableRequestMapper }; +export const actionGroup1: OperationParameter = { + parameterPath: "actionGroup", + mapper: TenantActionGroupResourceMapper +}; + +export const managementGroupId: OperationURLParameter = { + parameterPath: "managementGroupId", + mapper: { + serializedName: "managementGroupId", + required: true, + type: { + name: "String" + } + } +}; + +export const tenantActionGroupName: OperationURLParameter = { + parameterPath: "tenantActionGroupName", + mapper: { + serializedName: "tenantActionGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const xMsClientTenantId: OperationParameter = { + parameterPath: "xMsClientTenantId", + mapper: { + serializedName: "x-ms-client-tenant-id", + required: true, + type: { + name: "String" + } + } +}; + +export const apiVersion6: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2023-03-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const tenantActionGroupPatch: OperationParameter = { + parameterPath: "tenantActionGroupPatch", + mapper: ActionGroupPatchBodyAutoGeneratedMapper +}; + export const filter: OperationQueryParameter = { parameterPath: "filter", mapper: { @@ -408,10 +502,10 @@ export const filter1: OperationQueryParameter = { } }; -export const apiVersion5: OperationQueryParameter = { +export const apiVersion7: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2018-01-01", + defaultValue: "2021-05-01", isConstant: true, serializedName: "api-version", type: { @@ -420,6 +514,17 @@ export const apiVersion5: OperationQueryParameter = { } }; +export const region: OperationQueryParameter = { + parameterPath: "region", + mapper: { + serializedName: "region", + required: true, + type: { + name: "String" + } + } +}; + export const metricnamespace: OperationQueryParameter = { parameterPath: ["options", "metricnamespace"], mapper: { @@ -491,6 +596,41 @@ export const orderby: OperationQueryParameter = { }; export const resultType: OperationQueryParameter = { + parameterPath: ["options", "resultType"], + mapper: { + serializedName: "resultType", + type: { + name: "String" + } + } +}; + +export const autoAdjustTimegrain: OperationQueryParameter = { + parameterPath: ["options", "autoAdjustTimegrain"], + mapper: { + serializedName: "AutoAdjustTimegrain", + type: { + name: "Boolean" + } + } +}; + +export const validateDimensions: OperationQueryParameter = { + parameterPath: ["options", "validateDimensions"], + mapper: { + serializedName: "ValidateDimensions", + type: { + name: "Boolean" + } + } +}; + +export const body: OperationParameter = { + parameterPath: ["options", "body"], + mapper: SubscriptionScopeMetricsRequestBodyParametersMapper +}; + +export const resultType1: OperationQueryParameter = { parameterPath: ["options", "resultType"], mapper: { serializedName: "resultType", @@ -511,7 +651,7 @@ export const sensitivities: OperationQueryParameter = { } }; -export const apiVersion6: OperationQueryParameter = { +export const apiVersion8: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2019-03-01", @@ -523,7 +663,7 @@ export const apiVersion6: OperationQueryParameter = { } }; -export const apiVersion7: OperationQueryParameter = { +export const apiVersion9: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2018-03-01", @@ -556,7 +696,7 @@ export const statusName: OperationURLParameter = { } }; -export const apiVersion8: OperationQueryParameter = { +export const apiVersion10: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2022-08-01-preview", @@ -578,7 +718,7 @@ export const parameters7: OperationParameter = { mapper: ScheduledQueryRuleResourcePatchMapper }; -export const apiVersion9: OperationQueryParameter = { +export const apiVersion11: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2017-12-01-preview", @@ -600,7 +740,7 @@ export const startTime: OperationQueryParameter = { } }; -export const apiVersion10: OperationQueryParameter = { +export const apiVersion12: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2018-11-27-preview", @@ -612,7 +752,7 @@ export const apiVersion10: OperationQueryParameter = { } }; -export const apiVersion11: OperationQueryParameter = { +export const apiVersion13: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2021-07-01-preview", @@ -680,7 +820,7 @@ export const privateEndpointConnectionName: OperationURLParameter = { export const parameters8: OperationParameter = { parameterPath: "parameters", - mapper: PrivateEndpointConnectionMapper + mapper: PrivateEndpointConnectionAutoGeneratedMapper }; export const parameters9: OperationParameter = { @@ -704,7 +844,7 @@ export const activityLogAlertName: OperationURLParameter = { } }; -export const apiVersion12: OperationQueryParameter = { +export const apiVersion14: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2020-10-01", @@ -721,10 +861,10 @@ export const activityLogAlertRulePatch: OperationParameter = { mapper: AlertRulePatchObjectMapper }; -export const apiVersion13: OperationQueryParameter = { +export const apiVersion15: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-09-01-preview", + defaultValue: "2022-06-01", isConstant: true, serializedName: "api-version", type: { @@ -744,12 +884,12 @@ export const dataCollectionEndpointName: OperationURLParameter = { } }; -export const body: OperationParameter = { +export const body1: OperationParameter = { parameterPath: ["options", "body"], mapper: DataCollectionEndpointResourceMapper }; -export const body1: OperationParameter = { +export const body2: OperationParameter = { parameterPath: ["options", "body"], mapper: ResourceForUpdateMapper }; @@ -791,48 +931,12 @@ export const associationName: OperationURLParameter = { } }; -export const body2: OperationParameter = { +export const body3: OperationParameter = { parameterPath: ["options", "body"], mapper: DataCollectionRuleAssociationProxyOnlyResourceMapper }; -export const body3: OperationParameter = { +export const body4: OperationParameter = { parameterPath: ["options", "body"], mapper: DataCollectionRuleResourceMapper }; - -export const apiVersion14: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2021-06-03-preview", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } -}; - -export const azureMonitorWorkspaceName: OperationURLParameter = { - parameterPath: "azureMonitorWorkspaceName", - mapper: { - constraints: { - Pattern: new RegExp("^(?!-)[a-zA-Z0-9-]+[^-]$") - }, - serializedName: "azureMonitorWorkspaceName", - required: true, - type: { - name: "String" - } - } -}; - -export const azureMonitorWorkspaceProperties: OperationParameter = { - parameterPath: "azureMonitorWorkspaceProperties", - mapper: AzureMonitorWorkspaceResourceMapper -}; - -export const azureMonitorWorkspaceProperties1: OperationParameter = { - parameterPath: ["options", "azureMonitorWorkspaceProperties"], - mapper: AzureMonitorWorkspaceResourceForUpdateMapper -}; diff --git a/sdk/monitor/arm-monitor/src/monitorClient.ts b/sdk/monitor/arm-monitor/src/monitorClient.ts index 8484a12bf8d9..9a5152a2bfc4 100644 --- a/sdk/monitor/arm-monitor/src/monitorClient.ts +++ b/sdk/monitor/arm-monitor/src/monitorClient.ts @@ -10,6 +10,8 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { + AzureMonitorWorkspacesImpl, + MonitorOperationsImpl, AutoscaleSettingsImpl, PredictiveMetricImpl, OperationsImpl, @@ -19,6 +21,7 @@ import { DiagnosticSettingsImpl, DiagnosticSettingsCategoryImpl, ActionGroupsImpl, + TenantActionGroupsImpl, ActivityLogsImpl, EventCategoriesImpl, TenantActivityLogsImpl, @@ -38,11 +41,11 @@ import { ActivityLogAlertsImpl, DataCollectionEndpointsImpl, DataCollectionRuleAssociationsImpl, - DataCollectionRulesImpl, - AzureMonitorWorkspacesImpl, - MonitorOperationsImpl + DataCollectionRulesImpl } from "./operations"; import { + AzureMonitorWorkspaces, + MonitorOperations, AutoscaleSettings, PredictiveMetric, Operations, @@ -52,6 +55,7 @@ import { DiagnosticSettings, DiagnosticSettingsCategory, ActionGroups, + TenantActionGroups, ActivityLogs, EventCategories, TenantActivityLogs, @@ -71,9 +75,7 @@ import { ActivityLogAlerts, DataCollectionEndpoints, DataCollectionRuleAssociations, - DataCollectionRules, - AzureMonitorWorkspaces, - MonitorOperations + DataCollectionRules } from "./operationsInterfaces"; import { MonitorClientOptionalParams } from "./models"; @@ -161,6 +163,8 @@ export class MonitorClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; + this.azureMonitorWorkspaces = new AzureMonitorWorkspacesImpl(this); + this.monitorOperations = new MonitorOperationsImpl(this); this.autoscaleSettings = new AutoscaleSettingsImpl(this); this.predictiveMetric = new PredictiveMetricImpl(this); this.operations = new OperationsImpl(this); @@ -170,6 +174,7 @@ export class MonitorClient extends coreClient.ServiceClient { this.diagnosticSettings = new DiagnosticSettingsImpl(this); this.diagnosticSettingsCategory = new DiagnosticSettingsCategoryImpl(this); this.actionGroups = new ActionGroupsImpl(this); + this.tenantActionGroups = new TenantActionGroupsImpl(this); this.activityLogs = new ActivityLogsImpl(this); this.eventCategories = new EventCategoriesImpl(this); this.tenantActivityLogs = new TenantActivityLogsImpl(this); @@ -194,10 +199,10 @@ export class MonitorClient extends coreClient.ServiceClient { this ); this.dataCollectionRules = new DataCollectionRulesImpl(this); - this.azureMonitorWorkspaces = new AzureMonitorWorkspacesImpl(this); - this.monitorOperations = new MonitorOperationsImpl(this); } + azureMonitorWorkspaces: AzureMonitorWorkspaces; + monitorOperations: MonitorOperations; autoscaleSettings: AutoscaleSettings; predictiveMetric: PredictiveMetric; operations: Operations; @@ -207,6 +212,7 @@ export class MonitorClient extends coreClient.ServiceClient { diagnosticSettings: DiagnosticSettings; diagnosticSettingsCategory: DiagnosticSettingsCategory; actionGroups: ActionGroups; + tenantActionGroups: TenantActionGroups; activityLogs: ActivityLogs; eventCategories: EventCategories; tenantActivityLogs: TenantActivityLogs; @@ -227,6 +233,4 @@ export class MonitorClient extends coreClient.ServiceClient { dataCollectionEndpoints: DataCollectionEndpoints; dataCollectionRuleAssociations: DataCollectionRuleAssociations; dataCollectionRules: DataCollectionRules; - azureMonitorWorkspaces: AzureMonitorWorkspaces; - monitorOperations: MonitorOperations; } diff --git a/sdk/monitor/arm-monitor/src/operations/actionGroups.ts b/sdk/monitor/arm-monitor/src/operations/actionGroups.ts index 586c206a12e9..6862bea6c5bd 100644 --- a/sdk/monitor/arm-monitor/src/operations/actionGroups.ts +++ b/sdk/monitor/arm-monitor/src/operations/actionGroups.ts @@ -33,16 +33,8 @@ import { ActionGroupsUpdateOptionalParams, ActionGroupsUpdateResponse, NotificationRequestBody, - ActionGroupsPostTestNotificationsOptionalParams, - ActionGroupsPostTestNotificationsResponse, - ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams, - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse, ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams, ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse, - ActionGroupsGetTestNotificationsOptionalParams, - ActionGroupsGetTestNotificationsResponse, - ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams, - ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse, ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams, ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse, EnableRequest, @@ -227,187 +219,6 @@ export class ActionGroupsImpl implements ActionGroups { ); } - /** - * Send test notifications to a set of provided receivers - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - async beginPostTestNotifications( - notificationRequest: NotificationRequestBody, - options?: ActionGroupsPostTestNotificationsOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - ActionGroupsPostTestNotificationsResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { notificationRequest, options }, - spec: postTestNotificationsOperationSpec - }); - const poller = await createHttpPoller< - ActionGroupsPostTestNotificationsResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" - }); - await poller.poll(); - return poller; - } - - /** - * Send test notifications to a set of provided receivers - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - async beginPostTestNotificationsAndWait( - notificationRequest: NotificationRequestBody, - options?: ActionGroupsPostTestNotificationsOptionalParams - ): Promise { - const poller = await this.beginPostTestNotifications( - notificationRequest, - options - ); - return poller.pollUntilDone(); - } - - /** - * Send test notifications to a set of provided receivers - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - async beginCreateNotificationsAtResourceGroupLevel( - resourceGroupName: string, - notificationRequest: NotificationRequestBody, - options?: ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - ): Promise< - SimplePollerLike< - OperationState< - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - >, - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, notificationRequest, options }, - spec: createNotificationsAtResourceGroupLevelOperationSpec - }); - const poller = await createHttpPoller< - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse, - OperationState< - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - > - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" - }); - await poller.poll(); - return poller; - } - - /** - * Send test notifications to a set of provided receivers - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - async beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName: string, - notificationRequest: NotificationRequestBody, - options?: ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - ): Promise { - const poller = await this.beginCreateNotificationsAtResourceGroupLevel( - resourceGroupName, - notificationRequest, - options - ); - return poller.pollUntilDone(); - } - /** * Send test notifications to a set of provided receivers * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -515,38 +326,6 @@ export class ActionGroupsImpl implements ActionGroups { return poller.pollUntilDone(); } - /** - * Get the test notifications by the notification id - * @param notificationId The notification id - * @param options The options parameters. - */ - getTestNotifications( - notificationId: string, - options?: ActionGroupsGetTestNotificationsOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { notificationId, options }, - getTestNotificationsOperationSpec - ); - } - - /** - * Get the test notifications by the notification id - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param notificationId The notification id - * @param options The options parameters. - */ - getTestNotificationsAtResourceGroupLevel( - resourceGroupName: string, - notificationId: string, - options?: ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, notificationId, options }, - getTestNotificationsAtResourceGroupLevelOperationSpec - ); - } - /** * Get the test notifications by the notification id * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -631,15 +410,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActionGroupResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.actionGroup, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.actionGroupName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -655,14 +434,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActionGroupResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.actionGroupName ], headerParameters: [Parameters.accept], @@ -676,14 +455,14 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.actionGroupName ], headerParameters: [Parameters.accept], @@ -698,76 +477,16 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActionGroupResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.actionGroupPatch, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.actionGroupName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const postTestNotificationsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/createNotifications", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - 201: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - 202: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - 204: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.notificationRequest, - queryParameters: [Parameters.apiVersion4], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const createNotificationsAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/createNotifications", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - 201: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - 202: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - 204: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.notificationRequest, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.actionGroupName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -791,64 +510,21 @@ const createNotificationsAtActionGroupResourceLevelOperationSpec: coreClient.Ope bodyMapper: Mappers.TestNotificationDetailsResponse }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.notificationRequest, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.actionGroupName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; -const getTestNotificationsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/notificationStatus/{notificationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.notificationId - ], - headerParameters: [Parameters.accept], - serializer -}; -const getTestNotificationsAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/notificationStatus/{notificationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.notificationId - ], - headerParameters: [Parameters.accept], - serializer -}; const getTestNotificationsAtActionGroupResourceLevelOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}/notificationStatus/{notificationId}", @@ -858,14 +534,14 @@ const getTestNotificationsAtActionGroupResourceLevelOperationSpec: coreClient.Op bodyMapper: Mappers.TestNotificationDetailsResponse }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.actionGroupName, Parameters.notificationId ], @@ -881,10 +557,10 @@ const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActionGroupList }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -898,14 +574,14 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActionGroupList }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -920,15 +596,15 @@ const enableReceiverOperationSpec: coreClient.OperationSpec = { isError: true }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.enableRequest, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.actionGroupName ], headerParameters: [Parameters.accept, Parameters.contentType], diff --git a/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts b/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts index 87d37e3a8af9..a38ccab19aac 100644 --- a/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts +++ b/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts @@ -328,15 +328,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActivityLogAlertResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, requestBody: Parameters.activityLogAlertRule, - queryParameters: [Parameters.apiVersion12], + queryParameters: [Parameters.apiVersion14], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.activityLogAlertName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -352,14 +352,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActivityLogAlertResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, - queryParameters: [Parameters.apiVersion12], + queryParameters: [Parameters.apiVersion14], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.activityLogAlertName ], headerParameters: [Parameters.accept], @@ -373,14 +373,14 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, - queryParameters: [Parameters.apiVersion12], + queryParameters: [Parameters.apiVersion14], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.activityLogAlertName ], headerParameters: [Parameters.accept], @@ -395,15 +395,15 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActivityLogAlertResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, requestBody: Parameters.activityLogAlertRulePatch, - queryParameters: [Parameters.apiVersion12], + queryParameters: [Parameters.apiVersion14], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.activityLogAlertName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -419,10 +419,10 @@ const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleList }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, - queryParameters: [Parameters.apiVersion12], + queryParameters: [Parameters.apiVersion14], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -436,14 +436,14 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleList }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, - queryParameters: [Parameters.apiVersion12], + queryParameters: [Parameters.apiVersion14], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -456,7 +456,7 @@ const listBySubscriptionIdNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleList }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, urlParameters: [ @@ -475,13 +475,13 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleList }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/activityLogs.ts b/sdk/monitor/arm-monitor/src/operations/activityLogs.ts index ad27be0e79fc..8f5faf294e3f 100644 --- a/sdk/monitor/arm-monitor/src/operations/activityLogs.ts +++ b/sdk/monitor/arm-monitor/src/operations/activityLogs.ts @@ -158,11 +158,11 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.EventDataCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [ - Parameters.apiVersion1, + Parameters.apiVersion2, Parameters.filter, Parameters.select ], @@ -178,7 +178,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.EventDataCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, urlParameters: [ diff --git a/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts b/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts index 80aa7721e864..16cb785ce4b1 100644 --- a/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts +++ b/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts @@ -143,14 +143,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Incident }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName, Parameters.incidentName ], @@ -166,11 +166,11 @@ const listByAlertRuleOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.IncidentListResult } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/alertRules.ts b/sdk/monitor/arm-monitor/src/operations/alertRules.ts index a9c71c40c9b7..3eff6c431802 100644 --- a/sdk/monitor/arm-monitor/src/operations/alertRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/alertRules.ts @@ -250,15 +250,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -273,14 +273,14 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], @@ -295,14 +295,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], @@ -320,15 +320,15 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.alertRulesResource, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -344,14 +344,14 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -365,10 +365,10 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts b/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts index f4930cf25476..78bb9e9ed2e7 100644 --- a/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts +++ b/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts @@ -321,11 +321,11 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AutoscaleErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -346,11 +346,11 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.autoscaleSettingName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -368,11 +368,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AutoscaleErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.autoscaleSettingName ], headerParameters: [Parameters.accept], @@ -390,11 +390,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AutoscaleErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.autoscaleSettingName ], headerParameters: [Parameters.accept], @@ -413,11 +413,11 @@ const updateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.autoscaleSettingResource, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.autoscaleSettingName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -436,7 +436,7 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AutoscaleErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -454,8 +454,8 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/azureMonitorWorkspaces.ts b/sdk/monitor/arm-monitor/src/operations/azureMonitorWorkspaces.ts index 607208075284..0f60d8a6c1a7 100644 --- a/sdk/monitor/arm-monitor/src/operations/azureMonitorWorkspaces.ts +++ b/sdk/monitor/arm-monitor/src/operations/azureMonitorWorkspaces.ts @@ -13,6 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { MonitorClient } from "../monitorClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { AzureMonitorWorkspaceResource, AzureMonitorWorkspacesListByResourceGroupNextOptionalParams, @@ -28,6 +34,7 @@ import { AzureMonitorWorkspacesUpdateOptionalParams, AzureMonitorWorkspacesUpdateResponse, AzureMonitorWorkspacesDeleteOptionalParams, + AzureMonitorWorkspacesDeleteResponse, AzureMonitorWorkspacesListByResourceGroupNextResponse, AzureMonitorWorkspacesListBySubscriptionNextResponse } from "../models"; @@ -265,15 +272,90 @@ export class AzureMonitorWorkspacesImpl implements AzureMonitorWorkspaces { * insensitive * @param options The options parameters. */ - delete( + async beginDelete( resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, azureMonitorWorkspaceName, options }, - deleteOperationSpec + ): Promise< + SimplePollerLike< + OperationState, + AzureMonitorWorkspacesDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, azureMonitorWorkspaceName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + AzureMonitorWorkspacesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Delete a workspace + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureMonitorWorkspaceName The name of the Azure Monitor workspace. The name is case + * insensitive + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + azureMonitorWorkspaceName: string, + options?: AzureMonitorWorkspacesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + azureMonitorWorkspaceName, + options ); + return poller.pollUntilDone(); } /** @@ -320,14 +402,14 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResourceListResult }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -340,10 +422,10 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResourceListResult }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -357,14 +439,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.azureMonitorWorkspaceName ], headerParameters: [Parameters.accept], @@ -382,15 +464,15 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.azureMonitorWorkspaceProperties, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.azureMonitorWorkspaceName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -406,15 +488,15 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.azureMonitorWorkspaceProperties1, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.azureMonitorWorkspaceName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -426,17 +508,27 @@ const deleteOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", httpMethod: "DELETE", responses: { - 200: {}, - 204: {}, + 200: { + headersMapper: Mappers.AzureMonitorWorkspacesDeleteHeaders + }, + 201: { + headersMapper: Mappers.AzureMonitorWorkspacesDeleteHeaders + }, + 202: { + headersMapper: Mappers.AzureMonitorWorkspacesDeleteHeaders + }, + 204: { + headersMapper: Mappers.AzureMonitorWorkspacesDeleteHeaders + }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.azureMonitorWorkspaceName ], headerParameters: [Parameters.accept], @@ -450,13 +542,13 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResourceListResult }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], @@ -470,7 +562,7 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResourceListResult }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, urlParameters: [ diff --git a/sdk/monitor/arm-monitor/src/operations/baselines.ts b/sdk/monitor/arm-monitor/src/operations/baselines.ts index 5c7c5fa1abab..433840a3520e 100644 --- a/sdk/monitor/arm-monitor/src/operations/baselines.ts +++ b/sdk/monitor/arm-monitor/src/operations/baselines.ts @@ -102,7 +102,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricBaselinesResponse }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [ @@ -112,9 +112,9 @@ const listOperationSpec: coreClient.OperationSpec = { Parameters.interval1, Parameters.metricnames, Parameters.aggregation1, - Parameters.resultType, + Parameters.resultType1, Parameters.sensitivities, - Parameters.apiVersion6 + Parameters.apiVersion8 ], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts index 7bc434d0a6f3..8eb5a79d3113 100644 --- a/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts +++ b/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts @@ -315,11 +315,11 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -336,7 +336,7 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -353,11 +353,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionEndpointName ], headerParameters: [Parameters.accept], @@ -378,12 +378,12 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - requestBody: Parameters.body, - queryParameters: [Parameters.apiVersion13], + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionEndpointName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -402,12 +402,12 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - requestBody: Parameters.body1, - queryParameters: [Parameters.apiVersion13], + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionEndpointName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -425,11 +425,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionEndpointName ], headerParameters: [Parameters.accept], @@ -448,8 +448,8 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts index 51bceb3ab96d..989c3315bdb1 100644 --- a/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts +++ b/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts @@ -466,7 +466,7 @@ const listByResourceOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [Parameters.$host, Parameters.resourceUri1], headerParameters: [Parameters.accept], serializer @@ -484,11 +484,11 @@ const listByRuleOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionRuleName ], headerParameters: [Parameters.accept], @@ -507,11 +507,11 @@ const listByDataCollectionEndpointOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionEndpointName ], headerParameters: [Parameters.accept], @@ -529,7 +529,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, Parameters.resourceUri1, @@ -553,8 +553,8 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - requestBody: Parameters.body2, - queryParameters: [Parameters.apiVersion13], + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, Parameters.resourceUri1, @@ -575,7 +575,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, Parameters.resourceUri1, @@ -618,8 +618,8 @@ const listByRuleNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink, Parameters.dataCollectionRuleName ], @@ -640,8 +640,8 @@ const listByDataCollectionEndpointNextOperationSpec: coreClient.OperationSpec = }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink, Parameters.dataCollectionEndpointName ], diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts index df8ae456aef4..05716e374f2c 100644 --- a/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts @@ -311,11 +311,11 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -332,7 +332,7 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -349,11 +349,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionRuleName ], headerParameters: [Parameters.accept], @@ -374,12 +374,12 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - requestBody: Parameters.body3, - queryParameters: [Parameters.apiVersion13], + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionRuleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -398,12 +398,12 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - requestBody: Parameters.body1, - queryParameters: [Parameters.apiVersion13], + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionRuleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -421,11 +421,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionRuleName ], headerParameters: [Parameters.accept], @@ -444,8 +444,8 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts b/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts index 416c6f18f6d5..ada8204a1cce 100644 --- a/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts +++ b/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts @@ -160,10 +160,10 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DiagnosticSettingsResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion3], + queryParameters: [Parameters.apiVersion4], urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], headerParameters: [Parameters.accept], serializer @@ -176,11 +176,11 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DiagnosticSettingsResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion3], + queryParameters: [Parameters.apiVersion4], urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -193,10 +193,10 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion3], + queryParameters: [Parameters.apiVersion4], urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], headerParameters: [Parameters.accept], serializer @@ -209,10 +209,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DiagnosticSettingsResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion3], + queryParameters: [Parameters.apiVersion4], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts b/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts index 19bdf9571d7a..e4496038d14a 100644 --- a/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts +++ b/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts @@ -123,10 +123,10 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DiagnosticSettingsCategoryResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion3], + queryParameters: [Parameters.apiVersion4], urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], headerParameters: [Parameters.accept], serializer @@ -140,10 +140,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DiagnosticSettingsCategoryResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion3], + queryParameters: [Parameters.apiVersion4], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/eventCategories.ts b/sdk/monitor/arm-monitor/src/operations/eventCategories.ts index 06b81c9146b1..fe972023b825 100644 --- a/sdk/monitor/arm-monitor/src/operations/eventCategories.ts +++ b/sdk/monitor/arm-monitor/src/operations/eventCategories.ts @@ -95,10 +95,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.EventCategoryCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/index.ts b/sdk/monitor/arm-monitor/src/operations/index.ts index 772a7d4d63ff..e92a77600bc0 100644 --- a/sdk/monitor/arm-monitor/src/operations/index.ts +++ b/sdk/monitor/arm-monitor/src/operations/index.ts @@ -6,6 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./azureMonitorWorkspaces"; +export * from "./monitorOperations"; export * from "./autoscaleSettings"; export * from "./predictiveMetric"; export * from "./operations"; @@ -15,6 +17,7 @@ export * from "./logProfiles"; export * from "./diagnosticSettings"; export * from "./diagnosticSettingsCategory"; export * from "./actionGroups"; +export * from "./tenantActionGroups"; export * from "./activityLogs"; export * from "./eventCategories"; export * from "./tenantActivityLogs"; @@ -35,5 +38,3 @@ export * from "./activityLogAlerts"; export * from "./dataCollectionEndpoints"; export * from "./dataCollectionRuleAssociations"; export * from "./dataCollectionRules"; -export * from "./azureMonitorWorkspaces"; -export * from "./monitorOperations"; diff --git a/sdk/monitor/arm-monitor/src/operations/logProfiles.ts b/sdk/monitor/arm-monitor/src/operations/logProfiles.ts index 4fb57d8e48b5..654d9743f8dd 100644 --- a/sdk/monitor/arm-monitor/src/operations/logProfiles.ts +++ b/sdk/monitor/arm-monitor/src/operations/logProfiles.ts @@ -162,7 +162,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}", httpMethod: "DELETE", responses: { 200: {} }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -179,10 +179,10 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.LogProfileResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -201,7 +201,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -220,11 +220,11 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.LogProfileResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.logProfilesResource, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -243,7 +243,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.LogProfileCollection } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts b/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts index a47b7e6616e3..5459d6b26611 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts @@ -246,10 +246,10 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -263,14 +263,14 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -284,14 +284,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], @@ -306,15 +306,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -330,15 +330,15 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.parameters5, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -353,14 +353,14 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts b/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts index 65d81ff00171..ff53b1843605 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts @@ -78,14 +78,14 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertStatusCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], @@ -100,14 +100,14 @@ const listByNameOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertStatusCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName, Parameters.statusName ], diff --git a/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts b/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts index e63fa4aab82d..fdee6c2fd803 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts @@ -13,6 +13,9 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { MonitorClient } from "../monitorClient"; import { + SubscriptionScopeMetricDefinition, + MetricDefinitionsListAtSubscriptionScopeOptionalParams, + MetricDefinitionsListAtSubscriptionScopeResponse, MetricDefinition, MetricDefinitionsListOptionalParams, MetricDefinitionsListResponse @@ -31,6 +34,58 @@ export class MetricDefinitionsImpl implements MetricDefinitions { this.client = client; } + /** + * Lists the metric definitions for the subscription. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + public listAtSubscriptionScope( + region: string, + options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtSubscriptionScopePagingAll(region, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAtSubscriptionScopePagingPage( + region, + options, + settings + ); + } + }; + } + + private async *listAtSubscriptionScopePagingPage( + region: string, + options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams, + _settings?: PageSettings + ): AsyncIterableIterator { + let result: MetricDefinitionsListAtSubscriptionScopeResponse; + result = await this._listAtSubscriptionScope(region, options); + yield result.value || []; + } + + private async *listAtSubscriptionScopePagingAll( + region: string, + options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtSubscriptionScopePagingPage( + region, + options + )) { + yield* page; + } + } + /** * Lists the metric definitions for the resource. * @param resourceUri The identifier of the resource. @@ -76,6 +131,21 @@ export class MetricDefinitionsImpl implements MetricDefinitions { } } + /** + * Lists the metric definitions for the subscription. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + private _listAtSubscriptionScope( + region: string, + options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { region, options }, + listAtSubscriptionScopeOperationSpec + ); + } + /** * Lists the metric definitions for the resource. * @param resourceUri The identifier of the resource. @@ -94,6 +164,27 @@ export class MetricDefinitionsImpl implements MetricDefinitions { // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SubscriptionScopeMetricDefinitionCollection + }, + default: { + bodyMapper: Mappers.ErrorContract + } + }, + queryParameters: [ + Parameters.apiVersion7, + Parameters.region, + Parameters.metricnamespace + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; const listOperationSpec: coreClient.OperationSpec = { path: "/{resourceUri}/providers/Microsoft.Insights/metricDefinitions", httpMethod: "GET", @@ -102,10 +193,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricDefinitionCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion5, Parameters.metricnamespace], + queryParameters: [Parameters.apiVersion7, Parameters.metricnamespace], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts b/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts index 65ef9597becc..1155dd3e243d 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts @@ -102,10 +102,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricNamespaceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion9, Parameters.startTime], + queryParameters: [Parameters.apiVersion11, Parameters.startTime], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/metricsOperations.ts b/sdk/monitor/arm-monitor/src/operations/metricsOperations.ts index 257b46781186..637036388d3c 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricsOperations.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricsOperations.ts @@ -11,7 +11,14 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { MonitorClient } from "../monitorClient"; -import { MetricsListOptionalParams, MetricsListResponse } from "../models"; +import { + MetricsListAtSubscriptionScopeOptionalParams, + MetricsListAtSubscriptionScopeResponse, + MetricsListAtSubscriptionScopePostOptionalParams, + MetricsListAtSubscriptionScopePostResponse, + MetricsListOptionalParams, + MetricsListResponse +} from "../models"; /** Class containing MetricsOperations operations. */ export class MetricsOperationsImpl implements MetricsOperations { @@ -25,6 +32,37 @@ export class MetricsOperationsImpl implements MetricsOperations { this.client = client; } + /** + * **Lists the metric data for a subscription**. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + listAtSubscriptionScope( + region: string, + options?: MetricsListAtSubscriptionScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { region, options }, + listAtSubscriptionScopeOperationSpec + ); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or + * the body. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + listAtSubscriptionScopePost( + region: string, + options?: MetricsListAtSubscriptionScopePostOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { region, options }, + listAtSubscriptionScopePostOperationSpec + ); + } + /** * **Lists the metric values for a resource**. * @param resourceUri The identifier of the resource. @@ -43,6 +81,68 @@ export class MetricsOperationsImpl implements MetricsOperations { // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SubscriptionScopeMetricResponse + }, + default: { + bodyMapper: Mappers.ErrorContract + } + }, + queryParameters: [ + Parameters.filter1, + Parameters.apiVersion7, + Parameters.region, + Parameters.metricnamespace, + Parameters.timespan1, + Parameters.interval1, + Parameters.metricnames, + Parameters.aggregation1, + Parameters.top, + Parameters.orderby, + Parameters.resultType, + Parameters.autoAdjustTimegrain, + Parameters.validateDimensions + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listAtSubscriptionScopePostOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.SubscriptionScopeMetricResponse + }, + default: { + bodyMapper: Mappers.ErrorContract + } + }, + requestBody: Parameters.body, + queryParameters: [ + Parameters.filter1, + Parameters.apiVersion7, + Parameters.region, + Parameters.metricnamespace, + Parameters.timespan1, + Parameters.interval1, + Parameters.metricnames, + Parameters.aggregation1, + Parameters.top, + Parameters.orderby, + Parameters.resultType, + Parameters.autoAdjustTimegrain, + Parameters.validateDimensions + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const listOperationSpec: coreClient.OperationSpec = { path: "/{resourceUri}/providers/Microsoft.Insights/metrics", httpMethod: "GET", @@ -51,12 +151,12 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Response }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [ Parameters.filter1, - Parameters.apiVersion5, + Parameters.apiVersion7, Parameters.metricnamespace, Parameters.timespan1, Parameters.interval1, @@ -64,7 +164,9 @@ const listOperationSpec: coreClient.OperationSpec = { Parameters.aggregation1, Parameters.top, Parameters.orderby, - Parameters.resultType + Parameters.autoAdjustTimegrain, + Parameters.validateDimensions, + Parameters.resultType1 ], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/monitorOperations.ts b/sdk/monitor/arm-monitor/src/operations/monitorOperations.ts index bed37b715908..45d82add9318 100644 --- a/sdk/monitor/arm-monitor/src/operations/monitorOperations.ts +++ b/sdk/monitor/arm-monitor/src/operations/monitorOperations.ts @@ -14,7 +14,7 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { MonitorClient } from "../monitorClient"; import { - OperationAutoGenerated, + Operation, MonitorOperationsListNextOptionalParams, MonitorOperationsListOptionalParams, MonitorOperationsListResponse, @@ -40,7 +40,7 @@ export class MonitorOperationsImpl implements MonitorOperations { */ public list( options?: MonitorOperationsListOptionalParams - ): PagedAsyncIterableIterator { + ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -61,7 +61,7 @@ export class MonitorOperationsImpl implements MonitorOperations { private async *listPagingPage( options?: MonitorOperationsListOptionalParams, settings?: PageSettings - ): AsyncIterableIterator { + ): AsyncIterableIterator { let result: MonitorOperationsListResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { @@ -82,7 +82,7 @@ export class MonitorOperationsImpl implements MonitorOperations { private async *listPagingAll( options?: MonitorOperationsListOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; } @@ -121,13 +121,13 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResultAutoGenerated + bodyMapper: Mappers.OperationListResult }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer @@ -137,10 +137,10 @@ const listNextOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResultAutoGenerated + bodyMapper: Mappers.OperationListResult }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, urlParameters: [Parameters.$host, Parameters.nextLink], diff --git a/sdk/monitor/arm-monitor/src/operations/operations.ts b/sdk/monitor/arm-monitor/src/operations/operations.ts index d9c5ceca0a06..cc024f9309b8 100644 --- a/sdk/monitor/arm-monitor/src/operations/operations.ts +++ b/sdk/monitor/arm-monitor/src/operations/operations.ts @@ -46,10 +46,10 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResultAutoGenerated } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/predictiveMetric.ts b/sdk/monitor/arm-monitor/src/operations/predictiveMetric.ts index 2aebcbf6ba75..ff907fd3e61a 100644 --- a/sdk/monitor/arm-monitor/src/operations/predictiveMetric.ts +++ b/sdk/monitor/arm-monitor/src/operations/predictiveMetric.ts @@ -83,7 +83,7 @@ const getOperationSpec: coreClient.OperationSpec = { } }, queryParameters: [ - Parameters.apiVersion, + Parameters.apiVersion1, Parameters.timespan, Parameters.interval, Parameters.metricNamespace, @@ -92,8 +92,8 @@ const getOperationSpec: coreClient.OperationSpec = { ], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.autoscaleSettingName ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts b/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts index 172bd4ed24ed..089d9e951a52 100644 --- a/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts +++ b/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts @@ -20,7 +20,7 @@ import { createLroSpec } from "../lroImpl"; import { PrivateEndpointConnectionsGetOptionalParams, PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnection, + PrivateEndpointConnectionAutoGenerated, PrivateEndpointConnectionsCreateOrUpdateOptionalParams, PrivateEndpointConnectionsCreateOrUpdateResponse, PrivateEndpointConnectionsDeleteOptionalParams, @@ -72,7 +72,7 @@ export class PrivateEndpointConnectionsImpl resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, + parameters: PrivateEndpointConnectionAutoGenerated, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams ): Promise< SimplePollerLike< @@ -153,7 +153,7 @@ export class PrivateEndpointConnectionsImpl resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, + parameters: PrivateEndpointConnectionAutoGenerated, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams ): Promise { const poller = await this.beginCreateOrUpdate( @@ -284,17 +284,17 @@ const getOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated }, default: { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName, Parameters.privateEndpointConnectionName ], @@ -307,27 +307,27 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated }, 201: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated }, 202: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated }, 204: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated }, default: { bodyMapper: Mappers.DefaultErrorResponse } }, requestBody: Parameters.parameters8, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName, Parameters.privateEndpointConnectionName ], @@ -348,11 +348,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName, Parameters.privateEndpointConnectionName ], @@ -371,11 +371,11 @@ const listByPrivateLinkScopeOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts index 8d83df363410..12b7547e027e 100644 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts @@ -81,11 +81,11 @@ const listByPrivateLinkScopeOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept], @@ -103,11 +103,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName, Parameters.groupName ], diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts index 17aeeea26cfb..6c4cb6c4e4dc 100644 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts @@ -61,11 +61,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.asyncOperationId ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts index 3f86e1345fb4..20e219800fad 100644 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts @@ -387,11 +387,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.name, Parameters.scopeName ], @@ -420,11 +420,11 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters9, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.name, Parameters.scopeName ], @@ -445,11 +445,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.name, Parameters.scopeName ], @@ -468,11 +468,11 @@ const listByPrivateLinkScopeOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept], @@ -491,8 +491,8 @@ const listByPrivateLinkScopeNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink, Parameters.scopeName ], diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts index 8589c22dc234..e5e95360e401 100644 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts @@ -391,7 +391,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -408,11 +408,11 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -430,11 +430,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept], @@ -452,11 +452,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept], @@ -478,11 +478,11 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.azureMonitorPrivateLinkScopePayload, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -502,11 +502,11 @@ const updateTagsOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.privateLinkScopeTags, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -545,8 +545,8 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts b/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts index cad03c26e444..3bac07d0c4db 100644 --- a/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts @@ -313,10 +313,10 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, - queryParameters: [Parameters.apiVersion8], + queryParameters: [Parameters.apiVersion10], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -330,14 +330,14 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, - queryParameters: [Parameters.apiVersion8], + queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -351,14 +351,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResource }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, - queryParameters: [Parameters.apiVersion8], + queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], @@ -376,15 +376,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResource }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion8], + queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -400,15 +400,15 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResource }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, requestBody: Parameters.parameters7, - queryParameters: [Parameters.apiVersion8], + queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -423,14 +423,14 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, - queryParameters: [Parameters.apiVersion8], + queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], @@ -444,7 +444,7 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, urlParameters: [ @@ -463,13 +463,13 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/tenantActionGroups.ts b/sdk/monitor/arm-monitor/src/operations/tenantActionGroups.ts new file mode 100644 index 000000000000..432fda5aa863 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/tenantActionGroups.ts @@ -0,0 +1,335 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { TenantActionGroups } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MonitorClient } from "../monitorClient"; +import { + TenantActionGroupResource, + TenantActionGroupsListByManagementGroupIdOptionalParams, + TenantActionGroupsListByManagementGroupIdResponse, + TenantActionGroupsCreateOrUpdateOptionalParams, + TenantActionGroupsCreateOrUpdateResponse, + TenantActionGroupsGetOptionalParams, + TenantActionGroupsGetResponse, + TenantActionGroupsDeleteOptionalParams, + ActionGroupPatchBodyAutoGenerated, + TenantActionGroupsUpdateOptionalParams, + TenantActionGroupsUpdateResponse +} from "../models"; + +/// +/** Class containing TenantActionGroups operations. */ +export class TenantActionGroupsImpl implements TenantActionGroups { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class TenantActionGroups class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Get a list of all tenant action groups in a management group. + * @param managementGroupId The management group id. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + public listByManagementGroupId( + managementGroupId: string, + xMsClientTenantId: string, + options?: TenantActionGroupsListByManagementGroupIdOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagementGroupIdPagingAll( + managementGroupId, + xMsClientTenantId, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByManagementGroupIdPagingPage( + managementGroupId, + xMsClientTenantId, + options, + settings + ); + } + }; + } + + private async *listByManagementGroupIdPagingPage( + managementGroupId: string, + xMsClientTenantId: string, + options?: TenantActionGroupsListByManagementGroupIdOptionalParams, + _settings?: PageSettings + ): AsyncIterableIterator { + let result: TenantActionGroupsListByManagementGroupIdResponse; + result = await this._listByManagementGroupId( + managementGroupId, + xMsClientTenantId, + options + ); + yield result.value || []; + } + + private async *listByManagementGroupIdPagingAll( + managementGroupId: string, + xMsClientTenantId: string, + options?: TenantActionGroupsListByManagementGroupIdOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagementGroupIdPagingPage( + managementGroupId, + xMsClientTenantId, + options + )) { + yield* page; + } + } + + /** + * Create a new tenant action group or update an existing one. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param actionGroup The tenant action group to create or use for the update. + * @param options The options parameters. + */ + createOrUpdate( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + actionGroup: TenantActionGroupResource, + options?: TenantActionGroupsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + tenantActionGroupName, + xMsClientTenantId, + actionGroup, + options + }, + createOrUpdateOperationSpec + ); + } + + /** + * Get a tenant action group. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + get( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + options?: TenantActionGroupsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, tenantActionGroupName, xMsClientTenantId, options }, + getOperationSpec + ); + } + + /** + * Delete a tenant action group. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + delete( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + options?: TenantActionGroupsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, tenantActionGroupName, xMsClientTenantId, options }, + deleteOperationSpec + ); + } + + /** + * Updates an existing tenant action group's tags. To update other fields use the CreateOrUpdate + * method. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param tenantActionGroupPatch Parameters supplied to the operation. + * @param options The options parameters. + */ + update( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + tenantActionGroupPatch: ActionGroupPatchBodyAutoGenerated, + options?: TenantActionGroupsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + tenantActionGroupName, + xMsClientTenantId, + tenantActionGroupPatch, + options + }, + updateOperationSpec + ); + } + + /** + * Get a list of all tenant action groups in a management group. + * @param managementGroupId The management group id. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + private _listByManagementGroupId( + managementGroupId: string, + xMsClientTenantId: string, + options?: TenantActionGroupsListByManagementGroupIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, xMsClientTenantId, options }, + listByManagementGroupIdOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.TenantActionGroupResource + }, + 201: { + bodyMapper: Mappers.TenantActionGroupResource + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + requestBody: Parameters.actionGroup1, + queryParameters: [Parameters.apiVersion6], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.tenantActionGroupName + ], + headerParameters: [ + Parameters.accept, + Parameters.contentType, + Parameters.xMsClientTenantId + ], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TenantActionGroupResource + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.tenantActionGroupName + ], + headerParameters: [Parameters.accept, Parameters.xMsClientTenantId], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.tenantActionGroupName + ], + headerParameters: [Parameters.accept, Parameters.xMsClientTenantId], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.TenantActionGroupResource + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + requestBody: Parameters.tenantActionGroupPatch, + queryParameters: [Parameters.apiVersion6], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.tenantActionGroupName + ], + headerParameters: [ + Parameters.accept, + Parameters.contentType, + Parameters.xMsClientTenantId + ], + mediaType: "json", + serializer +}; +const listByManagementGroupIdOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TenantActionGroupList + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [Parameters.$host, Parameters.managementGroupId], + headerParameters: [Parameters.accept, Parameters.xMsClientTenantId], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts b/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts index 9ad3a25eca1a..c5e8bb4484fa 100644 --- a/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts +++ b/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts @@ -130,11 +130,11 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.EventDataCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [ - Parameters.apiVersion1, + Parameters.apiVersion2, Parameters.select, Parameters.filter1 ], @@ -150,7 +150,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.EventDataCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, urlParameters: [Parameters.$host, Parameters.nextLink], diff --git a/sdk/monitor/arm-monitor/src/operations/vMInsights.ts b/sdk/monitor/arm-monitor/src/operations/vMInsights.ts index 01ce4a4a57fd..84b592f800c3 100644 --- a/sdk/monitor/arm-monitor/src/operations/vMInsights.ts +++ b/sdk/monitor/arm-monitor/src/operations/vMInsights.ts @@ -59,7 +59,7 @@ const getOnboardingStatusOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ResponseWithError } }, - queryParameters: [Parameters.apiVersion10], + queryParameters: [Parameters.apiVersion12], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/actionGroups.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/actionGroups.ts index 4c7654b5a4a9..c613fd4135b0 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/actionGroups.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/actionGroups.ts @@ -21,16 +21,8 @@ import { ActionGroupsUpdateOptionalParams, ActionGroupsUpdateResponse, NotificationRequestBody, - ActionGroupsPostTestNotificationsOptionalParams, - ActionGroupsPostTestNotificationsResponse, - ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams, - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse, ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams, ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse, - ActionGroupsGetTestNotificationsOptionalParams, - ActionGroupsGetTestNotificationsResponse, - ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams, - ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse, ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams, ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse, EnableRequest, @@ -104,58 +96,6 @@ export interface ActionGroups { actionGroupPatch: ActionGroupPatchBody, options?: ActionGroupsUpdateOptionalParams ): Promise; - /** - * Send test notifications to a set of provided receivers - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - beginPostTestNotifications( - notificationRequest: NotificationRequestBody, - options?: ActionGroupsPostTestNotificationsOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - ActionGroupsPostTestNotificationsResponse - > - >; - /** - * Send test notifications to a set of provided receivers - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - beginPostTestNotificationsAndWait( - notificationRequest: NotificationRequestBody, - options?: ActionGroupsPostTestNotificationsOptionalParams - ): Promise; - /** - * Send test notifications to a set of provided receivers - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - beginCreateNotificationsAtResourceGroupLevel( - resourceGroupName: string, - notificationRequest: NotificationRequestBody, - options?: ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - ): Promise< - SimplePollerLike< - OperationState< - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - >, - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - > - >; - /** - * Send test notifications to a set of provided receivers - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName: string, - notificationRequest: NotificationRequestBody, - options?: ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - ): Promise; /** * Send test notifications to a set of provided receivers * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -189,26 +129,6 @@ export interface ActionGroups { notificationRequest: NotificationRequestBody, options?: ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams ): Promise; - /** - * Get the test notifications by the notification id - * @param notificationId The notification id - * @param options The options parameters. - */ - getTestNotifications( - notificationId: string, - options?: ActionGroupsGetTestNotificationsOptionalParams - ): Promise; - /** - * Get the test notifications by the notification id - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param notificationId The notification id - * @param options The options parameters. - */ - getTestNotificationsAtResourceGroupLevel( - resourceGroupName: string, - notificationId: string, - options?: ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams - ): Promise; /** * Get the test notifications by the notification id * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/azureMonitorWorkspaces.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/azureMonitorWorkspaces.ts index 8d0b3a72260b..8d96716ff844 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/azureMonitorWorkspaces.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/azureMonitorWorkspaces.ts @@ -7,6 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { AzureMonitorWorkspaceResource, AzureMonitorWorkspacesListByResourceGroupOptionalParams, @@ -17,7 +18,8 @@ import { AzureMonitorWorkspacesCreateResponse, AzureMonitorWorkspacesUpdateOptionalParams, AzureMonitorWorkspacesUpdateResponse, - AzureMonitorWorkspacesDeleteOptionalParams + AzureMonitorWorkspacesDeleteOptionalParams, + AzureMonitorWorkspacesDeleteResponse } from "../models"; /// @@ -85,9 +87,26 @@ export interface AzureMonitorWorkspaces { * insensitive * @param options The options parameters. */ - delete( + beginDelete( resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesDeleteOptionalParams - ): Promise; + ): Promise< + SimplePollerLike< + OperationState, + AzureMonitorWorkspacesDeleteResponse + > + >; + /** + * Delete a workspace + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureMonitorWorkspaceName The name of the Azure Monitor workspace. The name is case + * insensitive + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + azureMonitorWorkspaceName: string, + options?: AzureMonitorWorkspacesDeleteOptionalParams + ): Promise; } diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts index 772a7d4d63ff..e92a77600bc0 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts @@ -6,6 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./azureMonitorWorkspaces"; +export * from "./monitorOperations"; export * from "./autoscaleSettings"; export * from "./predictiveMetric"; export * from "./operations"; @@ -15,6 +17,7 @@ export * from "./logProfiles"; export * from "./diagnosticSettings"; export * from "./diagnosticSettingsCategory"; export * from "./actionGroups"; +export * from "./tenantActionGroups"; export * from "./activityLogs"; export * from "./eventCategories"; export * from "./tenantActivityLogs"; @@ -35,5 +38,3 @@ export * from "./activityLogAlerts"; export * from "./dataCollectionEndpoints"; export * from "./dataCollectionRuleAssociations"; export * from "./dataCollectionRules"; -export * from "./azureMonitorWorkspaces"; -export * from "./monitorOperations"; diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts index 1a98f35a1568..73b2983e9b49 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts @@ -8,6 +8,8 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { + SubscriptionScopeMetricDefinition, + MetricDefinitionsListAtSubscriptionScopeOptionalParams, MetricDefinition, MetricDefinitionsListOptionalParams } from "../models"; @@ -15,6 +17,15 @@ import { /// /** Interface representing a MetricDefinitions. */ export interface MetricDefinitions { + /** + * Lists the metric definitions for the subscription. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + listAtSubscriptionScope( + region: string, + options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams + ): PagedAsyncIterableIterator; /** * Lists the metric definitions for the resource. * @param resourceUri The identifier of the resource. diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts index a9b3f7a4756a..b424c42e513c 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts @@ -6,10 +6,36 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { MetricsListOptionalParams, MetricsListResponse } from "../models"; +import { + MetricsListAtSubscriptionScopeOptionalParams, + MetricsListAtSubscriptionScopeResponse, + MetricsListAtSubscriptionScopePostOptionalParams, + MetricsListAtSubscriptionScopePostResponse, + MetricsListOptionalParams, + MetricsListResponse +} from "../models"; /** Interface representing a MetricsOperations. */ export interface MetricsOperations { + /** + * **Lists the metric data for a subscription**. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + listAtSubscriptionScope( + region: string, + options?: MetricsListAtSubscriptionScopeOptionalParams + ): Promise; + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or + * the body. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + listAtSubscriptionScopePost( + region: string, + options?: MetricsListAtSubscriptionScopePostOptionalParams + ): Promise; /** * **Lists the metric values for a resource**. * @param resourceUri The identifier of the resource. diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/monitorOperations.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/monitorOperations.ts index af36a9b0beca..5764a4019298 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/monitorOperations.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/monitorOperations.ts @@ -7,10 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - OperationAutoGenerated, - MonitorOperationsListOptionalParams -} from "../models"; +import { Operation, MonitorOperationsListOptionalParams } from "../models"; /// /** Interface representing a MonitorOperations. */ @@ -21,5 +18,5 @@ export interface MonitorOperations { */ list( options?: MonitorOperationsListOptionalParams - ): PagedAsyncIterableIterator; + ): PagedAsyncIterableIterator; } diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts index a5661bf7e3ba..81ea039795e6 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts @@ -10,7 +10,7 @@ import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { PrivateEndpointConnectionsGetOptionalParams, PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnection, + PrivateEndpointConnectionAutoGenerated, PrivateEndpointConnectionsCreateOrUpdateOptionalParams, PrivateEndpointConnectionsCreateOrUpdateResponse, PrivateEndpointConnectionsDeleteOptionalParams, @@ -45,7 +45,7 @@ export interface PrivateEndpointConnections { resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, + parameters: PrivateEndpointConnectionAutoGenerated, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams ): Promise< SimplePollerLike< @@ -65,7 +65,7 @@ export interface PrivateEndpointConnections { resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, + parameters: PrivateEndpointConnectionAutoGenerated, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams ): Promise; /** diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActionGroups.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActionGroups.ts new file mode 100644 index 000000000000..5300652dfee8 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActionGroups.ts @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + TenantActionGroupResource, + TenantActionGroupsListByManagementGroupIdOptionalParams, + TenantActionGroupsCreateOrUpdateOptionalParams, + TenantActionGroupsCreateOrUpdateResponse, + TenantActionGroupsGetOptionalParams, + TenantActionGroupsGetResponse, + TenantActionGroupsDeleteOptionalParams, + ActionGroupPatchBodyAutoGenerated, + TenantActionGroupsUpdateOptionalParams, + TenantActionGroupsUpdateResponse +} from "../models"; + +/// +/** Interface representing a TenantActionGroups. */ +export interface TenantActionGroups { + /** + * Get a list of all tenant action groups in a management group. + * @param managementGroupId The management group id. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + listByManagementGroupId( + managementGroupId: string, + xMsClientTenantId: string, + options?: TenantActionGroupsListByManagementGroupIdOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create a new tenant action group or update an existing one. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param actionGroup The tenant action group to create or use for the update. + * @param options The options parameters. + */ + createOrUpdate( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + actionGroup: TenantActionGroupResource, + options?: TenantActionGroupsCreateOrUpdateOptionalParams + ): Promise; + /** + * Get a tenant action group. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + get( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + options?: TenantActionGroupsGetOptionalParams + ): Promise; + /** + * Delete a tenant action group. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + delete( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + options?: TenantActionGroupsDeleteOptionalParams + ): Promise; + /** + * Updates an existing tenant action group's tags. To update other fields use the CreateOrUpdate + * method. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param tenantActionGroupPatch Parameters supplied to the operation. + * @param options The options parameters. + */ + update( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + tenantActionGroupPatch: ActionGroupPatchBodyAutoGenerated, + options?: TenantActionGroupsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/test/monitor_examples.ts b/sdk/monitor/arm-monitor/test/monitor_examples.ts deleted file mode 100644 index da011ff4f258..000000000000 --- a/sdk/monitor/arm-monitor/test/monitor_examples.ts +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { MonitorClient } from "../src/monitorClient"; -import { LogicManagementClient } from "@azure/arm-logic"; -import { StorageManagementClient } from "@azure/arm-storage"; -import { EventHubManagementClient } from "@azure/arm-eventhub"; -import { OperationalInsightsManagementClient } from "@azure/arm-operationalinsights"; - -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("Monitor test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: MonitorClient; - let location: string; - let resourceGroup: string; - let workflowName: string; - let storageAccountName: string; - let namespaceName: string; - let authorizationRuleName: string; - let eventhubName: string; - let workspaceName: string; - let logProfileName: string; - let diagnosticName: string; - let logic_client: LogicManagementClient; - let storage_client: StorageManagementClient; - let eventhub_client: EventHubManagementClient; - let op_client: OperationalInsightsManagementClient; - let workflowsId: string; - let storageId: string; - let authorizationId: string; - let workspaceId: string; - let azureMonitorWorkspaceName: 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 MonitorClient(credential, subscriptionId, recorder.configureClientOptions({})); - logic_client = new LogicManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - storage_client = new StorageManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - eventhub_client = new EventHubManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - op_client = new OperationalInsightsManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "myjstest"; - workflowName = "myworkflowxxx"; - storageAccountName = "mystorageaccountyyy"; - namespaceName = "mynamespacexxx"; - eventhubName = "myeventhubxxx"; - workspaceName = "myworkspacexxx"; - authorizationRuleName = "myauthorizationRulexxx"; - logProfileName = "mylogProfilexxx"; - diagnosticName = "mydiagnosticxxxx"; - azureMonitorWorkspaceName = "myAzureMonitorWorkspace" - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("create parameters for diagnosticSettings", async function () { - //workflows.createOrUpdate - const res = await logic_client.workflows.createOrUpdate(resourceGroup, workflowName, { - location: location, - definition: { - "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", - "contentVersion": "1.0.0.0", - "parameters": {}, - "triggers": {}, - "actions": {}, - "outputs": {} - } - }); - workflowsId = (res.id || "/").substring(1); - - //storageAccounts.beginCreateAndWait - const storageaccount = await storage_client.storageAccounts.beginCreateAndWait(resourceGroup, storageAccountName, { - sku: { - name: "Standard_GRS", - }, - kind: "StorageV2", - location: "eastus", - encryption: { - services: { - file: { - keyType: "Account", - enabled: true, - }, - blob: { - keyType: "Account", - enabled: true, - }, - }, - keySource: "Microsoft.Storage", - }, - tags: { - key1: "value1", - key2: "value2", - } - }); - storageId = storageaccount.id || ""; - - //namespaces.beginCreateOrUpdateAndWait - const namespaces = await eventhub_client.namespaces.beginCreateOrUpdateAndWait(resourceGroup, namespaceName, { - sku: { - name: "Standard", - tier: "Standard", - }, - location: location, - tags: { - tag1: "value1", - tag2: "value2", - } - }) - //namespaces.createOrUpdateAuthorizationRule - const authorization = await eventhub_client.namespaces.createOrUpdateAuthorizationRule(resourceGroup, namespaceName, authorizationRuleName, { rights: ["Listen", "Send", "Manage"] }); - //eventHubs.createOrUpdate - const eventhub = await eventhub_client.eventHubs.createOrUpdate(resourceGroup, namespaceName, eventhubName, { - messageRetentionInDays: 4, - partitionCount: 4, - status: "Active", - captureDescription: { - enabled: true, - encoding: "Avro", - intervalInSeconds: 120, - sizeLimitInBytes: 10485763, - destination: { - name: "EventHubArchive.AzureBlockBlob", - storageAccountResourceId: "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroup + "/providers/Microsoft.Storage/storageAccounts/" + storageAccountName, - blobContainer: "container", - archiveNameFormat: "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}", - } - } - }); - authorizationId = authorization.id || ""; - - //workspaces.beginCreateOrUpdateAndWait - const workspace = await op_client.workspaces.beginCreateOrUpdateAndWait(resourceGroup, workspaceName, { - sku: { - name: "PerNode" - }, - retentionInDays: 30, - location: location, - tags: { - tag1: "value1" - } - }) - workspaceId = workspace.id || ""; - }); - - it("diagnosticSettings create test", async function () { - const res = await client.diagnosticSettings.createOrUpdate(workflowsId, diagnosticName, { - storageAccountId: storageId, - workspaceId: workspaceId, - eventHubAuthorizationRuleId: authorizationId, - eventHubName: eventhubName, - metrics: [], - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { - enabled: false, - days: 0 - } - } - ] - }) - assert.equal(res.name, diagnosticName); - }); - - it("diagnosticSettings get test", async function () { - const res = await client.diagnosticSettings.get(workflowsId, diagnosticName); - assert.equal(res.name, diagnosticName); - }); - - it("diagnosticSettings list test", async function () { - const res = await client.diagnosticSettings.list(workflowsId); - }); - - it("diagnosticSettings delete test", async function () { - const res = await client.diagnosticSettings.delete(workflowsId, diagnosticName); - }); - - it("logProfiles create test", async function () { - //delete sample logfile - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - if (resArray.length >= 1) { - await client.logProfiles.delete("sample-log-profile") - } - const res = await client.logProfiles.createOrUpdate(logProfileName, { - location: "", - locations: [ - "global" - ], - categories: [ - "Write", - "Delete", - "Action" - ], - retentionPolicy: { - enabled: true, - days: 3 - }, - storageAccountId: storageId - }) - assert.equal(res.name, logProfileName); - }); - - it("logProfiles get test", async function () { - const res = await client.logProfiles.get(logProfileName); - assert.equal(res.name, logProfileName); - }); - - it("logProfiles list test", async function () { - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("workspace create test", async function () { - const res = await client.azureMonitorWorkspaces.create( - resourceGroup, - azureMonitorWorkspaceName, - { - location - }); - assert.equal(res.name, azureMonitorWorkspaceName); - }); - - it("workspace get test", async function () { - const res = await client.azureMonitorWorkspaces.get(resourceGroup, azureMonitorWorkspaceName); - assert.equal(res.name, azureMonitorWorkspaceName); - }); - - it("workspace list test", async function () { - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("workspace delete test", async function () { - const resArray = new Array(); - const res = await client.azureMonitorWorkspaces.delete(resourceGroup, azureMonitorWorkspaceName) - for await (let item of client.azureMonitorWorkspaces.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); - - it("delete parameters for diagnosticSettings", async function () { - const workflowDlete = await logic_client.workflows.delete(resourceGroup, workflowName); - const storageDelete = await storage_client.storageAccounts.delete(resourceGroup, storageAccountName); - const namespaceDelete = await eventhub_client.namespaces.beginDeleteAndWait(resourceGroup, namespaceName); - const workspaceDelete = await op_client.workspaces.beginDeleteAndWait(resourceGroup, workspaceName); - }); - - it("logProfiles delete test", async function () { - const res = await client.logProfiles.delete(logProfileName); - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - assert.equal(resArray.length, 1); //still exist sample logfile - }); -}); diff --git a/sdk/monitor/arm-monitor/test/sampleTest.ts b/sdk/monitor/arm-monitor/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/monitor/arm-monitor/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +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 +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/monitor/arm-monitor/tsconfig.json b/sdk/monitor/arm-monitor/tsconfig.json index 293df9ae64ce..3e6ae96443f3 100644 --- a/sdk/monitor/arm-monitor/tsconfig.json +++ b/sdk/monitor/arm-monitor/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-monitor": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"